Skip to content

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

Selection Screens, Input Help

The example demonstrates 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

This program declares a selection screen with two parameters both referring to the column CARRID of the database table SPFLI. While the dictionary input help is used for p_carr_1, no special input help is programmed for p_carr_2. Dynpro 100 is used here. In the flow logic, the dialog module value_list is started at the time of PBO. The screen layout of dynpro 100 is not required and the system does not call any dialog modules at PAI time.

PROCESS BEFORE OUTPUT.
  MODULE value_list.
PROCESS AFTER INPUT.

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