SAP PARAMETERS SCREEN ABAP Statements

Get Example source ABAP code based on a different SAP table
  



PARAMETERS - screen_options

Short Reference
• MODIF ID PARAMETERS


ABAP Syntax ... { {[OBLIGATORY|NO-DISPLAY] [VISIBLE LENGTH
vlen]}
| {AS CHECKBOX [USER-COMMAND fcode]}
| {RADIOBUTTON GROUP group [USER-COMMAND fcode]}
| {AS LISTBOX VISIBLE LENGTH vlen [USER-COMMAND fcode]
[OBLIGATORY]} }
[MODIF ID modid] ... .

ABAP Addition
1 ... OBLIGATORY
2 ... NO-DISPLAY
3 ... VISIBLE LENGTH vlen
4 ... AS CHECKBOX [USER-COMMAND fcode]
5 ... RADIOBUTTON GROUP group [USER-COMMAND fcode]
6 ... AS LISTBOX VISIBLE LENGTH vlen [USER-COMMAND fcode]

What does it do? These additions can be used to declare the input field as a required field, hide the input field on the selection screen, and define the visible length of the field. The input field can be displayed as a checkbox, radio button, or dropdown list box. The MODIF ID addition assigns all the screen elements of the parameter to the modification group modid.



Latest notes:Not all combinations of additions are valid. The syntax
above shows the permitted combinations.
• OBLIGATORY PARAMETERS

ABAP Addition

What does it do? This addition defines the input field of the parameter on the selection screen as a required (obligatory) field. If no entry is made in this field, the user cannot use the Execute function ( F8) to exit the selection screen; instead, the user can only use the functions Back, Exit, or Cancel.
• NO-DISPLAY PARAMETERS

ABAP Addition

What does it do? This addition specifies that no screen elements are generated for the parameter on the selection screen. In an executable program, a parameter of this type is used only as part of the interface defined by the selection screen. It can be supplied with a value by the calling program when called with SUBMIT.

If the addition NO-DISPLAY is specified, a parameter can have any data types except for reference types. These parameters can only be populated using the WITH addition of the SUBMIT statement. In this case, unlike the general conversion rule for deep types, the same rules apply as when importing data from a data cluster.



Latest notes:The length of a value passed to a parameter without input
field is not subject to the 132 character restriction that applies to parameters that do have input fields.
• VISIBLE LENGTH PARAMETERS

ABAP Addition

What does it do? This addition defines the visible length of the input field as vlen, whereby vlen is entered directly as a positive number. If vlen is less than the length of the parameter and less than the maximum visible length, then the input field is displayed in the length defined in vlen, with movable content. Otherwise, the addition is ignored.
• AS CHECKBOX PARAMETERS
• USER-COMMAND PARAMETERS AS CHECKBOX

ABAP Addition

What does it do? This addition specifies that the input field in the first position of the selection screen is displayed as a checkbox with the corresponding description next to it on the right. The checkbox is selected if the value of para is 'X' or 'x'. Otherwise, it is not selected.

This parameter must be created with type c and length 1. Explicitly specified lengths len are not allowed. If the addition TYPE is used, it can only be followed by the generic type c or a non-generic data type of type cand length 1.

The addition USER-COMMAND can be used to assign a function code fcode to the parameter. The function code fcode must be specified directly and can only contain a maximum of 20 characters. To evaluate the function code, an interface work area of the structure SSCRFIELDS from ABAP Dictionary must be declared using the statement TABLES. When the user selects the checkbox on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN and passes the function code fcode to the component ucomm of the interface work area sscrfields. If a function code used in the GUI status of the selection screen is specified for fcode, the selection screen processing is affected accordingly.



Latest notes:
If the TYPE addition is used to make a reference to a data type in ABAP Dictionary of type CHAR and length 1, and for which the valid values in the domain are defined as 'X' and ' ', then the parameter is displayed automatically as a checkbox on the selection screen. The addition USER-COMMAND can, for example, be used for screen modifications with the addition MODIF ID (refer to example). If the addition USER-COMMAND is specified without the addition AS CHECKBOX , and the parameter is of type c with length 1, it is also displayed as a checkbox. Once again, explicit lengths cannot be specified. The addition OBLIGATORY is also possible syntactically but does not make sense for a checkbox.
• RADIOBUTTON GROUP PARAMETERS
• USER-COMMAND PARAMETERS RADIOBUTTON GROUP

ABAP Addition

What does it do? This addition specifies that the input field is displayed as a radio button in the first position on the selection screen, and the output field is displayed next to it on the right. The radio button is selected if the value of para is 'X' or 'x'. Otherwise, it is not selected.

group is used to define the radio button group for the parameter. The name group is entered directly as a character string with a maximum of 4 characters. Within a selection screen, there must be a minimum of two parameters in the same radio button group. There cannot be more than one radio button group with the same name in one program, even if they are defined in different selection screens.

This parameter must be created with type c and length 1. Explicitly specified lengths len are not allowed. If the addition TYPE is used, it can only be followed by the generic type c or a non-generic data type of type cand length 1.

In a radio button group, only one parameter can be defined with the addition DEFAULT, and the specified value must be 'X'. By default, the first parameter in a radio button group is set to the value 'X' and the rest are set to ' '.

The addition USER-COMMAND can be used to assign a function code fcode to the first parameter in a radio button group. The function code fcode must be specified directly and can only contain a maximum of 20 characters. To evaluate the function code, an interface work area of the structure SSCRFIELDS from ABAP Dictionary must be declared using the statement TABLES. When the user selects any radio button from the radio button group on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN and passes the function code fcode to the component ucomm of the interface work area sscrfields. If a function code used in the GUI status of the selection screen is specified for fcode, the selection screen processing is affected accordingly.



Latest notes:We recommend that you arrange the radio buttons of a radio
button group directly underneath each other. If the selection screen also contains other elements, we recommend that you define each radio button group within a block surrounded by a frame.
• AS LISTBOX PARAMETERS
• VISIBLE LENGTH PARAMETERS AS LISTBOX
• USER-COMMAND PARAMETERS AS LISTBOX

ABAP Addition fcode]

What does it do? This addition generates a dropdown list box for an input field on the selection screen. If the parameter is created with a data type from ABAP Dictionary, and the data type is associated with the input help in the Dictionary, the first column of the input help is displayed in the list box. Otherwise, a single-row list box is displayed containing the current value of the parameter.

The addition VISIBLE LENGTH must be used to specify the visible length of the input field. The length must be specified explicitly since the length of the entries in the list box is usually different from the actual length of the parameter.

The addition USER-COMMAND can be used to assign a function code fcode to the dropdown list box. The function code fcode must be specified directly and can only contain a maximum of 20 characters. To evaluate the function code, an interface work area of the structure SSCRFIELDS from ABAP Dictionary must be declared using the statement TABLES. When the user selects a row from the list box on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN and passes the function code fcode to the component ucomm of the interface work area sscrfields. If a function code used in the GUI status of the selection screen is specified for fcode, the selection screen processing is affected accordingly.



Latest notes:Without the addition USER-COMMAND, selecting a row
in the dropdown list box does not trigger the event AT SELECTION-SCREEN.



Example ABAP Coding
The parameter p_carrid is displayed with a length
of 20 and filled with the label 'Lufthansa'. The user can select another airline; in this case, the three-character airline ID is assigned to the parameter. When assigning the function code onli, which is assigned to the function Execute in the GUI status of the default selection screen, the events AT SELECTION-SCREEN and START-OF-SELECTION are triggered. PARAMETERS p_carrid TYPE spfli-carrid
AS LISTBOX VISIBLE LENGTH 20
USER-COMMAND onli
DEFAULT 'LH'.

AT SELECTION-SCREEN.
...

START-OF-SELECTION.
...

Return to menu