Additional Selection Screens
You can work with several selection screens in one program. The standard selection screen always has the number 1000.
You can define other selection screens using SELECTION-SCREEN BEGIN OF SCREEN <nnnn> and SELECTION-SCREEN END OF SCREEN <nnnn>.
You use SELECT-OPTIONS and PARAMETERS to define the required selection screen fields between the BEGIN OF and END OF statements. Use CALL SELECTION-SCREEN <nnnn> to call this selection screen. Additional selection screens should have a screen number higher than 1000.
If the user performs any action on the called selection screen, the AT SELECTION-SCREEN event is processed. In this event, the sy-dynnr system field contains the number of the called selection screen. Then, the program continues with the statement that follows the call. The sy-subrc system field contains 0 if the user chooses Execute or presses F8. If the user chooses Cancel or Exit, sy-subrc contains the value 4.
Tabstrips on Selection Screens
Tabstrips allow a better logical grouping of the fields and therefore a clearer structuring of large selection screens.
To create a selection screen with a tabstrip, define the following:
Selection Screens as Subscreens
You can define selection screens as subscreens, and then include them on other screens as tabs. The system processes the AT SELECTION-SCREEN OUTPUT and AT SELECTION-SCREEN events for each subscreen and also for the surrounding selection screen.
Work with the sy-dynnr system variable to determine the selection screen or subscreen that is currently being processed.
Defining Tabstrips on Selection Screens
If you specify the DEFAULT addition, you must specify the SCREEN addition. The PROGRAM addition is optional, and you only need to specify it if the screen is from another program.
You can delay the specification of the connection between tab titles and selection screens until runtime. You can also change an existing assignment at runtime. To do this, fill the <blockname> structure. It is automatically created for every tabstrip block. The structure has the same name as the tabstrip block and it contains the prog, dynnr, and activetab fields.
For the AT SELECTION-SCREEN event, the sy-ucomm system variable contains the user command declared for the tab that is currently selected (<ucomm>). The <blockname> structure contains information about the selection screen that is currently displayed. AT SELECTION-SCREEN is processed two times, first for the selection screen on the currently selected tab page, and then for the selection screen 1000.
For the AT SELECTION-SCREEN OUTPUT event, the <blockname> structure contains information about the next active tab and the selection screen related to this page.
AT SELECTION-SCREEN OUTPUT is processed twice, first for the selection screen 1000 and then for the selection screen on the next visible tab.