Skip to Content
author's profile photo Former Member
Former Member

SAP Script IF ELSE Check

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.