SELECTION-SCREEN INCLUDE

SELECTION-SCREEN - Including Objects on Selection Screens

Variants:
1. SELECTION-SCREEN INCLUDE PARAMETERS p.
2. SELECTION-SCREEN INCLUDE SELECT-OPTIONS sel.
3. SELECTION-SCREEN INCLUDE COMMENT fmt name.
4. SELECTION-SCREEN INCLUDE PUSHBUTTON fmt name.
5. SELECTION-SCREEN INCLUDE BLOCKS block.

Effect

Objects declared using SELECT-OPTIONS, PARAMETERS and SELECTION-SCREEN on another selection screen are copied into the current selection screen.
Both the source and target screen can be either the standard seletion screen 1000 or one defined using SELECTION-SCREEN BEGIN/END OF SCREEN . All that is important is that source and target are different screens.
The effect of this statement is as if the "original coding" of the copied portion appeared on the target screen.

Additions:
1a. ... OBLIGATORY
1b. ... OBLIGATORY OFF
2.
... MODIF ID modid.

Effect

The parameter par is copied onto the current screen.

Note

Since the data object defined in the PARAMETERS statement only exists once (it is not copied), you cannot change its technical attributes (type, length, reference field).
The parameter par can also only contain one value at runtime, that is, the content entered on the selection screen. This means that this value appears on every other screen containing the parameter par.

Effect

You can use the OBLIGATORY addition to the PARAMETERS statement to make the parameter a required field on the screen on which it is defined. You can set this attribute (or remove it, using OBLIGATORY OFF) for each copy of the parameter. If you do not use either of the additions, the attribute is derived from the 'original' parameter definition.

Addition 2

... MODIF ID modid.

Effect

If you specify a MODIF-ID , you can assign the comment to a modification group. This is also supported even if you did not specify a modification group (or specified a different group) when you defined par using the PARAMETERS statement. If you do not use the addition, any modification group specified in the 'original' definition is used.

Note

All further attributes of par that are set using additions to the PARAMETERS stattement, are copied from the 'original'. In other words, you cannot set them separately for a copy.

Additions:
1a. ... OBLIGATORY
1b. ... OBLIGATORY OFF
2a. ... NO INTERVALS
2b. ... NO INTERVALS OFF
3a. ... NO-EXTENSION
3b. ... NO-EXTENSION OFF
4. ... MODIF ID modid

Effect

The select-option sel is copied onto the current screen.

Note

Since the data object defined in the SELECT-OPTIONS statement only exists once (it is not copied), you cannot change its technical attributes (type, length, reference field).
The select option sel can also only have one content at runtime, namely the contents entered on the selection screen. These contents appear on every screen that uses the select option sel.

Addition 4

... MODIF ID modid

Effect

As with OBLIGATORY and OBLIGATORY OFF, you can enable and disable the attribtes set using NO INTERVALS and NO-EXTENSION in the SELECT-OPTIONS statement separately for each copy. If you do not use these additions, the corresponding attribute is determined by the 'original' setting.

Note

All further attributes of sel, set using additions to the SELECT-OPTIONS statement, are copied from the 'original' settings. You cannot set them separately for individual copies.

Additions:
1. ... FOR FIELD f
2. ... MODIF ID modid.

Effect

The commentr name is copied to the position given in the format specification fmt.

Note

This is only useful, and only supported, for comments whose contents are set at runtime, that is, where name is not a text element with the form TEXT-xxx.

Effect

The comment is assigned to the parameter or select option f (see also the FOR FIELD option in SELECTION-SCREEN COMMENT ). If you do not use the addition, the assignment from the 'original' is used, if one exists.

Addition 2

... MODIF ID modid

Additions:
1. ... USER-COMMAND ucom
2. ... MODIF ID modid

Effect

The

pushbutton name is copied onto the screen at the position given in the format specification fmt.

Note

As with ... INCLUDE COMMENT, this only makes sense, and is only supported, for pushbuttons whose text is set at runtime, that is, where it is not a text element with the form TEXT-xxx.

Effect

Clicking the pushbutton triggers the function code ucom. You can change this from the original definition (see SELECTION-SCREEN PUSHBUTTON ). If you do not use the addition, the function code from the 'original' definition is used.

Addition 2

... MODIF ID modid

Effect

The entire block block is copied to the current screen, along with all objects contained in it.

If the block block contains an object that you have already copied onto the current screen in a previous SELECTION-SCREEN INCLUDE statement, a syntax error occurs.

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 INCLUDE PARAMETERS PAR0. 
	SELECTION-SCREEN COMMENT /10(20) TEXT-COM. 
	SELECTION-SCREEN COMMENT /10(20) COMM01. 
  SELECTION-SCREEN END OF BLOCK BL1. 
SELECTION-SCREEN END OF SCREEN 123. 
 
SELECTION-SCREEN ULINE. 
SELECTION-SCREEN INCLUDE: SELECT-OPTIONS SEL1, 
						COMMENT /5(15) COMM01. 
SELECTION-SCREEN PUSHBUTTON 15(25) PUBU 
				 USER-COMMAND US01. 
 
SELECTION-SCREEN BEGIN OF SCREEN 99. 
  SELECTION-SCREEN INCLUDE PUSHBUTTON 20(20) PUBU 
						 USER-COMMAND US02. 
  SELECT-OPTIONS SEL2 FOR SPFLI-CONNID. 
  SELECTION-SCREEN INCLUDE BLOCKS BL1. 
  PARAMETERS	 PAR2 TYPE I. 
SELECTION-SCREEN END OF SCREEN 99. 

This example is only syntactically correct if the program has type 1, since this is the only case in which SELECT-OPTIONS, PARAMETERS and SELECTION-SCREEN statements may occur outside a SELECTION-SCREEN BEGIN/END OF SCREEN block.

In the example, the report would have three selection screens: