1a. SELECTION-SCREEN
BEGIN OF SCREEN scr.
1b. SELECTION-SCREEN END
OF SCREEN scr.
2. SELECTION-SCREEN BEGIN OF SCREEN scr AS SUBSCREEN.
Defines a selection screen
with the number scr. scr may be up to 4 digits.
SELECTION-SCREEN BEGIN OF SCREEN scr.
1. ... TITLE
title
2. ... AS WINDOW
... TITLE title
Assigns the title title to the selection screen.
title
may be defined either statically or at runtime.
... AS WINDOW
Defines the screen as a modal dialog box (addition STARTING AT ...
in CALL SELECTION-SCREEN).
The effect of this is that error messages are also sent in dialog boxes.
If you use the
NO INTERVALS
addition in SELECTION-SCREEN
BEGIN OF BLOCK and SELECT-OPTIONS,
the selection screens will be smaller, and particularly suitable for use as modal dialog boxes.
DATA SPFLI_WA TYPE SPFLI.
SELECT-OPTIONS SEL0 FOR SY-TABIX.
PARAMETERS PAR0(5).
SELECTION-SCREEN
BEGIN OF SCREEN 123 AS WINDOW TITLE TEXT-456.
SELECTION-SCREEN BEGIN OF BLOCK BL1 WITH
FRAME TITLE TEXT-BL1
NO
INTERVALS.
SELECT-OPTIONS SEL1 FOR SY-SUBRC.
PARAMETERS
PAR1 LIKE SPFLI-CARRID.
SELECTION-SCREEN COMMENT /10(20) TEXT-COM.
SELECTION-SCREEN
END OF BLOCK BL1.
SELECTION-SCREEN END OF SCREEN 123.
SELECTION-SCREEN ULINE.
SELECTION-SCREEN
BEGIN OF SCREEN 99.
SELECTION-SCREEN PUSHBUTTON 15(25) PUBU
USER-COMMAND US01.
SELECT-OPTIONS SEL2 FOR SPFLI_WA-CONNID.
PARAMETERS PAR2 TYPE I.
SELECTION-SCREEN END OF SCREEN 99.
This example can only be syntactically correct if the program has type 1, since this is the only case
in which SELECT-OPTIONS,
PARAMETERS
and SELECTION-SCREEN
statements are allowed outside a SELECTION-SCREEN BEGIN/END OF SCREEN block.
In the example, the report would have three selection screens:
Variant 2
SELECTION-SCREEN BEGIN OF SCREEN scr AS SUBSCREEN.
1. ... NESTING
LEVEL n
2. ... NO INTERVALS
Defines the selection screen as a subscreen.
... NESTING LEVEL n
Only relevant if you want to include the subscreen in a tabstrip control on the selection screen and
the tabstrip control is already surrounded by a frame. Rule: If the tabstrip control is not framed,
the subscreen has NESTING LEVEL 0. Each frame that encloses the tabstrip control increases the NESTING LEVEL by 1.
... NO INTERVALS
When you use the NO INTERVALS addition, the system creates
a smaller subscreen that does not contain the HIGH fields of the selection criteria.
If you want to display a selection screen on any other screen or as part of a tabstrip control on a selection screen, you must create it as a subscreen.
You can use SELECTION-SCREEN
INCLUDE ... to include objects in a selection screen that have already been defined in a different selection screen.
In the above example, you could define a further selection screen as follows:
SELECTION-SCREEN BEGIN OF SCREEN 1111.
SELECTION-SCREEN BEGIN OF BLOCK BL1.
SELECT-OPTIONS
SEL0 FOR SY-REPID.
PARAMETERS PAR0.
SELECTION-SCREEN
END OF BLOCK BL1.
SELECT-OPTIONS SEL1 FOR SY-REPID.
PARAMETERS
PAR1.
SELECTION-SCREEN PUSHBUTTON /10(30) PUBU USER-COMMAND US03.
SELECTION-SCREEN
END OF SCREEN 1111.
SELECTION-SCREEN BEGIN OF SCREEN 1234.
SELECTION-SCREEN
INCLUDE BLOCKS BL1.
SELECTION-SCREEN INCLUDE SELECT-OPTIONS SEL1.
SELECTION-SCREEN
INCLUDE PARAMETERS PAR1.
PARAMETERS PAR2.
SELECTION-SCREEN
INCLUDE PUSHBUTTON /10(30) PUBU
USER-COMMAND US03.
SELECTION-SCREEN END OF SCREEN 1234.
This screen contains the entire block BL1, containing
the box, title (
TEXT-BL1), SEL1,
PAR1 and comment. Below are the selection criterion SEL0,
the parameter PAR2, the newly-defined parameter PAR4 and the pushbutton.
In this example, the box BL1 remains small, as oiginally defined (NO INTERVALS). You can make wider blocks small in an include by including them in small blocks. For further details, see SELECTION-SCREEN INCLUDE ....