ABAP Keyword Documentation → ABAP - Reference → User Dialogs → Selection Screens → Create Selection Screens → SELECT-OPTIONS → SELECT-OPTIONS - FOR
Selection Screens, Basic Form of Selection Criteria
The example shows how the selection tables are filled in a multiple selection.
Other versions: 7.31 | 7.40 | 7.54
Source Code
REPORT demo_sel_screen_select_options.
CLASS start DEFINITION.
PUBLIC SECTION.
CLASS-DATA name(80) TYPE c.
CLASS-METHODS main.
ENDCLASS.
SELECTION-SCREEN BEGIN OF SCREEN 100.
PARAMETERS: dbtab TYPE c LENGTH 30 DEFAULT 'SFLIGHT',
column TYPE c LENGTH 30 DEFAULT 'CARRID'.
SELECTION-SCREEN END OF SCREEN 100.
SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
SELECT-OPTIONS selcrit FOR (start=>name).
SELECTION-SCREEN END OF SCREEN 500.
START-OF-SELECTION.
start=>main( ).
CLASS start IMPLEMENTATION.
METHOD main.
CALL SELECTION-SCREEN 100 STARTING AT 10 10.
IF sy-subrc <> 0.
RETURN.
ENDIF.
name = dbtab && '-' && column.
CALL SELECTION-SCREEN 500 STARTING AT 10 10.
IF sy-subrc <> 0.
RETURN.
ENDIF.
cl_abap_demo_services=>list_table( selcrit[] ).
ENDMETHOD.
ENDCLASS.
Description
On the selection screen 100, you can specify the name of the table dbtab
and of the column column
contained therein. These are then used for the dynamic layout of the selection criterion on the selection screen 500.
The system displays two input fields and one pushbutton that allow additional entries for the selection
criterion. The value which the user enters in the first input field is written to the component
selcrit-low of the selection table; the value for the second field is written to the component selcrit-high
.
For more complex selections, the user can use the pushbutton on the right side of the selection screen to display the multiple selection window.
The contents of the selection table are then output in a list. The first column determines whether the
subsequent values are to be included or not; the second contains the Boolean operator and the last two columns contain the limits low
and high
.