Skip to Content

about if condition

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 17, 2008 at 11:35 AM

    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...

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • avatar image
    Former Member
    Nov 17, 2008 at 11:44 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 06, 2010 at 08:45 AM

    sol

    Add comment
    10|10000 characters needed characters exceeded