<?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 more fields to the internal table dynamically. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-more-fields-to-the-internal-table-dynamically/m-p/4000984#M955951</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you pls expalin clearly. If possible could you pls send me the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anybody have different solution for this issue, please forward it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is very urgent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Jun 2008 13:55:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-12T13:55:21Z</dc:date>
    <item>
      <title>Adding more fields to the internal table dynamically.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-more-fields-to-the-internal-table-dynamically/m-p/4000982#M955949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to add fields to the internal table dynamically. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my situation.&lt;/P&gt;&lt;P&gt;begin of itab1 ,&lt;/P&gt;&lt;P&gt;material&lt;/P&gt;&lt;P&gt;material type&lt;/P&gt;&lt;P&gt;endof itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;begin of itab2 occurs 0,&lt;/P&gt;&lt;P&gt;material&lt;/P&gt;&lt;P&gt;material type&lt;/P&gt;&lt;P&gt;xxxxxxxx&lt;/P&gt;&lt;P&gt;xxxxxxxxx&lt;/P&gt;&lt;P&gt;xxxxxxx&lt;/P&gt;&lt;P&gt;xxxxxxxxx&lt;/P&gt;&lt;P&gt;endof itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am populating the data from mara to the above internal table work area itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;based on the itab1-material type, i need to add some more fields to the another internal table i.e itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will vary depends on the material type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could you pls help me how to add some more fields dynamically to the already defined table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will appreciate, if you send the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz help, its urgent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 21:07:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-more-fields-to-the-internal-table-dynamically/m-p/4000982#M955949</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T21:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Adding more fields to the internal table dynamically.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-more-fields-to-the-internal-table-dynamically/m-p/4000983#M955950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of creating ITAB2 and than adding some fields to that, try to create ITAB2 dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the Run time Type Service class like cl_abap_tabledescr to generate table dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 21:15:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-more-fields-to-the-internal-table-dynamically/m-p/4000983#M955950</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2008-06-11T21:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Adding more fields to the internal table dynamically.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-more-fields-to-the-internal-table-dynamically/m-p/4000984#M955951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you pls expalin clearly. If possible could you pls send me the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anybody have different solution for this issue, please forward it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is very urgent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2008 13:55:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-more-fields-to-the-internal-table-dynamically/m-p/4000984#M955951</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-12T13:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Adding more fields to the internal table dynamically.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-more-fields-to-the-internal-table-dynamically/m-p/4000985#M955952</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;  Find the code for &lt;STRONG&gt;dynamical internal table.&lt;/STRONG&gt;, which helps to increase the fields in the internal table dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZTEST_R3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;L_TABLE&amp;gt; TYPE TABLE,&lt;/P&gt;&lt;P&gt;&amp;lt;L_LINE&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;&amp;lt;L_FIELD&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: IS_LVC_CAT TYPE LVC_S_FCAT,&lt;/P&gt;&lt;P&gt;      IT_LVC_CAT TYPE LVC_T_FCAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: NEW_TABLE TYPE REF TO DATA,&lt;/P&gt;&lt;P&gt;      NEW_LINE  TYPE REF TO DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IS_LVC_CAT-FIELDNAME = 'KUNNR'.&lt;/P&gt;&lt;P&gt;  APPEND IS_LVC_CAT TO IT_LVC_CAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IS_LVC_CAT-FIELDNAME = 'NAME1'.&lt;/P&gt;&lt;P&gt;  APPEND IS_LVC_CAT TO IT_LVC_CAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD CL_ALV_TABLE_CREATE=&amp;gt;CREATE_DYNAMIC_TABLE&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      IT_FIELDCATALOG = IT_LVC_CAT&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      EP_TABLE        = NEW_TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Create a new Line with the same structure of the table.&lt;/P&gt;&lt;P&gt;  ASSIGN NEW_TABLE-&amp;gt;* TO &amp;lt;L_TABLE&amp;gt;.&lt;/P&gt;&lt;P&gt;  CREATE DATA NEW_LINE LIKE LINE OF &amp;lt;L_TABLE&amp;gt;.&lt;/P&gt;&lt;P&gt;  ASSIGN NEW_LINE-&amp;gt;* TO &amp;lt;L_LINE&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DO 2 TIMES.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT 'KUNNR' OF STRUCTURE &amp;lt;L_LINE&amp;gt; TO &amp;lt;L_FIELD&amp;gt;.&lt;/P&gt;&lt;P&gt;    &amp;lt;L_FIELD&amp;gt; = SY-INDEX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT 'NAME1' OF STRUCTURE &amp;lt;L_LINE&amp;gt; TO &amp;lt;L_FIELD&amp;gt;.&lt;/P&gt;&lt;P&gt;    &amp;lt;L_FIELD&amp;gt; = 'A'.&lt;/P&gt;&lt;P&gt;    INSERT &amp;lt;L_LINE&amp;gt; INTO TABLE &amp;lt;L_TABLE&amp;gt;.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT &amp;lt;L_TABLE&amp;gt; INTO &amp;lt;L_LINE&amp;gt;.&lt;/P&gt;&lt;P&gt;    WRITE:/ &amp;lt;L_LINE&amp;gt;.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE &amp;lt;L_TABLE&amp;gt; INTO &amp;lt;L_LINE&amp;gt; INDEX 2.&lt;/P&gt;&lt;P&gt;  &amp;lt;L_LINE&amp;gt;+10(2) = 'B'.&lt;/P&gt;&lt;P&gt;  MODIFY &amp;lt;L_TABLE&amp;gt; FROM &amp;lt;L_LINE&amp;gt; INDEX 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT &amp;lt;L_TABLE&amp;gt; INTO &amp;lt;L_LINE&amp;gt;.&lt;/P&gt;&lt;P&gt;    WRITE:/ &amp;lt;L_LINE&amp;gt;.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Jun 12, 2008 12:46 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2008 13:57:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-more-fields-to-the-internal-table-dynamically/m-p/4000985#M955952</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-12T13:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Adding more fields to the internal table dynamically.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-more-fields-to-the-internal-table-dynamically/m-p/4000986#M955953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi Kumar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Half of my issue was solved with your solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I declare the field symbols like below, it is considering all the field length only 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;L_TABLE&amp;gt; TYPE TABLE,&lt;/P&gt;&lt;P&gt;&amp;lt;L_LINE&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;&amp;lt;L_FIELD&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my situation, the field length is more than 10. i.e 108.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you pls let me know, how to proceed/ declare if at all i want more than 10 characters length?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any how Thanks  a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raghu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2008 17:13:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-more-fields-to-the-internal-table-dynamically/m-p/4000986#M955953</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-12T17:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Adding more fields to the internal table dynamically.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-more-fields-to-the-internal-table-dynamically/m-p/4000987#M955954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;problem solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2008 20:38:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-more-fields-to-the-internal-table-dynamically/m-p/4000987#M955954</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-12T20:38:25Z</dc:date>
    </item>
  </channel>
</rss>

