Skip to Content
avatar image
Former Member

Extension of if statement in SAP standard text (SO10)

There is an if condition inside SAP standard text . that exceeding the line limit Shift + f8 .

When i tried to extend the line with tag line such /: /= and space . It is not working as expected.

Is there anyway if statement can be extended even after the extension command shift + f8.

Just an additional info

Here i am sharing one sample code for understanding purpose

IF &var& = '1000' OR &var& = '2000' OR &var& = '2700' OR &var& = '3000' OR 
&var& = '3300' .
logic..... 
Endif.

I need to add few more &var& value inside the if condition.

Any input would be helpful.

Regards,

Prabin





Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Nov 22, 2016 at 01:39 PM

    As explained in the documentation:

    • You must not extend a condition over more than one line. Both the IF or ELSEIF command and the attached condition must be completely contained within a single line.

    Workaround:

    • Use an additional flag:
    • DEFINE &bool& = ''
      IF &var& = '1000' OR &var& = '2000'.
      DEFINE &bool& = 'X'.
      ELSEIF &var& = '2700' OR &var& = '3000' OR &var& = '3300'.
      DEFINE &bool& = 'X'.
      ENDIF

      IF &bool& = 'X'.
    • Or use a PERFORM to test the condition, and return a boolean, which you can then test.
    Add comment
    10|10000 characters needed characters exceeded