cancel
Showing results for 
Search instead for 
Did you mean: 

SAPScript - Using "if" statements

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Answers (0)