2009 Jun 03 1:07 PM
I have a sapscript and a IF condition like this, very long :
if cond1 or cond2 or cond3
or cond4 or cond5 or cond6 or ....
How can i write this condition on multiple lines? I tried with "=" and "/=" on the left but doesn't work.
Thank you
To the best of my knowledge, only single line conditions should be given in an Script. May be you can use an nested IF statement.
Something like,
/: IF condition 1
/: IF condition 5
something like this.
Again, i am not completely sure but i think this is the solution.
2009 Jun 03 1:10 PM
Hello,
The command line should be
Example
/: IF &condition& NE ' '
OR &condtion& NE ' '
2009 Jun 03 1:13 PM
2009 Jun 03 1:15 PM
To the best of my knowledge, only single line conditions should be given in an Script. May be you can use an nested IF statement.
Something like,
/: IF condition 1
/: IF condition 5
something like this.
Again, i am not completely sure but i think this is the solution.
2009 Jun 03 1:16 PM
Hi,
Go to your script and in change editor option and then write down all your if conditions, hopefully system will automatically considered it and it will work
Regards,
Vijay
2009 Jun 03 1:31 PM
I can't change the editor.
So i have to do something like this?
/: IF ........
(empty here) or ......
(empty here) or ......
or something like this:?
/: IF ......
/: or ....
/: or.......
or something like this?
/ IF ......
/ or ....
/ or.......
Edited by: Was Wasssu on Jun 3, 2009 2:32 PM
2009 Jun 03 1:46 PM
Hello,
for me seems to work just fine like this
IF ( 1 > 0 ) or ( 2 > 1 ) or ( 3 > 2 ) or ( 4 > 3 ) or ( 5 > 4 ) or
( 6 > 5 ) or ( 7 > 6 ).
message i001.
ENDIF.try to check if you put space between parenthesis and condition. maybe the error is from there.
Hope it helps.
2009 Jun 04 7:56 AM
Doesn't work with:
/: IF ......
/: or ....
/: or.......
Any new ideea?
2010 Aug 17 11:17 AM
I had the same problem.
The solution is that You have to leave 'OR'or 'AND'
in the previous line:
/: IF ...... or
/: .... or
/: .......
2015 Apr 22 11:17 AM
2021 Jun 08 7:27 AM
Hello,
You can write all your checks in your driver program and can set a flag if all "if(s)" are satisfied. Then at the Script you can check for your flag.
Something like this-->
Data: gv_flag type abap_bool. "In Driver Program
.
.
.
.
Clear gv_flag.
If ltap-werks eq '8160' or ltap-werks eq '8160' or etc etc etc.
gv_flag = abap_true.
endif.
*In Script
If &GV_FLAG& eq 'X'.
"Do Something
Endif.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |