11-29-2007 10:24 AM
what is the diff b/w at selection-screen and at selection-screen o/p
11-29-2007 10:34 AM
If you're going to ask questions, especially regarding syntax, it's a good idea to be specific. There is no ABAP command "AT SELECTION-SCREEN O/P".
I assume you mean "OUTPUT".
AT SELECTION-SCREEN OUTPUT runs just before the selection screen is displayed, and allows modifications to the fields and values on the screen. It runs in the PBO, if you know what that is.
AT SELECTION-SCREEN runs after all other selection screen processing. Usually used for validation. It runs in the PAI.
matt
11-29-2007 10:36 AM
at selection-screen will be triggered in pai event
selection-screen o/p will be triggered in pbo event
11-29-2007 10:39 AM
Hi Jaya,
The difference between Selection Screen and Selection Screen Output is we use the Selection Screen Output Event before the Selection Screen will displayed. Eg: Suppose if we want to disable some fields and enable some fields in the Selection Screen then we can code that in Section-Screen Output event.
Selection-Screen Event will trigger after section-screen is displayed and user action takes place on that.
Thanks,
Vinay
11-29-2007 10:41 AM
Hi,
AT SELECTION-SCREEN
1) This event is triggered once the ABAP runtime environment has passed all of the input data from the selection screen to the ABAP program.
2) If an error message occurs in this processing block, the selection screen is redisplayed with all of its fields ready for input.
3) This allows you to check input values for consistency.
<b>Example: 1</b>
PARAMETERS: P_PHONE(8).
AT SELECTION-SCREEN.
IF P_PHONE CO 0123456789 .
MESSAGE I999(ZZ) WITH
Correct input.
ELSE.
MESSAGE E999(ZZ) WITH
Wrong input.
ENDIF.
AT SELECTION-SCREEN OUTPUT event will get triggered before the screen is going to display.
<b>Example : 2</b>
PARAMETERS: TEST1(10) MODIF ID SC1,
TEST2(10) MODIF ID SC2,
TEST3(10) MODIF ID SC1,
TEST4(10) MODIF ID SC2.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'SC1'.
SCREEN-INTENSIFIED = '1'.
MODIFY SCREEN.
CONTINUE.
ENDIF.
IF SCREEN-GROUP1 = 'SC2'.
SCREEN-INTENSIFIED = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
11-29-2007 10:43 AM
AT SELECTION-SCREEN
This event is processed before leaving the Selection Screen i.e. when the selection screen has been processed (at the end of PAI once the ABAP runtime environment has passed all the input data from selection screen to the ABAP program).
This event is used to validate the input provided through selection screen. If an error message occurs in this processing block, the selection screen is redisplayed with all of its fields ready for input. This allows you to check input values for consistency.
AT SELECTION-SCREEN OUTPUT
This event gets triggered for the first time when the screen is building up and the screen is about to appear. It gets triggered again and again for every dialog step/the selection screen is refreshed/ enter key is pressed.
This event is to control the display of the screen at runtime. lilke hiding the fields, making the fields Active/Inactive, to modify the field attributes. It is a PBO Event.
Reward if useful.