<?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: Dynamic ITAB with reduced column set in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab-with-reduced-column-set/m-p/12055669#M1969020</link>
    <description>&lt;P&gt;if you are trying to delete unused components from database table, i suggest to do it opposite way:&lt;/P&gt;&lt;P&gt;1. Take all components from database table name.&lt;/P&gt;&lt;P&gt;2. Take columns that user chosen and check the existence in step 1.&lt;/P&gt;&lt;P&gt;3. Create a new table type with subset of components collected in step 2.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Sep 2019 00:00:58 GMT</pubDate>
    <dc:creator>DoanManhQuynh</dc:creator>
    <dc:date>2019-09-25T00:00:58Z</dc:date>
    <item>
      <title>Dynamic ITAB with reduced column set</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab-with-reduced-column-set/m-p/12055666#M1969017</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;the problem i try to solve: i have an database table with e.g. 50 columns.&lt;BR /&gt;I want to create an internal table with a subset of these columns (n&amp;lt;50), due to performance reasons.&lt;BR /&gt;The data load is huge and i want to reduce the computing time (operations on ITab) and "RAM wastage" by selecting only the columns really needed.&lt;/P&gt;
  &lt;P&gt;So the number of columns depends on user interaction (n can be between 1 and 50).&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;First&lt;/STRONG&gt; i tried using following methods which does not work properly with all tables (SELECT-problems causes Unicode-Exception by some tables):&lt;BR /&gt;cl_abap_typedescr=&amp;gt;describe_by_name( 'tablename' )&lt;BR /&gt;cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;With &lt;STRONG&gt;second try&lt;/STRONG&gt; i used only RTTI-Methods (which seems to be a really smart way to deal with the problem):&lt;/P&gt;
  &lt;P&gt;ref_rowtype ?= cl_abap_typedescr=&amp;gt;describe_by_name( 'tablename' )&lt;BR /&gt;ref_tabletype = cl_abap_tabledescr=&amp;gt;create( p_line_type = ref_rowtype )&lt;/P&gt;
  &lt;P&gt;This solution works fine, but i am not able to reduce the number of columns (components). &lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;Has anybody an idea how i can fix the request "dynamic choosing of columns", please &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ?&lt;/P&gt;
  &lt;P&gt;Kind regards,&lt;BR /&gt;Michael Kilger&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 16:00:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab-with-reduced-column-set/m-p/12055666#M1969017</guid>
      <dc:creator>michael_kilger</dc:creator>
      <dc:date>2019-09-24T16:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic ITAB with reduced column set</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab-with-reduced-column-set/m-p/12055667#M1969018</link>
      <description>&lt;P&gt;Hello Michael,&lt;/P&gt;&lt;P&gt;Definitely RTTI is the way to go:&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;Obtain the fields of the original structure using CL_ABAP_TYPEDESCR=&amp;gt;DESCRIBE_BY_NAME('LONG_STRUCTURE_NAME')&lt;/LI&gt;&lt;LI&gt;Create a dynamic row type using CL_ABAP_STRUCTDESCR=&amp;gt;GET where you only provide the required subset of the components from the structure descriptor you previously extracted&lt;/LI&gt;&lt;LI&gt;Create a table type using the line type from step 2.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;BR,&lt;BR /&gt;Gábor&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 16:25:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab-with-reduced-column-set/m-p/12055667#M1969018</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-09-24T16:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic ITAB with reduced column set</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab-with-reduced-column-set/m-p/12055668#M1969019</link>
      <description>&lt;P&gt;Don't use cl_alv_table_create=&amp;gt;create_dynamic_table, use RTTS cf &lt;A href="https://answers.sap.com/users/4022/gabmarian.html"&gt;Gábor Márián&lt;/A&gt; answer (aka RTTC, RTTI).&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 19:05:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab-with-reduced-column-set/m-p/12055668#M1969019</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-09-24T19:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic ITAB with reduced column set</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab-with-reduced-column-set/m-p/12055669#M1969020</link>
      <description>&lt;P&gt;if you are trying to delete unused components from database table, i suggest to do it opposite way:&lt;/P&gt;&lt;P&gt;1. Take all components from database table name.&lt;/P&gt;&lt;P&gt;2. Take columns that user chosen and check the existence in step 1.&lt;/P&gt;&lt;P&gt;3. Create a new table type with subset of components collected in step 2.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 00:00:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab-with-reduced-column-set/m-p/12055669#M1969020</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2019-09-25T00:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic ITAB with reduced column set</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab-with-reduced-column-set/m-p/12055670#M1969021</link>
      <description>&lt;P&gt;Hello Gábor,&lt;/P&gt;&lt;P&gt;your proposal for solution worked fine.&lt;/P&gt;&lt;P&gt;I did not know how to use the modified components-Tab.&lt;/P&gt;&lt;P&gt;So, using the method-call "CL_ABAP_STRUCTDESCR=&amp;gt;GET( exporting P_COMPONENTS = lit_Components )" (with lit_Components modified in step before) was the missing link.&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;Kind regards to you (and all who answered &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ),&lt;/P&gt;&lt;P&gt;Michael Kilger&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 12:00:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab-with-reduced-column-set/m-p/12055670#M1969021</guid>
      <dc:creator>michael_kilger</dc:creator>
      <dc:date>2019-09-25T12:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic ITAB with reduced column set</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab-with-reduced-column-set/m-p/12055671#M1969022</link>
      <description>&lt;P&gt;Glad it worked. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In that case you should close the topic, so it will be obvious to everyone that it has been answered. &lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 12:30:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab-with-reduced-column-set/m-p/12055671#M1969022</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-09-25T12:30:46Z</dc:date>
    </item>
  </channel>
</rss>

