Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  User Dialogs →  Selection Screens →  Selection Screen Processing →  AT SELECTION-SCREEN →  AT SELECTION-SCREEN - selscreen_event 

Selection Screens, Input Help

The example illustrates a self-defined F4 help on selection screens.

Other versions: 7.31 | 7.40 | 7.54

Source Code

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.

Description

In this program, a selection screen with two parameters that are based on column CARRID of database table SPFLI is declared. Whereas for p_carr_1 the input help of the Dictionary is used, a special separate input help is programmed for p_carr_2. Screen 100 is called for this purpose. In the flow logic, the system starts the dialog module value_list at the PBO event. The screen layout for screen 100 is not required, and the system does not call any dialog modules at the PAI event.

PROCESS BEFORE OUTPUT.
  MODULE value_list.
PROCESS AFTER INPUT.

The dialog module value_list suppresses the display of the screen layout of screen 100 and switches to list display. The list shows values for the parameter p_carr_2 and stores them in the HIDE area. Selecting a line on the value list triggers the event AT LINE-SELECTION, automatically putting the selected value from the HIDE area in the field p_carr_2. If the selection is valid, the system quits the event block for AT LINE-SELECTION directly with the selection screen and fills the input field accordingly.