Application Development and Automation 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: 
Read only

Transfer command with Tab delimitation

Former Member
0 Likes
553

Hello,

I want to download a tab delimited text file to application server using Transfer method.

I have below code but I cannot concatenate tabchar which is of Type X with other data.

What would be the alternative.?? I want to add 'tabchar' field in the file below? Is it possible?


DATA: lv_temp TYPE string.
DATA: tabchar type X value '09'.
FIELD-SYMBOLS: <fs_field> TYPE ANY.

* Download this internal table into a flat file at app.server.
IF NOT gt_documents2[] IS INITIAL.

*--Open file in application sever
   OPEN DATASET p_afile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
   IF sy-subrc IS NOT INITIAL.
**--Display Error message 'File path/name does not exist in application
**  server'
    MESSAGE e999 WITH text-e01.
  ELSE.

LOOP AT gt_documents2.
  CLEAR lv_temp.
  DO.
    ASSIGN COMPONENT sy-index OF STRUCTURE gt_documents2 TO <fs_field>.
    IF sy-subrc NE 0. EXIT. ENDIF.
    CONCATENATE lv_temp <fs_field> INTO lv_temp.
  ENDDO.
  TRANSFER lv_temp TO p_afile.
ENDLOOP.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
475

Hi Rupali,

You can use the concatenate command with the addition of separated by statement.

concatenate x1 x2 into x3 separated by cl_abap_char_utilities=>horizontal_tab.

Char utilities is a SAP given class.

Regards,

Ravi G

Hi Rupali,

You can use the concatenate command with the addition of separated by statement.

concatenate x1 x2 into x3 separated by cl_abap_char_utilities=>horizontal_tab.

Char utilities is a SAP given class.

Regards,

Ravi G

1 REPLY 1
Read only

Former Member
0 Likes
476

Hi Rupali,

You can use the concatenate command with the addition of separated by statement.

concatenate x1 x2 into x3 separated by cl_abap_char_utilities=>horizontal_tab.

Char utilities is a SAP given class.

Regards,

Ravi G