2006 Feb 07 9:57 AM
Hi,
How can we transfer data to unix with tab-delimited? I have incoming file with tab-delimited and want to copy as backup file in another folder in unix. When I read the incoming file, tab separator is translated into '#' so when I do transfer data to the backup folder, the file contains '#'.
Is there a way to transfer data in tab-delimited?
thank you
alia
2006 Feb 07 9:59 AM
try to use delimiter cl_abap_char_utilities=>HORIZONTAL_TAB.
here is a piece of code:
REPORT ztestfile .
DATA: BEGIN OF gt_file_out OCCURS 0,
filed(2000),
END OF gt_file_out.
START-OF-SELECTION.
DATA: lv_file_out LIKE filename-fileextern.
CONCATENATE 'Hello' 'World' INTO gt_file_out SEPARATED
BY cl_abap_char_utilities=>horizontal_tab.
APPEND gt_file_out.
lv_file_out = '
XXXX\XXXX\mytest1.txt'.
OPEN DATASET lv_file_out FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT gt_file_out.
TRANSFER gt_file_out TO lv_file_out.
ENDLOOP.
CLOSE DATASET lv_file_out.
Message was edited by: joseph fryda
2006 Feb 07 10:09 AM
Hi,
You can read the file using fieldname+offset(length) eg.
mara-matnr+0(18).
Inorder to transfer the data in tab delimited form to Unix , you can use the following :
open dataset l_file .....
Concatenate itab-matnr
itab-matkx
into l_file
separated by cl_abap_char_utilities=>horizontal_tab.
tranfer l_file .....
close dataset....
Best regards,
Prashant
2006 Feb 07 11:21 AM
If you found some information helpfull please reward point and close the topic