Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

AT SELECTION SCREEN

Former Member
0 Likes
1,046

what is use of AT-SELECTION SCREEN OUTPUT,AT-SELECTION SCREEN ON FIELD

AND AT SELECTION?

6 REPLIES 6
Read only

Former Member
0 Likes
603

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

Read only

Former Member
0 Likes
603

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

Read only

Former Member
0 Likes
603

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

Read only

Former Member
0 Likes
603

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

Read only

Former Member
0 Likes
603

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

Read only

Former Member
0 Likes
603

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.