Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  User Dialogs →  Selection Screens →  Create Selection Screens →  PARAMETERS →  PARAMETERS - type_options 

Selection screens, dynamic Dictionary reference

The example demonstrates how you can create a dynamic Dictionary reference to a parameter.

Other versions: 7.31 | 7.40 | 7.54

Source Code

REPORT demo_sel_screen_parameters_2 .

SELECTION-SCREEN BEGIN OF SCREEN 100.
   PARAMETERS name(20) TYPE c DEFAULT 'SPFLI-CARRID'.
 SELECTION-SCREEN END OF SCREEN 100.

 SELECTION-SCREEN BEGIN OF SCREEN 200.
   PARAMETERS p_carr LIKE (name).
 SELECTION-SCREEN END OF SCREEN 200.

CLASS start DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS main.
ENDCLASS.

CLASS start IMPLEMENTATION.
  METHOD main.
    CALL SELECTION-SCREEN 100 STARTING AT 10 10.
    IF sy-subrc <> 0.
      RETURN.
    ENDIF.
    CALL SELECTION-SCREEN 200 STARTING AT 10 10.
    IF sy-subrc <> 0.
      RETURN.
    ENDIF.
  ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.
  start=>main( ).

Description

At the event at which selection screen 200 is called, the field name must contain the name of a data type from the ABAP Dictionary. At present, only the reference to fields of database tables, views and structures is supported. The parameter dynamically takes over the attributes of the type from the Dictionary, that is, technical properties and help texts. If in the program no selection text is created for the parameter, on the selection screen the field label from the Dictionary appears. Otherwise the selection text is used.