‎2006 May 09 3:27 PM
what is use of AT-SELECTION SCREEN OUTPUT,AT-SELECTION SCREEN ON FIELD
AND AT SELECTION?
‎2006 May 09 3:31 PM
Hi,
Check out the program DEMO_SELECTION_SCREEN_EVENTS.
It has everything that you want.
<b>Please reward some points if it helps.</b>
Regards,
Amit Mishra
‎2006 May 09 3:32 PM
Hi,
at selection-screen output(it is like A PBO) is used to modify the selection screen fields.
AT-SELECTION SCREEN ON FIELD
is to validate a particular selection screen field.
if any error comes it will open only this field and other fields will be disabled.
AT-SELECTION SCREEN
you can validate all the selection screen fields.
Regards
vijay
‎2006 May 09 3:33 PM
hi,
AT-SELECTION SCREEN OUTPUT
This event is executed at PBO of the selection screen every time the user presses ENTER - in contrast to INITIALIZATION. Therefore, this event is not suitable for setting selection screen default values. Also, since AT SELECTION-SCREEN OUTPUT is first executed after the variant is imported (if a variant is used) and after adopting any values specified under SUBMIT in the WITH clause, changing the report parameters or the selection options in AT SELECTION-SCREEN OUTPUT would destroy the specified values.
Here, however, you can use LOOP AT SCREEN or MODIFY SCREEN to change the input/output attributes of selection screen fields.
Example
Output all fields of the SELECT-OPTION NAME highlighted:
SELECT-OPTIONS NAME FOR SY-REPID MODIF ID XYZ.
...
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CHECK SCREEN-GROUP1 = 'XYZ'.
SCREEN-INTENSIFIED = '1'.
MODIFY SCREEN.
ENDLOOP.
The addition MODIF ID XYZ to the key word SELECT-OPTIONS assigns all fields of the selection option NAME to a group you can read in the field SCREEN-GROUP1. At PBO of the selection screen, all these fields are then set to highlighted.
AT-SELECTION SCREEN ON FIELD
This event is for validating a particular field in the selection-screen.
AT SELECTION-SCREEN.
is the basic form for events on selection screen and used for validating all the selection-screen fields.
hope this helps,
do reward points
priya.
Message was edited by: Priya
‎2006 May 09 3:36 PM
HI
GOOD
AT SELECTION-SCREEN OUTPUT=>
In the PBO of the selection screen, the
AT SELECTION-SCREEN OUTPUT
event is triggered. This event block allows you to modify the selection screen directly before it is displayed.
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.
-
AT SELECTION-SCREEN ON FIELD=.
In the PAI event of the selection screen, the event
AT SELECTION-SCREEN ON <field>
is triggered when the contents of each individual input field are passed from the selection screen to the ABAP program. The input field <field> can be checked in the corresponding event block. If an error message occurs within this event block, the corresponding field is made ready for input again on the selection screen.
The program below is connected to the logical database F1S:
REPORT EVENT_DEMO.
NODES SPFLI.
AT SELECTION-SCREEN ON CITY_FR.
IF CARRID-LOW EQ 'AA' AND CITY_FR NE 'NEW YORK'.
MESSAGE E010(HB).
ENDIF.
THANKS
MRUTYUN
‎2006 May 09 4:00 PM
AT selection-screen output
This event is executed at PBO of the selection screen every time the user presses ENTER - in contrast to INITIALIZATION. Therefore, this event is not suitable for setting selection screen default values. Also, since AT SELECTION-SCREEN OUTPUT is first executed after the variant is imported (if a variant is used) and after adopting any values specified under SUBMIT in the WITH clause, changing the report parameters or the selection options in AT SELECTION-SCREEN OUTPUT would destroy the specified values.
Here, however, you can use LOOP AT SCREEN or MODIFY SCREEN to change the input/output attributes of selection screen fields.
Example
Output all fields of the SELECT-OPTION NAME highlighted:
SELECT-OPTIONS NAME FOR SY-REPID MODIF ID XYZ.
...
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CHECK SCREEN-GROUP1 = 'XYZ'.
SCREEN-INTENSIFIED = '1'.
MODIFY SCREEN.
ENDLOOP.
The addition MODIF ID XYZ to the key
At selection-screen on field
AT SELECTION-SCREEN ON <field>
is triggered when the contents of each individual input field are passed from the selection screen to the ABAP program. The input field <field> can be checked in the corresponding event block. If an error message occurs within this event block, the corresponding field is made ready for input again on the selection screen.
The program below is connected to the logical database F1S:
REPORT EVENT_DEMO.
NODES SPFLI.
AT SELECTION-SCREEN ON CITY_FR.
IF CARRID-LOW EQ 'AA' AND CITY_FR NE 'NEW YORK'.
MESSAGE E010(HB).
ENDIF.
If the user enters "AA" in the first input field, but not NEW YORK for the departure city, an error message is displayed in the status line until the user enters the correct city
‎2006 May 09 4:06 PM
hi srinivas,
Parameters assigned to a modification group can be processed as an entire group with the LOOP AT SCREEN/MODIFY SCREEN statements during the AT SELECTION-SCREEN OUTPUT event .
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.
regards,
keerthi.