on 08-27-2009 6:42 AM
Hi All,
I have written the below If statement in SAP scripts but when i execute the same the controll doent check the second line entries. If firtst line doesnot satisfy it goes to the else part. Kindly suggest what is wrong in this..
/: IF &T156T-BWART& = '321' OR &T156T-BWART& = '322' OR
/: &T156T-BWART& = '349' OR &T156T-BWART& = '350' OR
/: &T156T-BWART& = '312' OR &T156T-BWART& = '326' OR
/: &T156T-BWART& = '343' OR &T156T-BWART& = '344'.
/: ELSE
/: ENDIF.
Hi,
Please ignore my above comment and try with the following code
Extended command is /=
/: IF &T156T-BWART& = '321' OR &T156T-BWART& = '322' OR
/= &T156T-BWART& = '349' OR &T156T-BWART& = '350' OR
/= &T156T-BWART& = '312' OR &T156T-BWART& = '326' OR
/= &T156T-BWART& = '343' OR &T156T-BWART& = '344'.
/: ELSE
/: ENDIF.
Hope this helsp you.
Regards,
Rajani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can also try this,
/: IF '321,322,349,350,312,326,343,344' CS &T156T-BWART&.
* ----
* ----
/: endif
Regards,
Vik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Neha,
[Conditional Text: IF|http://help.sap.com/saphelp_45b/helpdata/en/d1/80325f454211d189710000e8322d00/content.htm]
Regards,
Sravanthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Neha,
any of these below tags will not work in this case.
/E, /:, space, /=, =
the only solution to your problem is to break the code in multiple IF conditions. which is not poosible too because you are using 'OR' conditions.
So the simplest way wiill be to write a PERFORM (subroutine) and inside that under these conditions set a flag and use that flag value to decide for further printing.
If you need any exaple for the PERFORM writing please let me know.
Regards,
Raj Gupta
instead check all tose conditions in your program and set a flag variable if true.
ex:
if a = 1 or a = 2 or a = 3 ...
flag = 'X'.
endif.
in your script
if &flag& = 'X'.
else.
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try like this.
/: IF &T156T-BWART& = '321' OR &T156T-BWART& = '322' OR
= &T156T-BWART& = '349' OR &T156T-BWART& = '350' OR
= &T156T-BWART& = '312' OR &T156T-BWART& = '326' OR
= &T156T-BWART& = '343' OR &T156T-BWART& = '344'.
/: ELSE
/: ENDIF.
Thanks,
Sri.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Since the second line is a continuation of the first line , you need to give spaces for the other lines,
And you must try to fit it in one line using Shift + F8 when you reach the end of first line.
Regards
Sajimon Chandran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi neha,
Try to use the '/E' fo rnext line
/E->Extended line
Here is a code:
/: IF &T156T-BWART& = '321' OR &T156T-BWART& = '322' OR
/E &T156T-BWART& = '349' OR &T156T-BWART& = '350' OR
/E &T156T-BWART& = '312' OR &T156T-BWART& = '326' OR
/E &T156T-BWART& = '343' OR &T156T-BWART& = '344'.
/: ELSE
/: ENDIF.
Hope this helps you.
Regards,
Rajani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In scripts you ahve to specify an single command statement in a single line if there is a if statement it has to be in a single line only. Change your code so that each if condition is limited to a single line.
REgards,
Himanshu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Write the whole if statement in the same line and check. When you reach the end of line hit SHIFT+F8 to extend the line and continue with the if statement in the same line.
Regards,
Vik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use space instead of /: in next line.
/: IF &T156T-BWART& = '321' OR &T156T-BWART& = '322' OR
&T156T-BWART& = '349' OR &T156T-BWART& = '350' OR
&T156T-BWART& = '312' OR &T156T-BWART& = '326' OR
&T156T-BWART& = '343' OR &T156T-BWART& = '344'.
/: ELSE
/: ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.