AS ABAP Release 758, ©Copyright 2024 SAP SE. All rights reserved.
ABAP - Keyword Documentation → ABAP - Programming Language → SAP GUI User Dialogs → Selection Screens → Selection Screens - Create →
SELECT-OPTIONS
Syntax
SELECT-OPTIONS selcrit FOR {dobj|(name)}
[
screen_options]
[value_options]
[
NO DATABASE SELECTION]
[
ldb_options].
Effect
This declares a selection criterion selcrit for a data object dobj or a type specified in name. Selection criteria are components of a selection screen, which are assigned a selection table in the ABAP program, as well as two input fields and a pushbutton for multiple selection.
The name of the selection criterion selcrit is limited to a maximum of 8 characters. This statement is allowed in the global declaration part of executable programs, function pools, and module pools. In function pools and module pools, the statement is only allowed within the definition of a standalone selection screen. In executable programs, the statement is otherwise automatically assigned to the standard selection screen.
The statement SELECT-OPTIONS has the following effect:
An automatically generated output field is displayed in the first possible position in front of the first input field as a label with a length of between 20 and 30 depending on the nesting depth in framed blocks. The output field contains either the name of the selcrit selection criterion or the selection text to which the selection criterion is assigned in the text elements of the program. If the user requests field or input help on the output field using the function key F1 or F4, the same output appears as if one of the input fields were chosen.
A multiple selection pushbutton is created after the second input field. If this pushbutton is selected, a dialog box with four tabstrip control pages appears, in which the input fields are again displayed in tabular form in Table Controls. The tabstrip pages are separated based on individual value comparison, interval selections, and settings for the column sign.
Users can select an input field with a double-click on the selection screen or use the dialog box for multiple selection. On the selection screen, the value of the column sign can also be chosen. On the dialog box for multiple selection, this is done by selecting the respective tabstrip page. If the selection option is not equal to EQ or BT, it is displayed as an icon in front of the first input field. The color of the icon is green if the content of the column sign is I, and red if it is E.
The selection options CP and NP can be selected only if the first input field contains at least one of the wildcard characters * or +. + masks a single character, * masks any character string, even an empty one. If one of these characters is entered, the selection option is automatically set to CP. If CP is set, and all wildcard characters have been removed, the selection option is automatically set to EQ for a user action. This restriction does not apply within the program. When the selection table is evaluated, the column low can also contain a string without wildcard characters for the selection options CP and NP.
The properties of the elements on the selection screen can be affected with the statement screen_options or the statement SELECTION-SCREEN.
Each time before the selection screen is sent to the selection screen event AT SELECTION-SCREEN OUTPUT, the content of first line in the selection table is transported to the selection screen, with a conversion exit being executed if required. If the length of the columns low and high in the first line of the selection table is greater than 255, the surplus content is cut off on the right. It is only possible for all lines to be transported if the button for multiple selections is selected. A conversion exit might be executed here, and lines might be truncated. Settings for the content of the input fields can be made in value_options.
After a user action on the selection screen, the content of the input fields and the selected settings is transported to the first line and the header line of the selection table.
After a user action on the dialog box for multiple selections, the content of all input fields and the selected settings are transported to the lines of the selection table. These transports convert the content of character-like fields by default into uppercase letters by default, after which a conversion exit is performed, if required. After each transport, various selection screen events are raised.
If a value has been entered in the entry field for the upper interval high, the system automatically checks whether this value is greater than the lower interval limit low following each transport and conversion exit (if performed). If necessary, an error message is sent. This check can be switched off before the selection screen is sent, using the function module RS_SELOPT_NO_INTERVAL_CHECK.
Hints