ABAP Events - AT SELECTION-SCREEN OUTPUT Keyword, Example With Output.
All About AT SELECTION-SCREEN OUTPUT Event With A Sample Code.
This event gets triggered at the PBO of the selection screen every time the user presses “ENTER” button on the selection screen. In simple words, this event is triggered after loading the selection screen into memory but before it is displayed to the user.
This event can be used to change the properties of the selection screen fields dynamically. Hence this event allows us to modify the selection screen and its fields directly before it is displayed.
Attributes related to any selection screen fields are saved in a workarea called SCREEN during this event.
In case you try to use two or more AT SELECTION-SCREEN OUTPUT events, you will get an error message “The event AT SELECTION-SCREEN OUTPUT was already specified in the program.”
For example, if you select some radiobutton in the selection screen then you want some of the fields should become invisible or grayed out.
Such scenarios can be achieved by using this event.
SAMPLE PROGRAM – 1:
REPORT ztest.
PARAMETERS: field_1(10) TYPE c MODIF ID sc1,
field_2(10) TYPE c MODIF ID sc2,
field_3(10) TYPE c MODIF ID sc1,
field_4(10) TYPE c MODIF ID sc2,
field_5(10) TYPE c OBLIGATORY.
INITIALIZATION.
field_5 = '5000'.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'SC1'.
screen-intensified = '1'. “ Intensify the Field.
MODIFY SCREEN.
CONTINUE.
ENDIF.
IF screen-group1 = 'SC2'.
screen-intensified = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN.
field_1 = '10'.
OUTPUT:
Here the order of execution of events is:
- Initialization.
- At Selection-Screen Output.
- At selection-Screen.
The two fields belonging to modification id ‘SC1’ are intensified.
ALSO READ:
- ABAP EVENTS During Runtime Of A Report Program.
- INITIALIZATION Event - Introduction With A Sample Code.
- AT SELECTION-SCREEN Event - Introduction With A Sample Code.
- AT SELECTION-SCREEN OUTPUT Event - Introduction With A Sample Code.
- AT SELECTION-SCREEN ON VALUE REQUEST- Introduction With A Sample Code.
- AT SELECTION-SCREEN ON HELP REQUEST- Introduction With A Sample Code.
- AT SELECTION-SCREEN ON - Introduction With A Sample Code.
- Sample Program On AT SELECTION-SCREEN OUTPUT - 1.
- Sample Program On AT SELECTION-SCREEN OUTPUT - 2.
- Sample Program On AT SELECTION-SCREEN OUTPUT - 3.
- Sample Program On AT SELECTION-SCREEN OUTPUT - 4.
- Sample Program On AT SELECTION-SCREEN ON VALUE REQUEST FOR field - 1.
- Sample Program On AT SELECTION-SCREEN ON VALUE REQUEST FOR field - 2.
- Sample Program On AT SELECTION-SCREEN ON HELP REQUEST FOR field- 1.
Your suggestions and comments are welcome in this section.
Please mail all your contributions to administrator@abapmadeeasy.com We request you to mention your Name, Designation, Experience & Organization you are working for. Your posts will be verified and posted in this site with your name.