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

difference between AT SELECTION-SCREEN and AT SELECTION-SCREEN OUTPUT

Former Member
0 Likes
4,965

Hi,

What is the difference between AT SELECTION-SCREEN and AT SELECTION-SCREEN OUTPUT.

Regards,

Koti Reddy N

Hi,

What is the difference between AT SELECTION-SCREEN and AT SELECTION-SCREEN OUTPUT.

Regards,

Koti Reddy N

12 REPLIES 12
Read only

Former Member
3,727

AT SELECTION-SCREEN

Used for validetion screen fields. Ex: If you do not enter some fields in the selection screen then a error message should displayed in the status bar and the fields should become ready for input in selection screen.

AT SELECTION-SCREEN OUTPUT

Used to change the screen display dynamically.Ex: If you check some radiobutton in the selection screen then some I/O fields should become invisable.

Read only

Former Member
0 Likes
3,727

In at selection-screen, you will put your checks to verify data information.

In at selection-screen output, you define screen event, so you can modify screen appearence using loop at screen.

Regards,

Christophe

Read only

Former Member
0 Likes
3,727

Hi,

Do all your validations in AT SELECTION-SCREEN event and set some flag. Depending on the flag, enable/disable the screen elements in your AT SELECTION-SCREEN OUTPUT event.

at selection screen output-----

At selection-screen output is the last event triggered before selection screen displayed,

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.

at selection screen------when user enters the values in the feilds of the selection screen and clicks on execution button,this event gets triggered.this event is basically for checking the value entered by the user for the feild of the selection screen i.e data validity checking.this event is for entire selection screen.

Regards,

Sunil.

Read only

Former Member
0 Likes
3,727

hi check this..

regards,

venkat

Read only

Former Member
0 Likes
3,727

AT SELECTION SCREEN:

when user enters the values in the fields of the selection screen and clicks on execution button,this event gets triggered.this event is basically for checking the value entered by the user for the field of the selection screen i.e data validity checking.this event is for entire selection screen.

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

Read only

Former Member
0 Likes
3,727

Hi,

At selecton screen output for each field validation.

This event is assigned to the blocks on the selection screen defined by SELECTION SCREEN BEGIN/END BLOCK .

If the report starts an error dialog at this point, precisely these fields of the block block become ready for input again.

In which sequence are the events AT SELECTION-SCREEN ON psel ... , AT SELECTION-SCREEN ON RADIOBUTTON GROUP ... , AT SELECTION-SCREEN ON BLOCK ... , AT SELECTION-SCREEN processed?

The AT SELECTION-SCREEN ON psel ... events assigned to the parameters or selection options are executed in the sequence they are declared in the program, i.e. in the sequence they appear on the selection screen.

The events assigned to the radio button groups are executed according to the first parameter of the radio button group.

The events assigned to the blocks are executed "from the inside to the outside".

Example

<![if !supportEmptyParas]>

<![if !supportEmptyParas]> SELECT-OPTIONS SEL0 FOR SY-TVAR0.<![if !supportEmptyParas]> <![endif]>SELECTION-SCREEN BEGIN OF BLOCK BL0. SELECT-OPTIONS SEL1 FOR SY-TVAR1.<![if !supportEmptyParas]> <![endif]> SELECTION-SCREEN BEGIN OF BLOCK BL1. PARAMETERS P0 RADIOBUTTON GROUP RADI. PARAMETERS P1 RADIOBUTTON GROUP RADI.<![if !supportEmptyParas]> <![endif]> SELECTION-SCREEN BEGIN OF BLOCK BL2. PARAMETERS P3. SELECTION-SCREEN END OF BLOCK BL2.<![if !supportEmptyParas]> <![endif]> SELECT-OPTIONS SEL2 FOR SY-TVAR2.<![if !supportEmptyParas]> <![endif]> SELECTION-SCREEN END OF BLOCK BL1.<![if !supportEmptyParas]> <![endif]>SELECTION-SCREEN END OF BLOCK BL0.

Sequence:

AT SELECTION-SCREEN ON...

SEL0

SEL1

RADIOBUTTON GROUP RADI

P3

BLOCK BL2

SEL2

BLOCK BL1

BLOCK BL0

AT SELECTION-SCREEN is executed at the very end.

... OUTPUT

Effect

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:

<![if !supportEmptyParas]> <![endif]>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 . .

Regards,

Narasimha

Read only

Former Member
0 Likes
3,727

Hi Friend,

At AT SELECTION-SCREEN OUTPUT is PBO event of Selection screen.

AT SELECTION-SCREEN OUTPUT is processed before the selection screen is displayed on the screen. You can use this event to modify the selection screen dynamically

At AT SELECTION-SCREEN is PAI event of Selection screen.

AT SELECTION-SCREEN is processed when the user presses ENTER or chooses another function on

the selection screen.

Hope it helps.

Reward if helpful.

Regards

Hemant Khemani

Read only

Former Member
0 Likes
3,727

at selection screen id the PAI of a selection screen while AT SELECTION-SCREEN OUTPUT is the PBO

Read only

Former Member
0 Likes
3,727

at selection-screen is an event while at selection-screen output is a selection screen event like several others selection screen events.

there individual description is as follows.

This statement defines event blocks for different events selscreen_event that are triggered by the ABAP runtime environment during selection screen processing.

Selection screen events occur immediately before sending a selection screen and after certain user actions on a displayed selection screen. They assist in selection screen processing in the ABAP program.

AT SELECTION-SCREEN is triggered at least twice during actions on selection screens that are linked into another selection screen as a subscreen - first for the linked selection screen itself, and then for the linking selection screens.

Note

The event blocks after AT SELECTION-SCREEN are implemented internally as procedures. Declarative statments in these event blocks create local data.

at selection-screen output.

Effect

This event is triggered at the screen event PBO of a selection screen. In the event block, the selection screen can be prepared through assignments to the data objects of parameters and selection criteria and through dynamic screen modifications.

Note

The assignments to input fields in the event block AT SELECTION-SCREEN OUTPUT always affect the selection screen and overwrite the user inputs from previous displays of the same selection screen. Assignments in the event blocks LOAD-OF-PROGRAM oder INITIALIZATION, on the other hand, only have an effect at first program start.

reward if helpful

Read only

Former Member
0 Likes
3,727

I am not sure, but I can give you a rough idea.

In AT SELECTION-SCREEN we usually check the data entered by the user in the selection screen and if any errors are there then it will be in the same screen until user enters the proper value.

In AT SELECTION-SCREEN OUTPUT, the selection screen can be prepared through assignments to the data objects of parameters and selection criteria and through dynamic screen modifications.

Reward points if helpful.

Read only

Former Member
0 Likes
3,727

Hey kotireddy,

Simplest explanation:

AT SELECTION-SCREEN OUTPUT acts as PBO for the Selection Screen which means you can fill some screen fields\default some values on the Screen...

AT SELECTION-SCREEN acts as PAI for the Selection Screen which means it can be used to make user validations based on what values is entered by the user on the current screen...

Another Eg would be that we can have Authorization checks implemented and if the user fails to clear checks, appropiatate msg can be sent to the user....

Reward for usefull points...

Regards,

Anand Rangarajan..

Read only

Former Member
0 Likes
3,727

Hi,

At Selection-Screen Output: It triggers before selection screen has been displayed. If u want to display some value on the selection screen parameter, u can display using this event.

At Selection-Screen: It triggers after the selection screen has been displayed.This event used to validate the selection screen parameters. when pressing the F8 on the selection screen, this event will be trigger first.

Regards,

Vijay