2009 Jun 16 8:08 PM
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.
2009 Jun 16 9:11 PM
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
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.
2009 Jun 16 9:11 PM
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
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |