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

Convert amount

Former Member
0 Likes
2,958

Hello,

I have to write (in a form) an amount in the format : 1,000,000.00

The currency and the initial format of the amount is variable.

Do you know a function module to convert an amount to this format?

Thanks in advance,

Bertrand

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,606

Hello,

Do like this:

Data: LV_amount(16).
write: amount to lv_amount

Regards,

Vasanth

9 REPLIES 9
Read only

Former Member
0 Likes
1,606

HI,

Use Function module :

BAPI_CURRENCY_CONV_TO_INTERNAL

call function 'BAPI_CURRENCY_CONV_TO_INTERNAL'

exporting

currency = 'USD'

amount_external = input

max_number_of_digits = 20

importing

amount_internal = output

  • RETURN =

.

Regards

Sudheer

Message was edited by:

Sudheer Junnuthula

Read only

0 Likes
1,606

Hello,

This method doesn't fil the ',' for thousand separators.

Any other solution ?

Thanks in advance,

Bertrand

Read only

0 Likes
1,606

did u try my solution ???

Regards,

Santosh

Read only

Former Member
0 Likes
1,607

Hello,

Do like this:

Data: LV_amount(16).
write: amount to lv_amount

Regards,

Vasanth

Read only

0 Likes
1,606

Hello,

This method doesn't work if I have not the right parameters in SU3.

Maybe, you know how to always obtain the good format.

Best regards,

Bertrand.

Read only

0 Likes
1,606

hi,

Check out this way ..

data : v_temp like coep-wkgbtr value '10000.00'.
     
data: v_result(18).

 write : v_temp to v_result.

Regards,

Santosh

Read only

0 Likes
1,606

Use

SET COUNTRY f. 

to insure the output format.

Regards.

Read only

0 Likes
1,606

ur trying to format the amount ...

try this...

write: amt USING EDIT MASK 'RR___,___,___.__'.

LL for left justified.

Hope this helps..

Rgds.

Read only

0 Likes
1,606

Hello,

Try with the FM

<b>SD_CONVERT_CURRENCY_FORMAT</b>

REgards,

Vasanth