Entering content frameDefining Selection Screens Locate the document in its SAP Library structure

There are three ABAP statements for defining selection screens:

These ABAP statements are included in the declaration part of an ABAP program. When defining selection screens, you must distinguish between standard selection screens for executable programs (reports) and user-defined selection screens for all types of program.

Standard selection screens

The standard selection screen of executable programs is predefined and has screen number 1000. All PARAMETERS, SELECT-OPTIONS and SELECTION-SCREEN statements that do not occur in the definition of a user-defined selection screen in executable programs (reports), that is, that are not included between the statements

SELECTION-SCREEN BEGIN OF ...
...
SELECTION-SCREEN END OF ...

define the input fields and the formatting of the standard selection screen. For the sake of clarity, you should group together all statements that make up the standard selection screen before defining additional selection screens. You can define input fields of a standard selection screen only in executable programs (reports). In all other programs, the PARAMETERS, SELECT-OPTIONS and SELECTION-SCREEN statements must be included in the above statements.

User-defined selection screens

The two statements:

SELECTION-SCREEN BEGIN OF SCREEN <numb> [TITLE <title>] [AS WINDOW].
  ...
SELECTION-SCREEN END OF SCREEN <numb>.

define a user-defined selection screen with screen number <numb>. All PARAMETERS, SELECT-OPTIONS and SELECTION-SCREEN statements that occur between these two statements define the input fields and the formatting of this selection screen. Screen number <numb> can be any four-digit number apart from 1000 which is the number of the standard selection screen. You must also ensure that you do not accidentally assign a number to a selection screen which is already in use for another screen of the program.

The TITLE <title> addition allows you to define a title for a user-defined selection screen. <Title> can either be a static text symbol or a dynamic character field. If you use a character field, you must not define it using the DATA statement - the system generates it automatically. The character field can be filled during the INITIALIZATION event. The title of standard selection screens is always the name of the executable program.

You can use the AS WINDOW addition to call a user-defined selection screen as a modal dialog box. The window is defined when the screen is called. When you use the AS WINDOW addition, warnings and error messages associated with the selection screen are also displayed as modal dialog boxes, and not in the status bar of the selection screen.

If you define more than one selection screen in a program, you can re-use elements of one selection screen in another using the following statement:

SELECTION SCREEN INCLUDE          BLOCKS <block>
                         |     PARAMETERS <p>  
                         | SELECT-OPTIONS <selcrit>
                         |        COMMENT <comm>  
                         |    PUSH-BUTTON.<push>.

You can specify any of the following elements that have already been declared in another selection screen:

GUI Status of Selection Screens

The GUI status of a selection screen is generated by the system. The SET PF-STATUS statement in the PBO event of the selection screen has no effect on the standard GUI status. If you want to use your own GUI status for a selection screen or deactivate functions in the standard GUI status, you can use one of the following function modules in the PBO event of the selection screen:

Sets another GUI status defined in the same ABAP program, or deactivates functions of the standard GUI status.

Sets a GUI status defined in an external function group. You must use the SET PF-STATUS statement to set the status in a special function module in this function group. You must pass the name of the function module that sets the status as a parameter to the function module RS_EXTERNAL_SELSCREEN_STATUS.

Example

Example

REPORT SELSCREENDEF.

...

PARAMETERS PAR1 ... .
SELECT-OPTIONS SEL1 FOR ... .
...

SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
  PARAMETERS PAR2 ... .
  SELECT-OPTIONS SEL2 FOR ... .
  ...
SELECTION-SCREEN END OF SCREEN 500.

SELECTION-SCREEN BEGIN OF SCREEN 600 TITLE TEXT-100.
  SELECTION-SCREEN INCLUDE: PARAMETERS PAR1,
                            SELECT-OPTIONS SEL1.
  PARAMETERS PAR3 ... .
  SELECT-OPTIONS SEL3 ... .
  ...
SELECTION-SCREEN END OF SCREEN 600.

Three selection screens - the standard selection screen and two user-defined selection screens - are defined. The program must have type 1 in order for a standard selection screen to be generated. Selection screen 500 is defined to be called as a modal dialog box. Selection screen 600 contains text symbol 100 as its title, and uses elements PAR1 and SEL1 from the standard selection screen.

 

 

 

Leaving content frame