cancel
Showing results for 
Search instead for 
Did you mean: 

about if condition

mahesh_jagnani
Participant
0 Kudos

Hi All,

i need a query.

Can you please provide the solution.

if we have to check the condition like

IF NAST-VSTAT = 0 AND

( IF EKKO-BSART = 'NB' OR IF &EKKO-BSART& = 'FO' ).

-


Do this.

else.

-


do this.

endif.

How we will write in sap script.

Thank u.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In SAP Script

/: IF NAST-VSTAT = 0 AND

/: ( IF EKKO-BSART = 'NB' OR IF &EKKO-BSART& = 'FO' ).

AB -


Do this.

/: else.

AH -


do this.

/: endif.

AB and AH are paragaraph formats...

mahesh_jagnani
Participant
0 Kudos

Thanks but it is not working.

Can you please check again and reverrt back,.

JozsefSzikszai
Active Contributor
0 Kudos

you cannot break one statement into more lines in SAPScript, so the solutions provided by others won't work.

I think there are two options:

1. Check if one line is long enough for the IF.. condition (there are options Left/Right to double the line length)

2. If the above still does not help you have to break your statement into several IFs:

/: IF NAST-VSTAT = 0.

/: IF IF EKKO-BSART = 'NB' OR IF &EKKO-BSART& = 'FO' .

AB -


Do this #1.

/: else.

AH -


do this #2.

/: endif.

AH -


do this #2.

/: endif.

bad thing is that the do this #2 has to be duplicated

Answers (2)

Answers (2)

mahesh_jagnani
Participant
0 Kudos

sol

Former Member
0 Kudos

In SAP Script

/: IF &NAST-VSTAT& = 0 AND

/: ( &EKKO-BSART& = 'NB' OR &EKKO-BSART& = 'FO' ).

AB -


Do this.

/: else.

AH -


do this.

/: endif.

AB and AH are paragaraph formats...

try this once other wise use flags to make it simple ok.. all the best.

ur's

GSANA

Former Member
0 Kudos

/: IF &NAST-VSTAT& = 0 AND

= ( &EKKO-BSART& = 'NB' OR &EKKO-BSART& = 'FO' ).

AB -


Do this.

/: else.

AH -


do this.

/: endif.

plz correct it. in the condition

Former Member
0 Kudos

/: IF &NAST-VSTAT& = 0 AND

= ( &EKKO-BSART& = 'NB' OR &EKKO-BSART& = 'FO' ).

AB -


Do this.

/: else.

AH -


do this.

/: endif.

plz correct it. in the condition

mahesh_jagnani
Participant
0 Kudos

Thanks but it is not working.

Can you please check again and reverrt back,.