Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

conditions in Sapscript

Former Member
0 Likes
676

What is the correct syntax for something like follows

IF &VBRP-PSTYV& = 'G2W' OR &VBRP-PSTYV& = 'L2W' AND &VBRP-FKIMG& = '0'

The item category could be G2W or L2W and Billed Qty = 0

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
647

Hello,

IF &VBRP-PSTYV& = 'G2W' OR &VBRP-PSTYV& = 'L2W' AND &VBRP-FKIMG& = '0'

check below.

try with this

IF ( &VBRP-PSTYV& = 'G2W' OR &VBRP-PSTYV& = 'L2W' ) AND &VBRP-FKIMG& = '0'.

added brakets for that OR condition

please let me know is this correct ot not

Thank u,

santhosh

What is the correct syntax for something like follows

IF &VBRP-PSTYV& = 'G2W' OR &VBRP-PSTYV& = 'L2W' AND &VBRP-FKIMG& = '0'

The item category could be G2W or L2W and Billed Qty = 0

4 REPLIES 4
Read only

Former Member
0 Likes
648

Hello,

IF &VBRP-PSTYV& = 'G2W' OR &VBRP-PSTYV& = 'L2W' AND &VBRP-FKIMG& = '0'

check below.

try with this

IF ( &VBRP-PSTYV& = 'G2W' OR &VBRP-PSTYV& = 'L2W' ) AND &VBRP-FKIMG& = '0'.

added brakets for that OR condition

please let me know is this correct ot not

Thank u,

santhosh

Read only

0 Likes
647
IF &VBRP-FKIMG& = '                0' AND (&VBRP-PSTYV& = 'G2W' OR &VBRP-PSTYV& = 'L2W')

Is there something wrong with that piece of code. It is acting funny.

Read only

0 Likes
647

Hi

The SAPSCRIPT sees the value of a variable using the output format, so that explains as u need to insert

IF &VBRP-FKIMG& = '                0'

instead of

IF &VBRP-FKIMG& = '0'

Max

Read only

Former Member
0 Likes
647

I finally decide to move the entire logic to the driver program itself. Having multiple conditions does not seem to work in Sapscripts for some reason. A single IF seems to work fine but ANDs ORs seem to behave strangely every now and then. Not sure why.