Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

control break in sap script

Former Member
0 Likes
747

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

6 REPLIES 6
Read only

Former Member
0 Likes
722

Check your format column...( /: , /E , * etc. )

Read only

0 Likes
722

Hi

I am using one element with format column /E

and for if & endif usinf /:

still it is not working

Vinayak

Read only

former_member186741
Active Contributor
0 Likes
722

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

Read only

Former Member
0 Likes
722

Try aligning your fields in order to compare...

Read only

Former Member
0 Likes
722

Hi Vinayak,

I also faced this problem

In scripts use gt,lt,eq.. instead of >,<,=....

Try this ...

IF &SER& GT '0'

....

ENDIF

Read only

Former Member
0 Likes
722

Create a CONSTANTS field with the same data type as the field which you use to compare.

And use LT, GT instead of < , > ...