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,271

I have four to five fields in my selection screen. I want to check whether it is blank or not. Somebody told me that we can check it using whether it is initial or not but individually only. But I want like all the fields in my screen should be validated at once when i execute the program. Is there any other way of validating.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,239

Hi,

Make the Selction fields as MANDATORY. This will check for blank or not.

Further validation to be done at event - 'AT SELECTION ON XXXX'

Regards,

Bhargava

13 REPLIES 13
Read only

Former Member
0 Likes
1,240

Hi,

Make the Selction fields as MANDATORY. This will check for blank or not.

Further validation to be done at event - 'AT SELECTION ON XXXX'

Regards,

Bhargava

Read only

0 Likes
1,239

Actually the scenario is like this. All the fields in my screen are optional, but when the user enters all the field values only the next screen should be displayed. I cannot make the fields mandatory. Can you be more specific on at-selection screen event.

Read only

0 Likes
1,239

l_flag = 'X'.

IF NOT field1 is initial.

IF NOT field2 is initial.

IF NOT field3 is initial.

IF NOT field5 is initial.

clear l_flag.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

IF l_flag = 'X'.

***Error

ENDIF.

Edited by: Bhargava TC on Dec 1, 2009 5:44 PM

Read only

0 Likes
1,239

Hi,

In that case, can you check whether all of the selection screen fields are filled before calling the next screen? You will have to use AND operator here.

Regards,

Nilesh.

Read only

Former Member
0 Likes
1,239

Hi,

Why dont you club the IF statement as,

IF field1 is initial OR
   field2 is initial OR
   field3 is initial.
***Error
ENDIF.

Regads,

Nilesh.

Read only

0 Likes
1,239

Actually I dont want to use the clubbing of If statements. Is there any other possible way of validating.

Read only

0 Likes
1,239

Hi,

what about what Bhargava TC has mentioned?

You can als use CHECK.

Why don't you want to use IF?

Regards, Dieter

Read only

0 Likes
1,239

What he has mentioned is right. but I would like to use it using loop at screen. all the screen elements will be in that, Is it possible to do in my way is my question.

Read only

0 Likes
1,239

Hi,

loop at screen will not meet your requirement....

I think you will have to go with if conditions only....

use the code given below..... this might help you out

AT SELECTION-SCREEN.

if field1 is initial 
or field2 is intial
or field3 is initial
or field4 is initial.

    message ' ' type 'E' display like 'S'.

endif.

Thanks

Sid

Edited by: Siddharth Chordia on Dec 1, 2009 1:31 PM

Read only

Former Member
0 Likes
1,239

Hi

Put all ur selection screen fields under one Block..then u can use

AT SELECTION-SCREEN ON BLOCK blockname event to validate all ur fields....

more info please go through F1 help on this event

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,239

at selection-screen.

if field1 is initial or

field2 is initial or

field3 is initial.

"Error

endif.

Read only

Former Member
0 Likes
1,239

Hi RKSwamy,

AT SELECTION-SCREEN ON BLOCK blockname event is the one which best suits your requirement. This event is used to validate a group of fields on a selection screen.

It is similar as CHAIN.....ENDCHAIN concept in Module pool.

Regards

Abhii

Read only

Former Member
0 Likes
1,239

AT SELECTION-SCREEN.

IF sy-ucomm = 'ONLI' OR

sy-ucomm = 'PRIN' OR

sy-ucomm = 'SJOB'.

IF field1 is initial OR

field2.......

Error

ENDIF.

ENDIF.