Application Development 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: 

To delete minus(-) sign

Former Member
0 Kudos

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.

6 REPLIES 6

Former Member
0 Kudos

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

Former Member
0 Kudos

hi,

use

data : a type p decimals 2 value '13245.56-',

b type p decimals 2.

b = abs( a ).

write : b.

Former Member
0 Kudos

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'.

Former Member
0 Kudos

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

Former Member
0 Kudos

answered

Former Member
0 Kudos

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