Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer data in unix with tab-delimited

Former Member
0 Kudos
279

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

3 REPLIES 3

Former Member
0 Kudos
78

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

former_member223537
Active Contributor
0 Kudos
78

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

Former Member
0 Kudos
78

If you found some information helpfull please reward point and close the topic