‎2006 Jan 17 4:17 AM
Hi All,
I am facing one problem in SAP-SCRIPT, I am using IF statement for checking Service tax if service tax is greater than 0 then it should print the service tax @ 10.20 % other wise it should not print any thing. i am giving the code in main window.
if &ser& > '0'
Service Tax & Edu.cess @ 10.20 %
&ser&
endif.
if ser > 0 it is not printing Please help.
regards
Vinayak
‎2006 Jan 17 4:24 AM
‎2006 Jan 17 4:28 AM
Hi
I am using one element with format column /E
and for if & endif usinf /:
still it is not working
Vinayak
‎2006 Jan 17 5:41 AM
Hi Vinayak,
I think this is because the variable has decimal places and sapscript gets confused. Declare a constant in your abap say, c_zero, of the same type as ser but with a value of 0. Change your sapscript to:
IF &ser& > &c_zero&.
Service Tax & Edu.cess @ 10.20 %
&ser&
endif.
Message was edited by: Neil Woodruff
‎2006 Jan 17 10:16 AM
‎2006 Jan 17 11:00 AM
Hi Vinayak,
I also faced this problem
In scripts use gt,lt,eq.. instead of >,<,=....
Try this ...
IF &SER& GT '0'
....
ENDIF
‎2006 Jan 17 11:22 AM
Create a CONSTANTS field with the same data type as the field which you use to compare.
And use LT, GT instead of < , > ...