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

formating problem

Former Member
0 Likes
439

Hi All,

I have a char field with content 1,000.00 and I need to convert into 1000.00 format.

Any help in accomplishing the task with minimal code is appreciated.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
414

Execute this code.

data: i_amt(10).   "<<CHAR field

TYPES: BEGIN OF ITAB_TYPE,
        WORD(20),
      END   OF ITAB_TYPE.

data: wa_itab type itab_type.

DATA: ITAB TYPE STANDARD TABLE OF ITAB_TYPE WITH
                NON-UNIQUE DEFAULT KEY INITIAL SIZE 5.

SPLIT '10,000.00' AT ',' INTO TABLE ITAB.


loop at itab into wa_itab..
*write: / wa_itab.
concatenate i_amt wa_itab-word into i_amt.
endloop.

write: / i_amt.

2 REPLIES 2
Read only

Former Member
0 Likes
415

Execute this code.

data: i_amt(10).   "<<CHAR field

TYPES: BEGIN OF ITAB_TYPE,
        WORD(20),
      END   OF ITAB_TYPE.

data: wa_itab type itab_type.

DATA: ITAB TYPE STANDARD TABLE OF ITAB_TYPE WITH
                NON-UNIQUE DEFAULT KEY INITIAL SIZE 5.

SPLIT '10,000.00' AT ',' INTO TABLE ITAB.


loop at itab into wa_itab..
*write: / wa_itab.
concatenate i_amt wa_itab-word into i_amt.
endloop.

write: / i_amt.

Read only

former_member191735
Active Contributor
0 Likes
414

DATA: t_char(10) TYPE c VALUE '1,000.00'.

data: t_char2(10) type c.

t_char2 = t_char.

replace all occurrences of ',' in t_char2 with ''.

write:/ t_char2.

WRITE:/ t_char.