‎2008 Apr 14 3:17 PM
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
‎2008 Apr 14 3:35 PM
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
‎2008 Apr 14 3:23 PM
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.
‎2008 Apr 14 3:24 PM
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.
‎2008 Apr 14 3:32 PM
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
‎2008 Apr 14 3:35 PM
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
‎2008 Apr 14 3:43 PM
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.