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 write an amount with dots

Former Member
0 Kudos

Hi,

I have to write amounts with a dot per thousandth in a report, ex. 1234567,01 should be 1.234.567,00 and 1233

1.233. Do anyone know a simple way to do that? Maybe by a function module?

Br Benita

1 ACCEPTED SOLUTION

Former Member
0 Kudos

From Sap help:

REPORT demo_list_write_currency LINE-SIZE 40.

DATA: num1 TYPE p DECIMALS 4 VALUE '12.3456',

num2 TYPE p DECIMALS 0 VALUE '123456'.

SET COUNTRY 'US'.

WRITE: 'USD', num1 CURRENCY 'USD', num2 CURRENCY 'USD',

/ 'BEF', num1 CURRENCY 'BEF', num2 CURRENCY 'BEF',

/ 'KUD', num1 CURRENCY 'KUD', num2 CURRENCY 'KUD'.

9 REPLIES 9

Former Member
0 Kudos

1234567,01 should be 1.234.567,01

0 Kudos

Dear Benita,

This is the basic setting that you can do from menu itself.

System > User Profile > Own Data or throught tcode SU01/02.

Change in 'Default' tab the 'decimal notation'.

Hope this will be fine with you.

Regards,

Deva.

0 Kudos

that doesn't help me, I read an amount from a table that is a CURR field and have to write it in a report, a C field, not an ALV report. Thanks!

0 Kudos

Hi,

Could you pls let us know ur amount data type so that we can work on it...

I was trying somthing like this:

data: value1 type mhnd-wzsbt value '123456701',
      value2 type mhnd-wzsbt.

      value2 = value1.

      write: value2.

but the o/p is '123,456,701.00'

Best Regards,

Anjali

Former Member
0 Kudos

pass it to type p

Former Member
0 Kudos

Use WRITE... CURRENCY...

b.

Former Member
0 Kudos

From Sap help:

REPORT demo_list_write_currency LINE-SIZE 40.

DATA: num1 TYPE p DECIMALS 4 VALUE '12.3456',

num2 TYPE p DECIMALS 0 VALUE '123456'.

SET COUNTRY 'US'.

WRITE: 'USD', num1 CURRENCY 'USD', num2 CURRENCY 'USD',

/ 'BEF', num1 CURRENCY 'BEF', num2 CURRENCY 'BEF',

/ 'KUD', num1 CURRENCY 'KUD', num2 CURRENCY 'KUD'.

Former Member
0 Kudos

Hi,

Try using this function module 'BAPI_CURRENCY_CONV_TO_EXTERNAL'

Pass currency = 0

Amount_internal = 'your value'.

Regards,

Gayathri

Former Member
0 Kudos

Hi benita,

1. 12.345.678,95

2. Ur code only (with extra enhancement)

3. Just copy paste in new program

4.

REPORT demo_list_write_currency LINE-SIZE 40.

DATA: num1 TYPE p DECIMALS 4 VALUE '12.3456',

num2 TYPE p DECIMALS 0 VALUE '1234567895'.

SET COUNTRY 'US'.

WRITE: 'USD', num1 CURRENCY 'USD', num2 CURRENCY 'USD',

/ 'BEF', num1 CURRENCY 'BEF', num2 CURRENCY 'BEF',

/ 'KUD', num1 CURRENCY 'KUD', num2 CURRENCY 'KUD'.

*----


NEW CODE

data : s(25) type c.

write num2 to s currency 'KUD'.

write 😕 s.

replace all occurrences of ',' in s with '@'.

replace all occurrences of '.' in s with '#'.

replace all occurrences of '@' in s with '.'.

replace all occurrences of '#' in s with ','.

write 😕 s.

regards,

amit m.