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

SAPScript - Using "if" statements

I am trying to modify a SAPScript form which we use for an invoice when billing retirees for health benefits. We have recently had a scenario where a retiree paid in advance, so he basically has money on account and doesn't owe next month. My users want the invoice changed so that if there is money on account the bill says "Balance", but if the retiree owes it says "Balance due". I have tried formatting my "If" statement several ways and have even debugged it to make sure the fields are filled like I think they should be. No matter what the field's value is, it always thinks there is money on account and prints "Balance". Am I missing something??

Thanks,

Mary Kerschke

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 16, 2005 at 02:25 PM

    Hi Mary,

    If statements in SAP-script are formatted as follows:

    IF &STRUCTURE-FIELD&='VALUE'
    Balance
    ELSE
    Balance due
    ENDIF

    Furthermore if you need to check VALUES (like a balance value) you must create your own field in the corresponding ABAP of the script.

    I suggest you define a flag like MY_BALANCE_FLAG and fill it with an X if you want Balance printed and leave it empty if you want Balance due printed.

    In the SAP script it would show as:

    IF &MY_BALANCE_FLAG&='X'
    Balance
    ELSE
    Balance due
    ENDIF

    Hope this helps you on your way.

    Regards,

    Rob.

    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.