on 10-25-2011 12:27 PM
Hi All,
I am getting problem with IF statement in SAP Script. I need to display one column DR/CR based on the amount field values.
For this i have written like this.
IF &bseg-dmbtr& LT 0
DEFINE &VAR& = 'CR'
ELSE
DEFINE &VAR& = 'DR'
ENDIF
Here VAR is a variable defined here only .
Here, if statement is not working properly.
Can any one Help me.
Thanks.
You cannot compare numeric values in script. In your program code it as
IF bseg-dmbtr LT 0.
flag = 'X'.
else.
flag = ' '.
endif.
In your script code it as
IF &flag& EQ 'X'.
DEFINE &VAR& = 'CR'
else.
DEFINE &VAR& = 'DR'
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How are you referring to BSEG if your structure is RF130? have you tried something like:
Define &VARP& = 'DR'
Define &VARN& = 'CR'.
/: If &amount field& < 0.
&amount field&&VARN&
/: else
&amount field&&VARP&
/: endif.
Of course, we usually don't output CR/DR if there is a +/- sign on the number, do we?
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.