<?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 Re: Passing Internal table structure to EXCEL in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987438#M1161894</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vishal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is your requirement? Do you need column heading in addition to the records in the excelsheet?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can add a column heading to the excel sheet through the FM 'GUI_DOWNLOAD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 TYPES:  BEGIN OF ty_xlhead,
         fld TYPE char40,         "For header name
         END OF ty_xlhead.

*1. Posting date
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-029.     "Înreg datu0103
  APPEND l_wa_xlhead TO fp_it_xlhead.

*2. Document type
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-030.     "Document tip
  APPEND l_wa_xlhead TO fp_it_xlhead.

*3. Document number
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-031.     "Document Nr
  APPEND l_wa_xlhead TO fp_it_xlhead.

*4. Document date
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-032.     "Document datu0103
  APPEND l_wa_xlhead TO fp_it_xlhead.

*5. Header text
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-018.     "Explicau0163ie
  APPEND l_wa_xlhead TO fp_it_xlhead.

*6. Account debit
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-033.     "Simbol cont Debitor
  APPEND l_wa_xlhead TO fp_it_xlhead.

*7. Credit account
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-034.     "Simbol cont Creditor
  APPEND l_wa_xlhead TO fp_it_xlhead.

*8. Debit amount
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-035.     " Sume Debitoare
  APPEND l_wa_xlhead TO fp_it_xlhead.

*9. Credit amount
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-036.     " Sume Creditoare
  APPEND l_wa_xlhead TO fp_it_xlhead.


      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = l_v_filename
          write_field_separator   = l_c_x
          dat_mode                = l_c_x
          confirm_overwrite       = l_c_x
        TABLES
          data_tab                = l_it_excel
          fieldnames              = fp_it_xlhead  "--&amp;gt; Excel Header
        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.
      IF sy-subrc &amp;lt;&amp;gt; 0.
        MESSAGE i004.
*   File Download Failed
      ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this what you need?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Jan 2009 13:08:06 GMT</pubDate>
    <dc:creator>SuhaSaha</dc:creator>
    <dc:date>2009-01-05T13:08:06Z</dc:date>
    <item>
      <title>Passing Internal table structure to EXCEL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987435#M1161891</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;I want to pass the structure of internal table to EXCEL, not the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In other words, my requirement is to make an EXCEL sheet with several columns, which would be the fields of internal table. The order of all the columns should also be the same as the fields appear in Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any standard FMs or something, by which I can do the same. Waiting for your reply. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vishal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 12:57:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987435#M1161891</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T12:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Internal table structure to EXCEL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987436#M1161892</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 function module FILE_READ_AND_CONVERT_SAP_DATA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pass XLS to I_FILEFORMAT&lt;/P&gt;&lt;P&gt;pass  PRS to i_servertyp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aakash Banga&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 13:02:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987436#M1161892</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T13:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Internal table structure to EXCEL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987437#M1161893</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;You just try this.hope it is useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When we try to upload excel  files with macros to an internal table,&lt;/P&gt;&lt;P&gt;using FMs like ALSM_EXCEL_TO_INTERNAL_TABLE and KCD_EXCEL_OLE_TO_INT_CONVERT,&lt;/P&gt;&lt;P&gt;while executing the program it gives a popup to save that excel file , this blog explains to disable that popup &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anki Reddy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 13:06:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987437#M1161893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T13:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Internal table structure to EXCEL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987438#M1161894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vishal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is your requirement? Do you need column heading in addition to the records in the excelsheet?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can add a column heading to the excel sheet through the FM 'GUI_DOWNLOAD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 TYPES:  BEGIN OF ty_xlhead,
         fld TYPE char40,         "For header name
         END OF ty_xlhead.

*1. Posting date
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-029.     "Înreg datu0103
  APPEND l_wa_xlhead TO fp_it_xlhead.

*2. Document type
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-030.     "Document tip
  APPEND l_wa_xlhead TO fp_it_xlhead.

*3. Document number
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-031.     "Document Nr
  APPEND l_wa_xlhead TO fp_it_xlhead.

*4. Document date
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-032.     "Document datu0103
  APPEND l_wa_xlhead TO fp_it_xlhead.

*5. Header text
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-018.     "Explicau0163ie
  APPEND l_wa_xlhead TO fp_it_xlhead.

*6. Account debit
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-033.     "Simbol cont Debitor
  APPEND l_wa_xlhead TO fp_it_xlhead.

*7. Credit account
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-034.     "Simbol cont Creditor
  APPEND l_wa_xlhead TO fp_it_xlhead.

*8. Debit amount
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-035.     " Sume Debitoare
  APPEND l_wa_xlhead TO fp_it_xlhead.

*9. Credit amount
  CLEAR l_wa_xlhead.
  l_wa_xlhead-fld  = text-036.     " Sume Creditoare
  APPEND l_wa_xlhead TO fp_it_xlhead.


      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = l_v_filename
          write_field_separator   = l_c_x
          dat_mode                = l_c_x
          confirm_overwrite       = l_c_x
        TABLES
          data_tab                = l_it_excel
          fieldnames              = fp_it_xlhead  "--&amp;gt; Excel Header
        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.
      IF sy-subrc &amp;lt;&amp;gt; 0.
        MESSAGE i004.
*   File Download Failed
      ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this what you need?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 13:08:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987438#M1161894</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-01-05T13:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Internal table structure to EXCEL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987439#M1161895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want pass the Internal table fields (Not its records) to EXCEL. Not the records of Internal table, but just the structure of the Internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 13:11:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987439#M1161895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T13:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Internal table structure to EXCEL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987440#M1161896</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;I supose that you know how to save to EXCEL file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop your itab using field-symbol and use the DESCRIBE statement to get the field of itab. Then, you append it in other itab and create the EXCEL from this new itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 13:14:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987440#M1161896</guid>
      <dc:creator>rodrigo_paisante3</dc:creator>
      <dc:date>2009-01-05T13:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Internal table structure to EXCEL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987441#M1161897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vishal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know the internal table structure or is it a dynamic table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 13:18:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987441#M1161897</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-01-05T13:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Internal table structure to EXCEL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987442#M1161898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vishal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know the internal table structure or is the table dynamic?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 13:20:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987442#M1161898</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-01-05T13:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Internal table structure to EXCEL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987443#M1161899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In GUI_DOWNLOAD,  Pass the below parameters. But Here, you need to pass the dummy internal table which is empty to DATA_TAB parameter.&lt;/P&gt;&lt;P&gt;I hope you can reach your requirement.&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;P&gt; TABLES&lt;/P&gt;&lt;P&gt;          data_tab                = dummy_tab&lt;/P&gt;&lt;P&gt;          fieldnames              = it_header  "--&amp;gt; Excel Header&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sandeep Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 13:31:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-internal-table-structure-to-excel/m-p/4987443#M1161899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T13:31:56Z</dc:date>
    </item>
  </channel>
</rss>

