SELECTION-SCREEN: Defining Selection Screens

SELECTION-SCREEN - Defining

selection screens

Variants:
1a. SELECTION-SCREEN BEGIN OF SCREEN scr.
1b. SELECTION-SCREEN END OF SCREEN scr.

Additions:

(zu SELECTION-SCREEN BEGIN OF SCREEN scr)
1. ... TITLE title
2. ... AS WINDOW

Effect

Defines a

selection screen with the number scr (maximum of 4 digits).

In reports (type 1 programs), a selection screen with number 1000 is created automatically when you use the SELECT-OPTIONS, PARAMETERS and SELECTION-SCREEN statments. This selection screen appears when you SUBMIT the report.

Effect

Assigns the title title to the selection screen.
title may be defined either statically or at runtime.

Effect

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.

Note

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.

Example

TABLES 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-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:

Note

You can use SELECTION-SCREEN INCLUDE ... to include objects in a selection screen that have already been defined in a different selection screen.

Example

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 ParameterPAR2 , the newly-defined parameter PAR4 and the pushbutton.

Note

In this example, the box BL1 remains small, as oiginally defined (NO INTERVALS). You can make wider blocks small in an include by inclding them in small blocks. For further details, see SELECTION-SCREEN INCLUDE ....