<?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: Table type in dynamic internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-type-in-dynamic-internal-table/m-p/1924751#M383878</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If i understand you correctly you are looking to take a table generated dynamically and add another column to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given that you already have a field-symbol pointing at your original type named: &amp;lt;orgTable&amp;gt; and it also assumes that your table's row type is a structure, it wouldn't be too hard to modify it to support other types of line types. The following should work (although haven't tried it in the ABAP ide):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data lineType type ref to cl_abap_structdescr.
data tableType type ref to cl_abap_tabledescr.
data componentTable type component_table..

tableType ?= cl_abap_tabledescr=&amp;gt;describe_by_data( &amp;lt;orgType&amp;gt; ).
lineType ?= tableType-&amp;gt;get_table_line_type( ).
componentTable = lineType-&amp;gt;get_components( ).
* append your additional type here.
* append fooType to componentTable.
lineType ?= cl_abap_structDescr=&amp;gt;create( componentTable ).
tableType = cl_abap_tabledescr=&amp;gt;create( lineType ).

* now create your new data area.
data newTable type ref to data.
field-symbol &amp;lt;newTable&amp;gt; type standard table.

create data newTable handle tableType.
assign newTable-&amp;gt;* to &amp;lt;newTable&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;hope that helps you out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Feb 2007 21:06:53 GMT</pubDate>
    <dc:creator>former_member10945</dc:creator>
    <dc:date>2007-02-15T21:06:53Z</dc:date>
    <item>
      <title>Table type in dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-type-in-dynamic-internal-table/m-p/1924750#M383877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a dynamic internal table. I want to add one more column in the dynamic internal table which should be table type or need to create one table type while creating dynamic internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions plzz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx,&lt;/P&gt;&lt;P&gt;Klad.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 13:13:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-type-in-dynamic-internal-table/m-p/1924750#M383877</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T13:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Table type in dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-type-in-dynamic-internal-table/m-p/1924751#M383878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If i understand you correctly you are looking to take a table generated dynamically and add another column to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given that you already have a field-symbol pointing at your original type named: &amp;lt;orgTable&amp;gt; and it also assumes that your table's row type is a structure, it wouldn't be too hard to modify it to support other types of line types. The following should work (although haven't tried it in the ABAP ide):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data lineType type ref to cl_abap_structdescr.
data tableType type ref to cl_abap_tabledescr.
data componentTable type component_table..

tableType ?= cl_abap_tabledescr=&amp;gt;describe_by_data( &amp;lt;orgType&amp;gt; ).
lineType ?= tableType-&amp;gt;get_table_line_type( ).
componentTable = lineType-&amp;gt;get_components( ).
* append your additional type here.
* append fooType to componentTable.
lineType ?= cl_abap_structDescr=&amp;gt;create( componentTable ).
tableType = cl_abap_tabledescr=&amp;gt;create( lineType ).

* now create your new data area.
data newTable type ref to data.
field-symbol &amp;lt;newTable&amp;gt; type standard table.

create data newTable handle tableType.
assign newTable-&amp;gt;* to &amp;lt;newTable&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;hope that helps you out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 21:06:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-type-in-dynamic-internal-table/m-p/1924751#M383878</guid>
      <dc:creator>former_member10945</dc:creator>
      <dc:date>2007-02-15T21:06:53Z</dc:date>
    </item>
  </channel>
</rss>

