‎2009 Jun 10 12:01 PM
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.
‎2009 Jun 10 12:12 PM
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
‎2009 Jun 10 12:10 PM
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.
‎2009 Jun 10 12:12 PM
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