<?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: Reg: Dynamic Internal table creation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-dynamic-internal-table-creation/m-p/5712532#M1296796</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 way..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                = l_fullpath
      filetype                =  'DAT'
*      DAT_MODE                = 'X'
    TABLES
      data_tab                = &amp;lt;FT_FINAL&amp;gt;   "&amp;gt;&amp;gt; Dynamic Internal table for Data
     fieldnames              = &amp;lt;FT_FIELDNAME&amp;gt; " &amp;gt;&amp;gt; Dynamic Internal table for field headers
    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.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 May 2009 13:22:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-25T13:22:40Z</dc:date>
    <item>
      <title>Reg: Dynamic Internal table creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-dynamic-internal-table-creation/m-p/5712531#M1296795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
Hi All,

I am having data in one internal table like this..

MANDT
CARRID
CONNID
FLDATE
PRICE
CURRENCY

Now I need to download these into an excel file like ..

|  MANDT  |  CARRID |  CONNID  |  FLDATE  |  PRICE  |  CURRENCY  |

Please suggest me how I can do this..

Please note that the fields I mentioned in the first internal table will be changing dynamically based on the user input. 

The number of fields will be changing and field names will be changing, their data types will be changing..

thanks,
Ravee..


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ravee on May 25, 2009 6:48 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 13:17:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-dynamic-internal-table-creation/m-p/5712531#M1296795</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T13:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: Dynamic Internal table creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-dynamic-internal-table-creation/m-p/5712532#M1296796</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 way..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                = l_fullpath
      filetype                =  'DAT'
*      DAT_MODE                = 'X'
    TABLES
      data_tab                = &amp;lt;FT_FINAL&amp;gt;   "&amp;gt;&amp;gt; Dynamic Internal table for Data
     fieldnames              = &amp;lt;FT_FIELDNAME&amp;gt; " &amp;gt;&amp;gt; Dynamic Internal table for field headers
    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.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 13:22:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-dynamic-internal-table-creation/m-p/5712532#M1296796</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T13:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: Dynamic Internal table creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-dynamic-internal-table-creation/m-p/5712533#M1296797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Avinash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think my way of explaining my requirement is wrong...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that we can download the data using gui_download, or the same method gui_downlaod in cl_gui_frontend_services. As I am using excel file I can also use SAP_CONVERT_TO_XLS_FORMAT...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the problem here is I have to transpose the data I have in the internal table first.That is the part where I need ur suggestion...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To explain you more clearly...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I need to convert the following format ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MANDT&lt;/P&gt;&lt;P&gt;CARRID&lt;/P&gt;&lt;P&gt;CONNID&lt;/P&gt;&lt;P&gt;FLDATE&lt;/P&gt;&lt;P&gt;PRICE&lt;/P&gt;&lt;P&gt;CURRENCY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;|  MANDT  |  CARRID  |  CONNID  |  FLDATE  |  PRICE  |  CURRENCY  |...dedicating single column for each field..with header also&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using the method &lt;STRONG&gt;create_dynamic_table&lt;/STRONG&gt; in the class &lt;STRONG&gt;cl_alv_table_create&lt;/STRONG&gt; which can create dynamic internal table...but it will not give me the component names..but creates a table of those fields..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ravee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 13:33:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-dynamic-internal-table-creation/m-p/5712533#M1296797</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T13:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: Dynamic Internal table creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-dynamic-internal-table-creation/m-p/5712534#M1296798</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 Link..http://docs.google.com/Doc?id=dfv2hmgs_5d6bcxqgp&amp;amp;hl=en&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 13:38:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-dynamic-internal-table-creation/m-p/5712534#M1296798</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T13:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: Dynamic Internal table creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-dynamic-internal-table-creation/m-p/5712535#M1296799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravee,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating dynamic internal table, you can refer to following piece of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA gv_ref TYPE REF TO data.&lt;/P&gt;&lt;P&gt;DATA gv_area TYPE REF TO data.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;fs_table&amp;gt; TYPE STANDARD TABLE,&lt;/P&gt;&lt;P&gt;               &amp;lt;fs_update&amp;gt; TYPE STANDARD TABLE,&lt;/P&gt;&lt;P&gt;               &amp;lt;fs_data&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CREATE DATA gv_ref TYPE STANDARD TABLE OF (p_table).&lt;/P&gt;&lt;P&gt;  CREATE DATA gv_area LIKE gv_ref.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ASSIGN gv_ref-&amp;gt;* TO &amp;lt;fs_table&amp;gt;.&lt;/P&gt;&lt;P&gt;  ASSIGN gv_ref-&amp;gt;* TO &amp;lt;fs_update&amp;gt;.&lt;/P&gt;&lt;P&gt;  ASSIGN gv_area-&amp;gt;* TO &amp;lt;fs_data&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, these field-symbols you can use as your internal tables and work areas.&lt;/P&gt;&lt;P&gt;P_TABLE is variable containg any database table name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gouri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2009 11:56:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-dynamic-internal-table-creation/m-p/5712535#M1296799</guid>
      <dc:creator>former_member215917</dc:creator>
      <dc:date>2009-05-26T11:56:49Z</dc:date>
    </item>
  </channel>
</rss>

