<?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: Create table like SAP Query generated structure in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-table-like-sap-query-generated-structure/m-p/10968065#M1894040</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;step 1 : get the component list using RTTI.&lt;/P&gt;&lt;P&gt;step 2: create a field catalog with the fields.&lt;/P&gt;&lt;P&gt;step 3: create a table based on the field catalog using method CREATE_DYNAMIC_TABLE of class CL_ALV_TABLE_CREATE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Apr 2015 09:56:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-04-27T09:56:47Z</dc:date>
    <item>
      <title>Create table like SAP Query generated structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-table-like-sap-query-generated-structure/m-p/10968060#M1894035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to enhance a SAP query by adding some code and i am failing to create a table to replicate the entries in the query generated table.&amp;nbsp; SAP generates a table %dtab which i found out by looking at the generated program.&amp;nbsp; Now i want to replicate the contents of that table in another table but i am failing to do so.&amp;nbsp; I have tried using the runtime type classes but i cannot seem to get it correct always getting a runtime error TYPE_NOT_FOUND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what i have tried:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;constants: lc_tab type string value '%dtab'.&lt;/P&gt;
&lt;P&gt;data: lt_data type ref to data.&lt;/P&gt;
&lt;P&gt;field-symbols: &amp;lt;lt_data&amp;gt; type any table.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;create data lt_data like (lc_tab).&lt;/P&gt;
&lt;P&gt;assign lt_data-&amp;gt;* to &amp;lt;lt_data&amp;gt;. "crashes here if FS is typed to ANY TABLE&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also tried&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lo_struc_type ?= cl_abap_tabledescr&lt;SPAN class="L0S70"&gt;=&amp;gt;describe_by_name&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;lc-tab &lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="L0S70"&gt;&lt;SPAN class="L0S55"&gt; data(lt_comp_tab) &lt;SPAN class="L0S55"&gt;= lo_struc_type&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;get_components&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="L0S70"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S55"&gt;"dump TYPE_NOT_FOUND&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is there a way i could create a replica of the table?&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;Prince Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2015 07:25:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-table-like-sap-query-generated-structure/m-p/10968060#M1894035</guid>
      <dc:creator>prince_isaac</dc:creator>
      <dc:date>2015-04-23T07:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create table like SAP Query generated structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-table-like-sap-query-generated-structure/m-p/10968061#M1894036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What exactly is your requirement? Do you want to add additional columns in query or change contents of a field? you can write your code in infoset using tcode SQ02. Click on "Extras" button and go to tab "code". you can write your code at appropriate event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mehwish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2015 08:05:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-table-like-sap-query-generated-structure/m-p/10968061#M1894036</guid>
      <dc:creator>former_member188827</dc:creator>
      <dc:date>2015-04-23T08:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create table like SAP Query generated structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-table-like-sap-query-generated-structure/m-p/10968062#M1894037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My requirement is to create a replica of the SAP query generated internal table %dtab/%GOO&lt;/P&gt;&lt;P&gt;I am already in SQ02 in the code section under the event END-OF-SELECTION(After List).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2015 09:30:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-table-like-sap-query-generated-structure/m-p/10968062#M1894037</guid>
      <dc:creator>prince_isaac</dc:creator>
      <dc:date>2015-04-23T09:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Create table like SAP Query generated structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-table-like-sap-query-generated-structure/m-p/10968063#M1894038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the after list event. Use the following code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA lv_tabname type tabname&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value '%G00[]'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbol : &amp;lt;fs_tab&amp;gt; type standard table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign (lv_tabname) to &amp;lt;fs_tab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have the internal table in field symbol &amp;lt;fs_tab&amp;gt;. Now you can do whatever you want with it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2015 10:10:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-table-like-sap-query-generated-structure/m-p/10968063#M1894038</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-04-23T10:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Create table like SAP Query generated structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-table-like-sap-query-generated-structure/m-p/10968064#M1894039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My issue is not having access to the generated table, i already done so prior, i need to create another internal table just like the generated one.&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;Prince Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2015 13:26:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-table-like-sap-query-generated-structure/m-p/10968064#M1894039</guid>
      <dc:creator>prince_isaac</dc:creator>
      <dc:date>2015-04-23T13:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create table like SAP Query generated structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-table-like-sap-query-generated-structure/m-p/10968065#M1894040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;step 1 : get the component list using RTTI.&lt;/P&gt;&lt;P&gt;step 2: create a field catalog with the fields.&lt;/P&gt;&lt;P&gt;step 3: create a table based on the field catalog using method CREATE_DYNAMIC_TABLE of class CL_ALV_TABLE_CREATE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2015 09:56:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-table-like-sap-query-generated-structure/m-p/10968065#M1894040</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-04-27T09:56:47Z</dc:date>
    </item>
  </channel>
</rss>

