Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

CSV file withe headings

Former Member
0 Kudos

Hi All,

I have an internal table which converts the data into the CSV format and again pass this data table through the FM GUI_DOWNLOAD to display the data with the headings. But am not able to display the headings(I think .CSV file format

doesn't work to display along with the headings). Please suggest me the possible solution.

Thank you.

Regards,

Padmasri.

2 REPLIES 2

Former Member
0 Kudos

Hello,

Are you passing the column headings to the tables parameter FIELDNAMES in GUI_DOWNLOAD?

Vikranth

0 Kudos

Hi Vikrant,

tb_final1[] = tb_final[].

CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'

EXPORTING

i_field_seperator = ','

TABLES

i_tab_sap_data = tb_header

CHANGING

i_tab_converted_data = tb_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.

    • IF tb_data[] IS NOT INITIAL.

IF tb_final[] IS NOT INITIAL.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = 'C:\TEMP.CSV' "c_filename

filetype = 'ASC'

write_field_separator = ','

confirm_overwrite = 'X'

TABLES

data_tab = tb_final

fieldnames = tb_header "Headings

Thank you.

Regards,

Padmasri