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

separate commas from amount

Former Member
0 Likes
1,067

Hi there,

How to separate commas from amount?

Example:

12,000,000.00 to 12000000.00

Thank You.

8 REPLIES 8
Read only

Former Member
0 Likes
1,032

Hi Havoc,

just try like this,

replace ',' WITH ' ' INTO v_menge.

CONDENSE V_MENGE NO-GAPS.

Read only

Former Member
0 Likes
1,032

Hi,

Move the Amount field to Char field.

If you have the amount value in char field.

REPLACE ALL OCCURRENCES OF ',' IN CHAR WITH space.
CONDENSE CHAR NO-GAPS.

If you amount field and want to move to char field..

Char = amount. " The char field will not have the thousand seprators

Read only

Former Member
0 Likes
1,032

Hello,

You can use the translate statement to do this.

w_abc = 12,000,000.00.

translate w_abc using ', '.

Condense w_abc no-gaps.

Thanks,

Sowmya

Read only

Former Member
0 Likes
1,032

hi:

do like this

data amt type n

write amount to amt.

it would remove commas.

Regards

Shashi

Read only

Former Member
0 Likes
1,032

Hi,

Use the NO-GROUPING Write add on functionality.

Please check the below code.

data: num1(12) type P decimals 2 value '1200000.00',

num2(12) .

write : / 'num1',num1.

write num1 to num2 no-grouping.

write: /'num2',num2.

Hope this will help you..

Regards,

Smart Varghese

Read only

Former Member
0 Likes
1,032

Hi,

Please follow the bellow procedure to replace comma from amount.

data: l_amount(16) type c.

move amount to l_amount.

REPLACE ALL OCCURRENCES OF ',' IN l_amount with '''.

Read only

Former Member
0 Likes
1,032

Hi,

Comma in 12,000,000.00 is a user default seperator.

Get this user default seperator using FM CLSE_SELECT_USR01 and then replace this seperator with space and then use condence for variable.

Define Amt as char field and amount to amt field.


  call function 'CLSE_SELECT_USR01'
       exporting
            username     = sy-uname
       importing
            decimal_sign = gv_dec_sep
            separator    = gv_tho_sep
            date_format  = gv_date_format.
REPLACE ALL OCCURRENCES OF gv_tho_sep IN Amt with space.
condence Amt.

Regards,

Raju.

Read only

SujeetMishra
Active Contributor
0 Likes
1,032

Hello,

Use NO-GROUPING.

Regards,

Sujeet