cancel
Showing results for 
Search instead for 
Did you mean: 

Put comma in the amount field

Former Member
0 Kudos

Hi Experts,

I need to put the comma in the amount field.

eg: 3000.00 as 3,000.00.

Is there any FM which can do this conversion.

Thanks In Advance

Asish

Accepted Solutions (1)

Accepted Solutions (1)

former_member196280
Active Contributor
0 Kudos

The best way is type casting.

Ex:

Data: amount(10) Type p decimals 2. 
Value = '3000'.

WRITE VALUE TO amount.

Write amount.  "3,000

Close the thread once your question is answered.

Regards,

SaiRam

Answers (7)

Answers (7)

Former Member
0 Kudos

>Name: Asish Dash

>Total Posts: 35

>Total Questions: 20 (11 unresolved)

Hi, Is ur question still unanswered after getting so many responses.

кu03B1ятu03B9к

Former Member
0 Kudos

Hi Asish;

You can do one thing,

Declare a field of type p.

Data: amount(8) type p DECIMALS 2.

And then assign your field to that field.

amount = your_field.

im this amount field you have respective commas.

Hope it will work.

regards,

Lokesh

Former Member
0 Kudos

Hi Asish,

The formatting for comma or dot is country specific. So you can set the country code to get the required formatting.

For example: set country 'XX'. where xx is the country key. The values of which you will get in table T005X.

Regards..

Former Member
0 Kudos

Goto System->User Profile->Own data

Defaults tab..Maintain the desired format what you want...

Former Member
0 Kudos

Hi,

Declare the char field with the same length as of Curr/Quantity field.

Then use the Write statement...

Write l_curr to L_variable.

Now the l_variable will have comma's in the amount field.

Former Member
0 Kudos

Hi,

Declare a variable like p_curr type bkpf-waers in the global data of Global Definitions. Declare a reference field name in Currency/Quant Fields of Global Definitions.i.e your target variable.

Field Name Reference Field Data Type

w_var p_curr curr

Former Member
0 Kudos

what is the data type of the field.

is it char ?

write v_char to v_amt currency 'USD' "or any other currency key