‎2007 Nov 21 8:43 AM
Hi SDN,
I am adding a condition in the script. IF ELSE condition. The condition happens to be longer than the line size of the editor. It comes to the next line and the other.
When my script run, it checks the condition only on the first line and the rest is not checked and printed as text. I mean the whole condition gets printed as text.
Can anyone help me out with this.
How shall I modify the script so that the whole text is treated as a condition and not the text.
Thanks in advance,
Useful answers will be rewarded with points.
Thanks,
Manu
‎2007 Nov 21 8:55 AM
Hi ,
even i faced the same problem.
As script doent check the very long conditions (more than 1 line)
The solution which i adopted is :
Call the Perform Routine from ur script and with in SE38 editor, u have to mention all ur If.........else conditions.
witth in this condition pass the Flag to the variable .
Ex:
If.......
gv_x = 'X'.
else.
gv_x = ' '.
endif.
Now u can use this flag variable in the script editor to check whther it has passed IF condition , or ELSE Condition.
Revrt back if nay issues,
Regards,
Naveen
‎2007 Nov 21 8:46 AM
Make sure the paragraph format of the second line is blank, SAPscript will treat this as a continuation of the line.
Regards,
Nick
‎2007 Nov 21 8:49 AM
I did that already. There is no paragraph format in that line.
‎2007 Nov 21 8:56 AM
Are you using the graphical or text editor? If you're using the text you have the function Ctrl+F8 which shifts the line left or right.
Alternatively the paragraph format = acts as a line continuation.
If all else fails you may need to split you condition into nested IFs.
Regards,
Nick
‎2007 Nov 21 8:57 AM
You may use this under text editor:-
Edit>Page Left/Right
or
put your mouse cursor on the line, and then press Shift+F8
‎2007 Nov 21 8:55 AM
Hi ,
even i faced the same problem.
As script doent check the very long conditions (more than 1 line)
The solution which i adopted is :
Call the Perform Routine from ur script and with in SE38 editor, u have to mention all ur If.........else conditions.
witth in this condition pass the Flag to the variable .
Ex:
If.......
gv_x = 'X'.
else.
gv_x = ' '.
endif.
Now u can use this flag variable in the script editor to check whther it has passed IF condition , or ELSE Condition.
Revrt back if nay issues,
Regards,
Naveen
‎2007 Nov 21 8:59 AM
Hi Manu,
Try to put whole cond. in single line like...
when you are in edit mode in script press Shift + F8..then you'll get continuation line. here you can enter whole cond in single line.
I'm not sure you are getting error because of writing IF cond in two lines.
Thanks
‎2007 Nov 21 9:10 AM
I have tried using SHIFT+F8. The condition is longer. I think I will have to write a seperate routine as suggested by Naveen.
Thanks,
Manu
‎2007 Nov 21 9:35 AM
Hi ,
seperate subroutine will definetly work as i did the same.
regards,
Naveen