<?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: Adding new field to internal table dynamically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236336#M1381447</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello SAPPIEN,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AFAIK if you define an internal table statically you cannot alter its structure at runtime. (Members can correct me if i am wrong in this statement) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So your requirement to add a field to a statically defined int. table structure is not possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively you can try to use a dynamically defined internal table using the method CREATE_DYNAMIC_TABLE of class CL_ALV_TABLE_CREATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further details on SDN.&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, 28 Sep 2009 08:41:39 GMT</pubDate>
    <dc:creator>SuhaSaha</dc:creator>
    <dc:date>2009-09-28T08:41:39Z</dc:date>
    <item>
      <title>Adding new field to internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236332#M1381443</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 need to add a field dynamically during runtime. How can i do that? For example consider i have a internal table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab,&lt;/P&gt;&lt;P&gt;                    id       type i,&lt;/P&gt;&lt;P&gt;                    name (30) type c,&lt;/P&gt;&lt;P&gt;           END OF itab.    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to add a field ADDRESS during runtime. After adding the field the internal will be like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DAtA: BEGIN of itab,&lt;/P&gt;&lt;P&gt;              id             type i,&lt;/P&gt;&lt;P&gt;             name(30) type c,&lt;/P&gt;&lt;P&gt;             address   type c,&lt;/P&gt;&lt;P&gt;         END OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i achieve the above requirement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Sep 2009 14:39:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236332#M1381443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-27T14:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new field to internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236333#M1381444</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;Use the concept of dynamic internal tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Rich Heilman's blog on Dynamic Internal Tables|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3417800%29ID0902689750DB20088686594705427604End?blog=/pub/wlg/2071]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pushpraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Sep 2009 17:17:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236333#M1381444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-27T17:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new field to internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236334#M1381445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;search 'field symbol for dynamic tables' in SCN.&lt;/P&gt;&lt;P&gt;and please close the duplicate thread: &lt;SPAN __jive_macro_name="thread" id="1487248"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Sep 2009 19:43:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236334#M1381445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-27T19:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new field to internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236335#M1381446</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 checked that link. they are passing table structure through a parameter. The parameter will store table name like 'MARA'. it is not altering the table field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2009 08:35:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236335#M1381446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-28T08:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new field to internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236336#M1381447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello SAPPIEN,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AFAIK if you define an internal table statically you cannot alter its structure at runtime. (Members can correct me if i am wrong in this statement) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So your requirement to add a field to a statically defined int. table structure is not possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively you can try to use a dynamically defined internal table using the method CREATE_DYNAMIC_TABLE of class CL_ALV_TABLE_CREATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further details on SDN.&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, 28 Sep 2009 08:41:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236336#M1381447</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-09-28T08:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new field to internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236337#M1381448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hii,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating fied dynamically you have to use the class cl_wd_inputfield. you can use the method to create input field of this class. cl_wd_input_field=&amp;gt;new_input_field" method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; See class "cl_wd_input_field" for method parameter details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Shweta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2009 09:10:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236337#M1381448</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-28T09:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new field to internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236338#M1381449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Shweta,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where did you get this info? How does this help? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any sample coding for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2009 09:20:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236338#M1381449</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-09-28T09:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new field to internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236339#M1381450</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 checked few links, they creating internal table dynamically but the structure of internal table is static. My need is i want to change the structure of internal table dynamically.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2009 11:29:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236339#M1381450</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-28T11:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new field to internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236340#M1381451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume this isn't possible due to internal memory management.&lt;/P&gt;&lt;P&gt;You could create a new table with the desired structure, move your data there, and delete the old table.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2009 11:41:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236340#M1381451</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-09-28T11:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new field to internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236341#M1381452</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;&lt;/P&gt;&lt;P&gt;You should not assume that i am  only asking to insert a field in static internal table created. If it is possible please give me some information to insert a field in dyanamic internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2009 11:45:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236341#M1381452</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-28T11:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new field to internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236342#M1381453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the program BCALV_TABLE_CREATE. I think this should answer your question.&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, 28 Sep 2009 12:38:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236342#M1381453</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-09-28T12:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new field to internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236343#M1381454</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;Pls try this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: STR_TYPE TYPE REF TO  CL_ABAP_STRUCTDESCR,&lt;/P&gt;&lt;P&gt;      STR_COMP TYPE         CL_ABAP_STRUCTDESCR=&amp;gt;COMPONENT_TABLE,&lt;/P&gt;&lt;P&gt;      COMP_TAB TYPE         CL_ABAP_STRUCTDESCR=&amp;gt;COMPONENT_TABLE,&lt;/P&gt;&lt;P&gt;      NEW_STR  TYPE REF TO  CL_ABAP_STRUCTDESCR,&lt;/P&gt;&lt;P&gt;      NEW_TAB  TYPE REF TO  CL_ABAP_TABLEDESCR,&lt;/P&gt;&lt;P&gt;      COMP     LIKE LINE OF COMP_TAB,&lt;/P&gt;&lt;P&gt;      DREF     TYPE REF TO  DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;ITAB&amp;gt; TYPE ANY TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF STR,&lt;/P&gt;&lt;P&gt;       ID TYPE I,&lt;/P&gt;&lt;P&gt;       NAME(30) TYPE C,&lt;/P&gt;&lt;P&gt;       END OF STR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STR_TYPE ?= CL_ABAP_TYPEDESCR=&amp;gt;DESCRIBE_BY_NAME( 'STR' ).&lt;/P&gt;&lt;P&gt;STR_COMP  = STR_TYPE-&amp;gt;GET_COMPONENTS( ).&lt;/P&gt;&lt;P&gt;APPEND LINES OF STR_COMP TO COMP_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMP-NAME = 'ADDRESS'.&lt;/P&gt;&lt;P&gt;COMP-TYPE = CL_ABAP_ELEMDESCR=&amp;gt;GET_C( 40 ).&lt;/P&gt;&lt;P&gt;APPEND COMP TO COMP_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NEW_STR = CL_ABAP_STRUCTDESCR=&amp;gt;CREATE( COMP_TAB ).&lt;/P&gt;&lt;P&gt;NEW_TAB = CL_ABAP_TABLEDESCR=&amp;gt;CREATE(&lt;/P&gt;&lt;P&gt;                  P_LINE_TYPE  = NEW_STR&lt;/P&gt;&lt;P&gt;                  P_TABLE_KIND = CL_ABAP_TABLEDESCR=&amp;gt;TABLEKIND_STD&lt;/P&gt;&lt;P&gt;                  P_UNIQUE     = ABAP_FALSE ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE DATA DREF TYPE HANDLE NEW_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN DREF-&amp;gt;* TO &amp;lt;ITAB&amp;gt;. "INTERNAL TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prasanna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2009 19:31:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236343#M1381454</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-28T19:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new field to internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236344#M1381455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sappien,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is not possible to change the structure of an internal table at runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prasanna shows how to use RTTS Run Time Type Service to create an internal table at runtime. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the only possible way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pleae do not use method cl_alv_table_create=&amp;gt;create_dynamic_table because it has serious restrictions and unwanted side effects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2009 22:18:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-new-field-to-internal-table-dynamically/m-p/6236344#M1381455</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2009-09-28T22:18:12Z</dc:date>
    </item>
  </channel>
</rss>

