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

Selection Screen Validation

Former Member
0 Likes
1,186

I have a field in the selection screen.

We can validate it through AT SELECTION SCREEN & AT SELECTION SCREEN ON <FIELD>

Then what is the difference between the two usages in this case ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
706

Suppose u have three field f1,f2,f3 in selection screen now you want that if the validetion failed then only F1 should be ready for editable and others will be non editable in that case 'AT SELECTION SCREEN ON <F1>' is used.

If you do the validetion in'AT SELECTION SCREEN' then all the fields will be ready for input if validetion failed for any of the field.

3 REPLIES 3
Read only

Former Member
0 Likes
706

Hi,

AT SELECTION-SCREEN selscreen_event.

Effect

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 ON <field>

... ON {para|selcrit}

Effect

This event is triggered at the screen event PAI of a selection screen if the content of the input field of a parameter para or a line of a selection criterion selcrit was passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or an error message in the event block makes the fields para and selcrit ready for input again.

No parameter that is defined as a radio button can be specified. For this purpose, the addition ON RADIOBUTTON GROUP is provided.

Note

If a user action takes place in the dialog box for the multiple selection of a selection criterion selcrit, the entries of the selection table are passed to the program, line by line. For each line, the event AT SELECTION-SCREEN ON selcrit is triggered.

Example:

parameters: p_num type i default 20,

p_num1 type i default 25.

at selection-screen on p_num.

if p_num > 10.

message 'Valid' type 'S'.

else.

message 'Invalid' type 'E'.

endif.

at selection-screen.

if p_num1 > 20.

message 'Valid' type 'S'.

else.

message 'Invalid' type 'E'.

endif.

Edited by: Velangini Showry Maria Kumar Bandanadham on May 7, 2008 11:21 AM

Read only

Former Member
0 Likes
707

Suppose u have three field f1,f2,f3 in selection screen now you want that if the validetion failed then only F1 should be ready for editable and others will be non editable in that case 'AT SELECTION SCREEN ON <F1>' is used.

If you do the validetion in'AT SELECTION SCREEN' then all the fields will be ready for input if validetion failed for any of the field.

Read only

Former Member
0 Likes
706

Hi,

At selection screen :

if u write any validation on X field. while runtime it gives message if u enter wrong entry remain fields are also enable(editable).

At selection screen on field:

while runtime , until unless u enter correct value into that field, only the field get eanable remains all are disable.