DATA: lt_headers TYPE TABLE OF char100, lv_header TYPE char100. " 1. Prepare Header Data lv_header = 'Customer Number'. APPEND lv_header TO lt_headers. lv_header = 'Customer Name'. APPEND lv_header TO lt_headers. lv_header = 'City'. APPEND lv_header TO lt_headers. " 2. Download to Excel (via ASC file type with separator) CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING filename = 'C:\temp\customers.xls' filetype = 'ASC' write_field_separator = 'X' TABLES data_tab = lt_customer_data fieldnames = lt_headers EXCEPTIONS OTHERS = 22. Use code with caution. Method 2: Sequential Downloading (Appending)
Create a standard table with a single character or string field to hold your column titles. sap abap gui_download excel with header
If your internal table contains numeric or quantity fields (like QUAN or CURR ), you cannot simply insert a "string" header as the first row because of type mismatches. In this case, you can perform two separate downloads to the same file. Headers for excel file through GUI_DOWNLOAD - SAP Community DATA: lt_headers TYPE TABLE OF char100, lv_header TYPE