cancel
Showing results for 
Search instead for 
Did you mean: 

Sapscript: IF statement over multiple lines ?

h_senden2
Active Contributor
0 Kudos

Hi,

in my sapscript i have to use an IF statement with many OR conditions

/: IF cond1 OR cond2 OR cond3 OR cond4 OR cond5 ........

But i can't write it on one line. Even with SHIFT-F8 to go to the right the line lenght is too short.

How can i solve this one ?

regards,

Hans

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

Write on next line with column tag as space or =.

Reward if helpful.

Regards.

Praveen.

h_senden2
Active Contributor
0 Kudos

i know the format = is working for normal lines, but also for IF statements ?

After testing, it seems not to work your way.

Anyone else ?

regards,

Hans

Edited by: Hans Senden on Mar 14, 2008 1:56 PM

Former Member
0 Kudos

Hi,

This is not a solution, more a workaround but should avoid the line length problem.

Define a flag in your form (/: DEFINE &IF_FLAG&), then you can call an ABAP subroutine to set the value of this flag (take a look at the online help for SAPscript PERFORM if you're not familiar with it). The subroutine will contain your long IF statement and the SAPscript will just contain

/: IF &IF_FLAG& = 'X'.

Regards,

Nick

h_senden2
Active Contributor
0 Kudos

hi Nick,

that's the way i normally solve it. But i was hoping there were other solutions.

The quick and dirty solution (and i did it) was to copy the code between the IF and ENDIF (a few lines) and make a new IF statement.

regards,

Hans