10-13-2005 2:32 PM
hai
how do we downlaod a file in the background into excel file , where when downloaded each internal tables field should be written into different columns. where as my output is writing all the fields in the same column
cheers
10-13-2005 2:34 PM
10-13-2005 2:34 PM
10-13-2005 2:41 PM
hai
thanks for replying.
how to make a file as coma delimited can you give me the syntax pls.
10-13-2005 2:54 PM
Sure...
report zrich_0002.
data: begin of itab occurs 0,
fld1(10) type c,
fld2(10) type c,
fld3(10) type c,
fld4(10) type c,
end of itab.
data: output(1000) type c.
parameters: d1 type localfile default '/usr/sap/TST/SYS/Data1.txt'.
start-of-selection.
open dataset d1 for output in text mode.
loop at itab.
concatenate itab-fld1
itab-fld2
itab-fld3
itab-fld4
into output
separated by ','.
transfer output to d1.
endloop.
close dataset d1.
Please remember to award points for helpful answers. Thanks.
Regards,
Rich Heilman
10-13-2005 3:05 PM
hai rich,
still it is not coming in the seperated coulmn but the output is getting printed along with comma in the same column
thanks
10-13-2005 3:08 PM
10-13-2005 3:09 PM
Now it is a matter of opening excel, click file-->open, select "all files" for file types, look for your txt file, click it. You should get a dialog where it wants to know how you want to break the columns up. You should check the box for comma delimited.
Or it may work if you change the file extension to .csv
Regards,
Rich Heilman
10-13-2005 2:58 PM
Hi Kumar,
try:
open dataset...
LOOP AT itab INTO wa.
CLEAR: str, exp.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE wa TO <f>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
MOVE <f> TO str.
CONCATENATE exp str ';' INTO exp .
ENDDO.
TRANSFER exp TO file.
ENDLOOP.
close dataset...
Andreas
07-04-2006 8:30 PM
Hi guys every thing is working fine but program is not excuting in background. I m using minisap.
Thnx