‎2019 Jun 11 1:58 PM
Hi Experts,
I have a requirement where i need to convert the data from internal table into csv format with tab delimiter and save it in application server. The issue is i cannot use comma as the decimal format used is comma.when i use comma as the delimiter and download the file in .csv format using tcode CG3Y,it is working fine but the quantity field is impacted due to decimal notation. I have tried using FM SAP_CONVERT_TO_CSV_FORMAT but it is not helping.
Can you please help me with a solution where the data is converted into csv format and when downloaded from application server through CG3Y in csv format each data should be displayed in each column.
Thanks in advance.
‎2019 Jun 12 8:03 AM
‎2019 Jun 11 2:20 PM
‎2019 Jun 12 7:59 AM
Hi,
Tab delimeter(cl_abap_char_utilities=>horizontal_tab) works fine for xls but not for csv or xlsx. Semi-colon is not helping either.
Thanks and Regards,
‎2019 Jun 12 8:02 AM
In what way is it not working? Tab delimited is a valid XLSX format - reading and writing.
‎2019 Jun 12 1:38 PM
Hi,
With tab delimiter while opening the file i am getting "Excel cannot open the file because the file format or file extension is not valid".
Thanks and Regards
‎2019 Jun 11 2:40 PM
Hi,
you can use i_field_seperator = ';' or '|' any seperate what you need.
CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
EXPORTING
i_field_seperator = ';'
TABLES
i_tab_sap_data = itab
CHANGING
i_tab_converted_data = itab1
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.
‎2019 Jun 12 7:57 AM
Hi,
I have tried this but neither its working with ;' nor '|'.
Thanks and Regards.
‎2019 Jun 12 8:03 AM