2009 Dec 10 8:24 PM
Following is my peice of code. Can someone tell me what parameter should i pass in field-separator so that my file downloaded wil be a tab delimited file.
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
i_field_seperator = 't'
TABLES
i_tab_sap_data = i_final
CHANGING
i_tab_converted_data = i_csvtab
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*--Download the SAP Converted file to the filepath specified.
filename = p_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = filename
filetype = 'ASC'
write_field_separator = ' '
TABLES
data_tab = i_csvtab
EXCEPTIONS
OTHERS = 1.
if sy-subrc = 0.
write: 'File downloaded successfuly to the location', filename, '.'.
endif.
clear: filename, i_csvtab.
2009 Dec 10 9:34 PM
don't use 'SAP_CONVERT_TO_TEX_FORMAT' just use gui_download with write_field_separator = 'X'. The file will be tab delimited
Following is my peice of code. Can someone tell me what parameter should i pass in field-separator so that my file downloaded wil be a tab delimited file.
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
i_field_seperator = 't'
TABLES
i_tab_sap_data = i_final
CHANGING
i_tab_converted_data = i_csvtab
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*--Download the SAP Converted file to the filepath specified.
filename = p_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = filename
filetype = 'ASC'
write_field_separator = ' '
TABLES
data_tab = i_csvtab
EXCEPTIONS
OTHERS = 1.
if sy-subrc = 0.
write: 'File downloaded successfuly to the location', filename, '.'.
endif.
clear: filename, i_csvtab.
2009 Dec 10 9:19 PM
Can you tell what that function module is doing?
You are probably going to have to define a variable as type hex with a value that is equal to the hex value of the TAB (maybe like '09') and pass that through the function module (may have to move it through a character(1) type field as well.
Cheers
John
2009 Dec 10 9:34 PM
don't use 'SAP_CONVERT_TO_TEX_FORMAT' just use gui_download with write_field_separator = 'X'. The file will be tab delimited
2015 Oct 26 12:11 PM
Hi,
I've had the same problem, I've needed to convert a SAP table into a file but before every data and import fields should be translated in output format.
I've used SAP_CONVERT_TO_TEX_FORMAT and after GUI_DOWNLOAD and the tabulators were perfect.
the right code is attacched.