Within the Screen Painter, you can define two types of input help:
1. The FIELDstatement with one of the additions VALUES or SELECT.
2. Linking a search help directly to a screen field.
If you link a search help directly to a screen field, it overrides the additions of the FIELD statement. However, the input check functions of the FIELD statement remain unaffected.
The following input help methods are obsolete and should not be used. They are still supported for compatibility reasons.
In the screen flow logic, you can specify a value list for a screen field f as follows:
FIELD f VALUES (val1, val2,...).
The value list should be defined using a series of single values val1, val2,.... The NOT and BETWEENadditions for the input check are not appropriate for input help.
You can also create a value list by accessing a database table as follows:
FIELD f SELECT *
WHERE k1 = f1 AND k2 = f2 AND...
In the WHERE condition, the fields of the primary key k1, k2 … of the database table dbtab are checked against the screen fields f1 , f2 ... The WHENEVERaddition, used with input checks, is not necessary for input help.
If you have used a ABAP Dictionary reference for field f, the selection and the hit list formatting may be affected by any check table attached to the field.
Search helps from the ABAP Dictionary can be attached to a screen field. To do this, enter the name of the search help in the corresponding field in the attributes of the screen field in the Screen Painter. This assigns the first parameter of the search help to the screen field. As a result, it is only possible to return one value from the hit list to the screen template.
Input help on a screen.
REPORT demo_dynpro_f4_help_dynpro MESSAGE-ID dw.
DATA: carrier(3) TYPE c,
connection(4) TYPE c.
CALL SCREEN 100.
MODULE cancel INPUT.
The next screen (statically defined) for screen 100 is 100. It has the following layout:
The input fields have been adopted from the program fields CARRIER and CONNECTION. The function code of the pushbutton is CANCEL, with function type E. The search help DEMO_F4_DE with the search help parameter CARRID is assigned to the screen field carrier. The search help uses the database table SCARR.
The screen flow logic is as follows:
PROCESS BEFORE OUTPUT.
MODULE cancel AT EXIT-COMMAND.
FIELD carrier VALUES ('AA', 'LH').
FIELD connection SELECT *
WHERE carrid = carrier
AND connid = connection.
When the user chooses input help for the individual fields, the following is displayed:
· For the Airline field, the search help displays the names of the airlines and places the airline code in the input field for the chosen line. If the airline code is not one of those listed in the VALUES list of the screen flow logic, the input check triggers an error message in the PAI event. So the search help overrides the VALUES addition for the input help, but not for the input checks. This is therefore not an appropriate place to use the VALUES addition.
· For the Flight number field, the flow logic displays the selected entries from the database table SPFLI and places the selected line in the input field.