<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Adding header to xls file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-xls-file/m-p/932630#M61207</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iam downloading data from sap tables to appln server.&lt;/P&gt;&lt;P&gt;its working perfectly.But I want to add the field names also to the file header.&lt;/P&gt;&lt;P&gt;Please help me regarding this matter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;sai chand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Aug 2005 07:11:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-08-09T07:11:40Z</dc:date>
    <item>
      <title>Adding header to xls file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-xls-file/m-p/932630#M61207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iam downloading data from sap tables to appln server.&lt;/P&gt;&lt;P&gt;its working perfectly.But I want to add the field names also to the file header.&lt;/P&gt;&lt;P&gt;Please help me regarding this matter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;sai chand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2005 07:11:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-xls-file/m-p/932630#M61207</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-09T07:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Adding header to xls file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-xls-file/m-p/932631#M61208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chk these links:&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="391610"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="589065"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anjali&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2005 07:23:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-xls-file/m-p/932631#M61208</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-09T07:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Adding header to xls file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-xls-file/m-p/932632#M61209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this sample code.&lt;/P&gt;&lt;P&gt;DATA lv_file TYPE string.&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF ty_download,&lt;/P&gt;&lt;P&gt;        werks(5)    TYPE c,    "Plant&lt;/P&gt;&lt;P&gt;        matnr(18)   TYPE c,    "Product number&lt;/P&gt;&lt;P&gt;END OF ty_download.&lt;/P&gt;&lt;P&gt;data : i_download   TYPE STANDARD TABLE OF ty_download,&lt;/P&gt;&lt;P&gt;       w_download     TYPE ty_download.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_file = p_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CLEAR w_download.&lt;/P&gt;&lt;P&gt;  w_download-werks = 'Plant'.&lt;/P&gt;&lt;P&gt;  w_download-matnr   = 'Material'.  &lt;/P&gt;&lt;P&gt;  INSERT w_download INTO i_download INDEX 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            filename                = lv_file&lt;/P&gt;&lt;P&gt;            filetype                = 'ASC'&lt;/P&gt;&lt;P&gt;            write_field_separator   = c_x&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            data_tab                = i_download&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            file_write_error        = 1&lt;/P&gt;&lt;P&gt;            no_batch                = 2&lt;/P&gt;&lt;P&gt;            gui_refuse_filetransfer = 3&lt;/P&gt;&lt;P&gt;            invalid_type            = 4&lt;/P&gt;&lt;P&gt;            no_authority            = 5&lt;/P&gt;&lt;P&gt;            unknown_error           = 6&lt;/P&gt;&lt;P&gt;            header_not_allowed      = 7&lt;/P&gt;&lt;P&gt;            separator_not_allowed   = 8&lt;/P&gt;&lt;P&gt;            filesize_not_allowed    = 9&lt;/P&gt;&lt;P&gt;            header_too_long         = 10&lt;/P&gt;&lt;P&gt;            dp_error_create         = 11&lt;/P&gt;&lt;P&gt;            dp_error_send           = 12&lt;/P&gt;&lt;P&gt;            dp_error_write          = 13&lt;/P&gt;&lt;P&gt;            unknown_dp_error        = 14&lt;/P&gt;&lt;P&gt;            access_denied           = 15&lt;/P&gt;&lt;P&gt;            dp_out_of_memory        = 16&lt;/P&gt;&lt;P&gt;            disk_full               = 17&lt;/P&gt;&lt;P&gt;            dp_timeout              = 18&lt;/P&gt;&lt;P&gt;            file_not_found          = 19&lt;/P&gt;&lt;P&gt;            dataprovider_exception  = 20&lt;/P&gt;&lt;P&gt;            control_flush_error     = 21&lt;/P&gt;&lt;P&gt;            OTHERS                  = 22.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is useful,kindly reward points by clicking the star on the left side of the reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2005 07:23:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-xls-file/m-p/932632#M61209</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-08-09T07:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Adding header to xls file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-xls-file/m-p/932633#M61210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this (dynamic: for internal tables with many fields)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before appending your itab to down_load_tab:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; descr_ref ?= cl_abap_typedescr=&amp;gt;describe_by_data( my_data ).

  LOOP AT descr_ref-&amp;gt;components ASSIGNING &amp;lt;comp_wa&amp;gt;.
    CONCATENATE header &amp;lt;comp_wa&amp;gt;-name ';' INTO header.
  ENDLOOP.

  append header to down_tab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2005 07:45:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-xls-file/m-p/932633#M61210</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2005-08-09T07:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Adding header to xls file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-xls-file/m-p/932634#M61211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;While downloading file, u wont get the header part, u have to append the header part before the data. Then u pass the final output table with header to the function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So that it will read the first line that will be header and then remaning data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can create an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: begin of ty_itab ,  
name(4) TYPE c,  
sex(3)  Type c, 
end of ty_itab.
DATA: i_itab type standard table of ty_itab, 
     w_itab type ty_itab.

Then do as below. 
w_itab-name = 'NAME'. 
w_itab-sex  = 'SEX'. 
APPEND w_itab to i_output_final. 
i_output[] = i_output_final. 
APPEND i_output_final.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now pass this final table to the functionmodule, so it is now with header.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2005 09:13:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-xls-file/m-p/932634#M61211</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-09T09:13:29Z</dc:date>
    </item>
  </channel>
</rss>

