08-24-2004 10:23 AM
Hi,
Can anybody tell me how to create tab delimited file using ABAP. I am using 4.6C ( so I cant use cl_gui_char_utilities ) and I want to download the file to application server ( GUI_DOWNLOAD cant be used ).
Thanks,
Sameej
08-24-2004 10:50 AM
Hi Sameej
Look at SAPHelp about <b>"OPEN DATASET"</b> and <b>"CLOSE DATASET"</b> statements for downloading files to the application server. To download to presentation layer you can use <b>"WS_DOWNLOAD"</b> at 4.6C.
The FM <b>"C13Z_FILE_UPLOAD_BINARY"</b> and <b>"C13Z_FILE_DOWNLOAD_BINARY"</b> can also be used if you have them.
*--Serdar
08-24-2004 7:04 PM
What I am looking forward is to separate the fields by TAB-DELIMITER.
08-24-2004 11:03 AM
Hi,
-> here's an example to separate the fields by tab:
DATA: BEGIN OF tabulator,
x(1) TYPE x VALUE '09',
END OF tabulator.
data tabilator_c.
...
CALL FUNCTION 'SYSTEM_CODEPAGE'
IMPORTING
codepage = c_to.
tabulator_c = tabulator.
TRANSLATE tabulator_c FROM CODE PAGE c_from TO CODE PAGE c_to.
...
*for int. table
loop at itab.
...
clear string.
do.
assign component sy-index of structure itab to <f>.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
concatenate string <f> tabulator_c into string.
enddo.
append string to tab_download.
...
endloop.
...
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILETYPE = 'ASC'
FILENAME = FILE
TABLES
DATA_TAB = tab_download.
Grx Andreas
08-24-2004 8:07 PM
Hi Sameet,
I think Andreas has given you some good info. In short basically you need to do this.
data: lv_tabfield(1) type x value '09',
lv_str(80).
....
open dataset lv_filename for output in text mode.
concatenate field1 field2 field2 into lv_str separated by
lv_tabfield.
transfer lv_str to lv_filename.
close dataset lv_filename.
08-25-2004 4:53 AM