Skip to Content
0
Former Member
Jun 16, 2009 at 07:08 PM

Transfer command with Tab delimitation

19 Views

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.