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: 

how to add currency field

Former Member
0 Kudos

Hello all,

In my form i have to add currency field and print the total of that field

but my problem is the user setting for the field may change depends on the user for one user the format is like 100,000.75

for some user's the format is 100.000,75

so any body help me by telling how add the currency field and handle this kind of scenario

regards

raj

2 REPLIES 2

Former Member
0 Kudos

Hi Raj,

You can do this only by your driver program.. There is no specific way to make the amount format constant.. while displaying it..

It will always take the user format.. But the only thing you can do is, put the amount you want to display in a CHAR type field.

And then by Replace you can get the proper format and display it..

For ex..

Suppose that the user setting is 100.000,75 but you always want to have '.' as the decimals then code like this..

DATA : w_char(20) TYPE c.

WRITE : w_amount TO w_char.

DO.

REPLACE '.' WITH 'x' INTO w_char. ( 100x000,75)

REPLACE ',' WITH '.' INTO w_char. (100x000.75)

REPLACE 'x' WITH ',' INTO w_char. (100,000.75)

Thanks and Best Regards,

Vikas Bittera.

**Reward if useful**

Former Member
0 Kudos

Hi

Welcome to the SDN forum.

You can add the field and populate it with values

to print the same currency format you can use the command

/: SET COUNTRY 'IN' ....to print indian currency in (1,000.00) format)

in place of IN you can hardcode any country to print the country specific currecny formats.

Regards

Anji