ABAP Dynamic setting of selection screen

  Selection Screen and Events

Each field of the selection screen has attributes, and you can use certain statements to read some of the attributes of each screen field into the predefined structure screen when you execute the ABAP program. You can then change these attributes.


Field NameLengthTypeExplanation
NAME132  Char Screen field name
GROUP1 3 Char Modification Group 1
GROUP2 3 Char Modification Group 2
GROUP3 3 Char Modification Group 3
GROUP4 3 Char Modification Group 4
REQUIRED 1 CharRequired input filed
INPUT 1 Char Input field
OUTPUT 1 Char Output-only field
INTENSIFIED 1 Char Highlighting
INVISIBLE 1 CharHidden
LENGTH1XDisplay length
DISPLAY_3D1CharThree-dimensional box
VALUE_HELP1CharInput help button display
REQUEST1CharWith input


There is no problem if it is in the program, but it is common to change it dynamically while the selection screen is displayed before it is displayed. If it is before the selection screen is displayed, describe it in the INITIALIZATION event. If it is displayed, you can change it based on the value entered in the SELECTION-SCREEN OUTPUT event. Let’s also refer to dynamically changing the selection items with radio buttons.

Sample Code:SCREEN-NAME (Field Name)

The name defined by Parameter and Select-Options is stored in SCREEN-NAME. Since SCREEN contains data with various names in the automatically generated selection screen, be sure to make a conditional branch with an IF statement/CASE statement so that the logic only works for specific items with NAME when making changes. ..

Sample Code:SCREEN-GROUP1 ~GROUP4 (Modification group)

By setting the same group ID in multiple selection items as described above, the value can be set in SCREEN-GROUP1, and it is easy to execute the same processing. For GROUP2-4, there are cases where the value is set when the selection screen is automatically generated. SE51: Let’s check with Screen Painter. If it is a screen that you make your own selection screen, make full use of GROUP 1 to 4 to create a simple screen.

Sample Code:SCREEN-REQUIRED(Required input items)

By setting SCREEN-REQUIRED to ‘1’ as described above, the selection item becomes a mandatory input, and the same effect as when the OBLIGATORY option is present. Also, if SCREEN-REQUIRED is set to ‘0’ for items that have the OBLIGATORY option, they are not required input items.

Sample Code:SCREEN-INPUT(Input Field)

As described above, setting SCREEN-INPUT to ‘1’ enables input of the selection item (default), and setting SCREEN-INPUT to ‘0’ disables input. Input disabled is displayed in gray when the screen item is displayed.

Sample Code:SCREEN-OUTPUT(Output-only field)

Setting SCREEN-OUPUT to ‘1’ or ‘0’ does not change.
It is unclear how it can be used.

Sample Code:SCREEN-INTENSIFIED(Highlighting)

When SCREEN-INTENSIFIED is set to ‘1’ and a value is entered from the screen, it is displayed in red.

Sample Code:SCREEN-INVISIBLE(Hidden)

When SCREEN-INVISIBLE is set to ‘1’, the input field becomes “*“. For the password entry field when logging in to the GUI, the characters being entered are hidden.

Sample Code:SCREEN-LENGTH(Display Length)

The number of displayed digits can be set in SCREEN-LENGTH. MATNR (item code) is an 18-digit item, so an 18-digit input field is displayed, but if you set 5 as above, you can only enter up to 5 digits. Setting a value of 18 digits (maximum number of digits) or more will have no effect.

Sample Code:SCREEN-ACTIVE(Activity)

When SCREEN-ACTIVE is set to ‘0’, the input field disappears (it disappears). However, note that the selected text is displayed, so the line itself does not disappear. If you want to hide everything, specify the MODIF ID and set.

Sample Code:SCREEN-DISPLAY_3D(3D dimension)

Since it is an item for displaying the selected text in 3D, set the value so that the entire line is applied with MODIF ID. When it comes to 3D display, the text frame is displayed like a hollow.

Sample Code:SCREEN-VALUE_HELP(Search help)

Search help can be disabled. If you set ‘1’ to an item for which search help is not originally set, it has no effect.

サンプルコード:SCREEN-REQUEST(With input)