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

Comma separated format is required

Former Member
0 Likes
685

Hi all

this is the code which i have written:

OPEN DATASET g_ufile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT t_file WHERE werks = t_file1-werks.

MOVE : gc_kaganplntcode TO t_file-fieldname1,

gc_productcode TO t_file-fieldname2,

gc_qtyavailable TO t_file-fieldname3.

CONCATENATE t_file-fieldname1

t_file-fieldname2

t_file-fieldname3

INTO gv_itemdet1 separated by ','.

ENDLOOP.

transfer gv_itemdet1 to g_ufile.

loop at t_file into t_file1.

condense t_file1 no-gaps.

transfer t_file1 to g_ufile.

append t_file1.

clear t_file1.

clear gv_itemdet.

endloop.

in t_file1 data is coming in continous manner. i need to have comma separated data. ie each field shud be separated by ','.

can anybody tell me logic for it.

very urgent.

regrd

Mona

Edited by: Alvaro Tejada Galindo on Apr 14, 2008 1:03 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
656

loop at t_file into t_file1.

condense t_file1 no-gaps.

transfer t_file1 to g_ufile.

append t_file1.

this is loop is for item details which I need to be comma separated format.

Regrds

Mona

5 REPLIES 5
Read only

Former Member
0 Likes
656

Need to move the TRANSFER inside the first loop.


LOOP AT t_file WHERE werks = t_file1-werks.

MOVE : gc_kaganplntcode TO t_file-fieldname1,
gc_productcode TO t_file-fieldname2,
gc_qtyavailable TO t_file-fieldname3.

CONCATENATE t_file-fieldname1
t_file-fieldname2
t_file-fieldname3
INTO gv_itemdet1 separated by ','.

transfer gv_itemdet1 to g_ufile.

ENDLOOP.

Read only

Former Member
0 Likes
656

Wich loop, this one?


loop at t_file into t_file1.
condense t_file1 no-gaps.

transfer t_file1 to g_ufile.

append t_file1.
clear t_file1.
clear gv_itemdet.

endloop.

Read only

Former Member
0 Likes
656

Hi all

loop at t_file into t_file1.

condense t_file1 no-gaps.

transfer t_file1 to g_ufile.

append t_file1.

In t_file1 continuous data is coming, what can I do to make it comma separated.

Plz help

very urgent.

Regrds

Mona

Read only

Former Member
0 Likes
657

loop at t_file into t_file1.

condense t_file1 no-gaps.

transfer t_file1 to g_ufile.

append t_file1.

this is loop is for item details which I need to be comma separated format.

Regrds

Mona

Read only

0 Likes
656

Try it this way mona

Declare a fiel-symbol type any and an string to tranfer the contents.


loop at t_file into t_file1.
clear string.
condense t_file1 no-gaps.
do.
assign component sy-index of structure t_file1 to <fs>.
if sy-subrc ne 0.
exit.
endif.
concatenate string <fs> ',' into string.
enddo.

transfer string to g_ufile.

append t_file1.
clear t_file1.
clear gv_itemdet.

endloop.