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

Currency represent

daniel_duras2
Participant
0 Likes
568

Hi all,

I have some problem with currency numbers represent.

I want to convert '50 000.00' number to currency format with 3 digit places '5 000.000'. How can I do it.?

I have wrote some code

 
DATA: brtwr LIKE esll-brtwr.
DATA: lv_brtwr LIKE esll-brtwr.
DATA: lv_string(15) TYPE c.

WRITE brtwr CURRENCY 'CZK3' TO lv_string .
CONDENSE lv_string NO-GAPS.
REPLACE ','  WITH '.' INTO lv_string.
lv_brtwr = lv_string.
WRITE lv_brtwr.

but with no result ..., I have '5 000.00' now, how can I solve this ?

Regards.

1 ACCEPTED SOLUTION
Read only

former_member609120
Contributor
0 Likes
530

Hi Denielek,

First of to tell you something about currency, the amount which gets stored in Sap Tables is always with two decimal points.

Depeding on how you want to display it you can use with reference to Currency key Waers.

Eg: lv_aomunt = 50,000.00,

lv_waers = 'KWD'

write lv_amount currency lv_waers to lv_char.

write: lv_char.

Result: 5,000.000

The problem for you is that ur equating string to lv_brtwr which is of type p decimal 2.

Hence it will always show you 50,000.00

Hope this helps.

Best Regards,

Vanessa Noronha.

Edited by: Vanessa Noronha on Jun 10, 2009 2:25 PM

Edited by: Vanessa Noronha on Jun 10, 2009 2:26 PM

2 REPLIES 2
Read only

former_member242255
Active Contributor
0 Likes
530

if you want to increase the dicmal places,you can move the current value into the curreny field with 3 dcimals.

that should solve u r problem.

Read only

former_member609120
Contributor
0 Likes
531

Hi Denielek,

First of to tell you something about currency, the amount which gets stored in Sap Tables is always with two decimal points.

Depeding on how you want to display it you can use with reference to Currency key Waers.

Eg: lv_aomunt = 50,000.00,

lv_waers = 'KWD'

write lv_amount currency lv_waers to lv_char.

write: lv_char.

Result: 5,000.000

The problem for you is that ur equating string to lv_brtwr which is of type p decimal 2.

Hence it will always show you 50,000.00

Hope this helps.

Best Regards,

Vanessa Noronha.

Edited by: Vanessa Noronha on Jun 10, 2009 2:25 PM

Edited by: Vanessa Noronha on Jun 10, 2009 2:26 PM