on 10-10-2008 3:02 PM
Hi All,
I am using an IF condition in main window of the sapscript.
I am writing it as
/: if &itab-fld1& ne 'f1' or &itab-fld2& ne 'f2' or &itab-fld3& ne 'f3'
call some include..
/:endif
Now, when i am testing it, during debugging, i found out that, the if condition is working fine for the first field and its not working for the remaining fields i.e., even though the second field condition is satisfied, the control is still coming inside the code and the include is getting called. The same is with checking the third field also. I am not able to understand why, I cehcked out the syntax for the if statement but its fine.
Can anybody please help out whats wrong.
Regards,
Priya
instead of OR you have to use AND:
/: IF &itab-fld1& NE 'f1' AND &itab-fld2& NE 'f2' AND &itab-fld3& NE 'f3'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eric,
the AND condition worked. Thank you very much man.
Priya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eric,
thanks for the answer.
But if we use "and" condition, because we want to call the include if either of the 3 fields are checked,
will it work?
I just have a doubt. Please help me out
REgards
Priya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.