2009 Aug 18 8:44 AM
Hi,
I need to download the file in .CSV format.
I hade used FM SAP_CONVERT_TO_CSV_FORMAT and then used GUI_Download.
Now when I am opening file which is downloaded, it gives all the data in a single column. If there are 5 fields in my table, the generated file gives the data of all the 5 fields in a single column.
Could you please help?
2009 Aug 18 9:03 AM
Hi,
In GUI_DOWNLOAD function module, along with other parameters put WRITE_FIELD_SEPARATOR = 'X'.
Hope it helps
Hi,
In GUI_DOWNLOAD function module, along with other parameters put WRITE_FIELD_SEPARATOR = 'X'.
Hope it helps
2009 Aug 18 8:47 AM
Hi,
After you ahve open it save ti again as a CSV format and then try to open it basically when you create a CSV file all the fields values would be in one row separated by comma try saving as CSv format and then check.
Regards,
Himanshu
2009 Aug 18 9:03 AM
Hi,
In GUI_DOWNLOAD function module, along with other parameters put WRITE_FIELD_SEPARATOR = 'X'.
Hope it helps
2009 Aug 18 9:46 AM
2009 Aug 18 9:55 AM
Hi,
Check if you are using ';' as the field seperator in the FM SAP_CONVERT_TO_CSV_FORMAT.
If you want the Tab delimited file then call GUI_DOWNLOAD with FILETYPE as 'DAT' and WRITE_FIELD_SEPARATOR as 'X'.
Regards,
Vik
2009 Aug 18 10:05 AM
Hi,
use this it will help...
data: i_tab_converted_data TYPE truxs_t_text_data.
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
i_field_seperator = ','
* I_LINE_HEADER =
* I_FILENAME =
* I_APPL_KEEP = ' '
TABLES
i_tab_sap_data = <ur internal table>
CHANGING
i_tab_converted_data = i_tab_converted_data
EXCEPTIONS
conversion_failed = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
2009 Aug 18 11:38 AM
2009 Aug 19 7:11 AM
Hi Shweta,
Thanks for your help.
I was having the issue while downloading. the link u have given here is for uploading .CSV file.
2009 Aug 19 8:15 AM
Hi try wi th the following code.
TYPE-POOLS : truxs.
DATA: t_file TYPE STANDARD TABLE OF type_file.
data:t_conv_data TYPE truxs_t_text_data.
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
i_field_seperator = ', '
TABLES
i_tab_sap_data = t_file
CHANGING
i_tab_converted_data = t_conv_data
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\TESTCSV.CSV'
filetype = 'ASC'
write_field_separator = ' '
TABLES
data_tab = t_file
fieldnames = names
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
2009 Aug 19 8:19 AM
Hi please try with the following code.
TYPE-POOLS : truxs.
DATA: t_file TYPE STANDARD TABLE OF type_file.
data:t_conv_data TYPE truxs_t_text_data.
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
i_field_seperator = ','
TABLES
i_tab_sap_data = t_file
CHANGING
i_tab_converted_data = t_conv_data
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\TESTCSV.CSV'
filetype = 'ASC'
write_field_separator = ' '
TABLES
data_tab = t_conv_data
fieldnames = names
EXCEPTIONS
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |