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: 

Download to .CSV file.

Former Member
0 Kudos

Hi,

I am downloading an internal table into .CSV format.

In my internal table i have currency field which is having values EX: 4,900.00

While converting to .CSV i am removing ',' EX: 4900.00

But my problem is after removing the ',' it is not condensing with no-gaps. there is a space which i have to remove it.

EX: 4 900.00

can any one suggest me.

Thanks in advance.

Deepak.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi

do u want to convert internal table to CVS or only one value.

8 REPLIES 8

anversha_s
Active Contributor
0 Kudos

hi,

1) move that currency value to Char

2) Use condense on the char value.

eg:

data: l_amnt(100) type c.

l_amnt = Curr_value..

replace all occurrences of ',' in l_amnt with space.

CONDENSE l_amnt NO-GAPS.

write l_amnt.

Regards

Anver

0 Kudos

use a character field instead of the type curr field..it wil not have any issues then..

Former Member
0 Kudos
Have u tried  using this FM SAP_CONVERT_TO_CSV_FORMAT

or
data : v_curr(20).

loop at itab.
v_curr = itab-curr.
 replace all occurrences of ',' in v_curr with space.
condense v_curr.
itab-curr = v_curr.
mdify itab transaporting curr index sy-tabix.
endloop.

Message was edited by:

Chandrasekhar Jagarlamudi

0 Kudos

Hi,

I am getting an error with REPLACE statement.

data v_amnt(25) type c.

v_amnt = d_out_it-wrbtr.

replace all occurrences of ',' in v_amnt with space.

condense v_amnt.

d_out_it-wrbtr = v_amnt.

ERROR "occurrences of ',' in v_amnt" is not expected.

Thanks,

Deepak.

Message was edited by:

KDeepak

0 Kudos

all occurrences is not working in 4.6c , try

REPLACE   ',' WITH SPACE INTO V_CHAR .

0 Kudos

Hi,

REPLACE ',' it is not working. Throughing error.

Is there any alternative.

Or any example code on this.

Thanks in advance.

Deepak.

0 Kudos

hi,

try this.

REPLACE ',' WITH ' ' INTO v_amnt.

rgds

Anver

Former Member
0 Kudos

hi

do u want to convert internal table to CVS or only one value.