05-30-2009 4:12 AM
Hi Experts,
i am calling 'fm' to convert digit amount to words but in print its contains minus(-) sign and because of
that its giving wrong value. the amount is 57,387,916.20- and i have to delete - from this amount.
i am using the syntax :SHIFT AMT RIGHT DELETING TRAILING '-'. but its not working.so please tell me
how to do this.
Thanks.
05-30-2009 5:50 AM
Hi,
Whats the data type of the variable AMT? If its Curr then u can use the below code to remove (-).
AMT = AMT * -1.
Else if the variable is char or string just try out the below code.
SHIFT AMT RIGHT DELETING TRAILING '- '
Regards,
Nikhil
Edited by: Nikhil Kayal on May 30, 2009 10:21 AM
05-30-2009 5:55 AM
hi,
use
data : a type p decimals 2 value '13245.56-',
b type p decimals 2.
b = abs( a ).
write : b.
05-30-2009 7:57 AM
Hi,
Multiply -1.
data : l_amount type PAD_AMT7S,
l_value type i value '-1'.
l_amount = '57387916.20-'.
l_amount = l_amount * l_value.
Output:- '57387916.20'.
05-30-2009 8:28 AM
Dear Saalim,
Best way to change the - ve is multiply by -1if it is Numeric type. Other wise please convert the -ve sign into + ve sign after getting the value before move to text type.
With Regards,
Selvan.M
05-30-2009 12:32 PM
05-30-2009 12:46 PM
this is simple
before passing it to fm,
use an if statement and modify the value to positive and send to fm
as follows
if amt < 0.
amt = - amt.
endif.
call 'Fm(what u need).
in that send your variable