Entering content frame

Defining Input Help Locate the document in its SAP Library structure

If an input field declared in an executable program refers to a field in the ABAP Dictionary for which possible entries help is defined, the list of values from the Dictionary is automatically displayed when the user calls the F4 help for that field. To create possible values help for report input fields that have no Dictionary reference, or to override the Dictionary input help linked to the field, you can create an event block for the event (see also Search Help for Parameters),

AT SELECTION-SCREEN ON VALUE-REQUEST FOR field

The event is triggered when the user calls the F4 help for the field field. If no corresponding event block has been defined, no possible values help or values list from the Dictionary is displayed. If a corresponding event block exists, it takes precedence over the default possible values help mechanism. It is then up to the programmer to ensure in the event block that an appropriate list of values is displayed, and that the user can choose a value from it.

No event block AT SELECTION-SCREEN ON VALUE-REQUEST can be created for input fields on the selection screen that are declared within the logical database used. You cannot override the input help mechanism of the logical database within the executable program. You can define separate help within the logical database program using the VALUE-REQUEST option in the PARAMETERS and SELECT-OPTIONSstatements.

Example

REPORT demo_selection_screen_f4.

PARAMETERS: p_carr_1 TYPE spfli-carrid,
            p_carr_2 TYPE spfli-carrid.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_carr_2.
  CALL SCREEN 100 STARTING AT 10 5
                  ENDING   AT 50 10.

MODULE value_list OUTPUT.
  SUPPRESS DIALOG.
  LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
  SET PF-STATUS space.

  NEW-PAGE NO-TITLE.
  WRITE 'Star Alliance' COLOR COL_HEADING.
  ULINE.
  p_carr_2 = 'AC '.
  WRITE: / p_carr_2 COLOR COL_KEY, 'Air Canada'.
  HIDE p_carr_2.
  p_carr_2 = 'LH '.

  WRITE: / p_carr_2 COLOR COL_KEY, 'Lufthansa'.
  HIDE p_carr_2.
  p_carr_2 = 'SAS'.

  WRITE: / p_carr_2 COLOR COL_KEY, 'SAS'.
  HIDE p_carr_2.
  p_carr_2 = 'THA'.

  WRITE: / p_carr_2 COLOR COL_KEY, 'Thai International'.
  HIDE p_carr_2.
  p_carr_2 = 'UA '.

  WRITE: / p_carr_2 COLOR COL_KEY, 'United Airlines'.
  HIDE p_carr_2.
  CLEAR p_carr_2.
ENDMODULE.

AT LINE-SELECTION.
  CHECK NOT p_carr_2 IS INITIAL.
  LEAVE TO SCREEN 0.

This program declares a selection screen with two parameters that both refer to the column CARRID of the SPFLI database table. While the Dictionary input help is used for p_carr_1, no special input help is programmed for p_carr_2. Screen 100 is used for the possible entries help. In the flow logic, the dialog module value_list is started at the time of PBO. The actual screen mask 100 is not required, and there are no dialog modules used in the PAI.

PROCESS BEFORE OUTPUT.
  MODULE value_list.

PROCESS AFTER INPUT.

The dialog module value_list suppresses the screen 100 and switches to list processing. The list contains values for the parameter p_carr_2. These values are also placed in the HIDE area. When the user selects a line from the value list, the AT LINE-SELECTION event is triggered, and the selected value is transferred from the HIDE area into the field p_carr_2. If the user selects a valid line, the system switches directly from the event block AT LINE-SELECTION back to the selection screen, and fills the corresponding input field.

This graphic is explained in the accompanying text

 

 

 

Leaving content frame