01-09-2006 3:05 AM
<i>Hi,
I'm Creating a file in app. server using "open dataset" statment and populating the file using Transfer stmt.
I like to store the data fields with comma delimiter, since it normally fixed length.
Please let me know Any method available.
Thank You,
Senthil</i>
01-09-2006 3:10 AM
No problem, just concatenate all your fields into one field separated by a comma. Then transfer that field only.
data: your_dataset type localfile default '/usr/sap/TST/SYS/Data1.txt'.
data: output type string.
open dataset your_dataset for output in text mode.
loop at itab.
concatenate itab-fld1
itab-fld2
itab-fld3
into output separated by ','.
transfer output to your_dataset.
endloop.
close dataset your_dataset.
REgards,
Rich Heilman
01-09-2006 3:13 AM
Senthil,
Use the OPEN DATASET to open the file.
Use the statement TRANSFER record to filename to write to the file.
You will have to take care of addding the delimiter wherever you want. So, if you have a internal table with some fields, you will have to concatenate those fields manually separating them with , and then TRANSFER.
REgards,
Ravi