2009 Dec 01 12:02 PM
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.
2009 Dec 01 12:06 PM
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
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
2009 Dec 01 12:06 PM
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
2009 Dec 01 12:08 PM
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.
2009 Dec 01 12:14 PM
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
2009 Dec 01 12:15 PM
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.
2009 Dec 01 12:09 PM
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.
2009 Dec 01 12:10 PM
Actually I dont want to use the clubbing of If statements. Is there any other possible way of validating.
2009 Dec 01 12:14 PM
Hi,
what about what Bhargava TC has mentioned?
You can als use CHECK.
Why don't you want to use IF?
Regards, Dieter
2009 Dec 01 12:20 PM
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.
2009 Dec 01 12:30 PM
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
2009 Dec 01 12:10 PM
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
2009 Dec 01 12:13 PM
at selection-screen.
if field1 is initial or
field2 is initial or
field3 is initial.
"Error
endif.
2009 Dec 01 12:32 PM
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
2009 Dec 01 12:36 PM
AT SELECTION-SCREEN.
IF sy-ucomm = 'ONLI' OR
sy-ucomm = 'PRIN' OR
sy-ucomm = 'SJOB'.
IF field1 is initial OR
field2.......
Error
ENDIF.
ENDIF.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |