‎2006 May 09 10:53 AM
Hi.
How do we assign a negative sign to a SAP-SCRIPT variable??
say &vbdkr-zamount&...how shall we make this variable negative in coding?
Thanks
‎2006 May 09 11:03 AM
Do like this in your print program
vbdkr-zamount = 0 - vbdkr-zamount.
or
vbdkr-zamount = -1 * vbdkr-zamount.
Regards,
ravi
‎2006 May 09 11:07 AM
hi subhash,
yes u can try with
SET SIGN (Position of +/- sign)
hope this helps,
priya.
‎2006 May 09 11:13 AM
‎2006 May 09 11:37 AM
Hey Subhas,
you can assign a negative sign to a script variable by simply multiplying it by -1 in your print program.
However , while looking at the print preview, the sign will be printed to the right of the number as ,say , 45 -.
So you can include this logic so as to get a result in print preview as '-45' .
<b>* Sample Code :</b>
data : amt type i .
amt = 45.
amt = -1 * amt.
data : a type str ,
b type str,
c type str.
a = amt.
split a at '-' into b c.
condense b.
concatenate '-' b into a .
Now into your Script, you can include the program symbol a at the required position.
The output in the print preview will be -45.
Regards,
Kunal.