cancel
Showing results for 
Search instead for 
Did you mean: 

Sap Script : if Condition

Former Member
0 Kudos

Dear All,

I have read that ''A condition may not occupy several lines. Both the IF or ELSEIF command and the attached condition must be completely contained within a single line " But my conditon is something like this and is not allowing me to enter in single line.

IF ltak-lgnum = 'xxxxxxxx' and ( ltap-VLTYP = 'ABC' or ltap-VLTYP = 'XYZ' ).

&RED&

ENDIF.

Please let me know. Can I use this brackets in SAP script Editor ??

Thanks & Regards

Venkat

Accepted Solutions (1)

Accepted Solutions (1)

RichHeilman
Developer Advocate
Developer Advocate

Try separating it.

IF ltak-lgnum = 'xxxxxxxx'.
IF ltap-VLTYP = 'ABC' or ltap-VLTYP = 'XYZ' .

&RED&

ENDIF.
ENDIF.

Regards,

RIch Heilman

Former Member
0 Kudos

Thanks Heilman,

Also please let me know, can I use brackets in SAP Script conditions.

Regards

Venkat

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

I have never tried it, but I do know that the IF statements can not be complex in sapscript. It is best to keep them really simple.

Regards

Rich Heilman

Former Member
0 Kudos

Thanks Heilman,

My issue is resolved, closing thread. Alloting Points

Regards

venkat

Answers (0)