<?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: merging internal tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573174#M860125</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;k&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edited by anvar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Mar 2008 05:04:33 GMT</pubDate>
    <dc:creator>anversha_s</dc:creator>
    <dc:date>2008-03-17T05:04:33Z</dc:date>
    <item>
      <title>merging internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573166#M860117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts , &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;                I got 4 internal tables in my report . I have retrieved the data . &lt;/P&gt;&lt;P&gt;              I should display the report in alv . How can i merge all the internal tables into single output table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Mar 2008 23:13:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573166#M860117</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-16T23:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: merging internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573167#M860118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will need to declare one more table - the final table and move the contents into it from all the four tables one by one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 01:13:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573167#M860118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T01:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: merging internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573168#M860119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Define final internal table contains all the fields.&lt;/P&gt;&lt;P&gt;Use MOVE statement to insert the data into final internal table.&lt;/P&gt;&lt;P&gt;Ex:- MOVE it_kna1-kunnr TO it_final-kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points,if it is useful.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chandu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 03:44:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573168#M860119</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T03:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: merging internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573169#M860120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Define final internal table contains all the fields.&lt;/P&gt;&lt;P&gt;by passing data from one internal table to another by &lt;/P&gt;&lt;P&gt;itab[] = itab2 .&lt;/P&gt;&lt;P&gt;itab2[] = itab3.&lt;/P&gt;&lt;P&gt;and define all the fields in final internal table . &lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;Use MOVE statement to insert the data into final internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 04:21:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573169#M860120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T04:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: merging internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573170#M860121</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;Define a final internal table with all the fields which u need to display in the report.&lt;/P&gt;&lt;P&gt;use MOVE statement to move the data from internal tabe to the final internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 04:24:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573170#M860121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T04:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: merging internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573171#M860122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG&gt;Raj&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create another table that will contain all the fields that you want to display in the ALV output. Move the data from the four internal tables into corresponding fields of the fourth table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Itab_dat1, Itab_dat2, Itab_dat3, itab_dat4.&lt;/P&gt;&lt;P&gt;Itab_Report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move-Corresponding Itab_dat1 to Itab_Report.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 04:24:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573171#M860122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T04:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: merging internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573172#M860123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi declare one final internal table with all the fields, check the relation between ur internal tables which u hav the data, based on conditions u move that data into ur final internal table by using MOVE-CORRESPONDING statement....  bcaz ur internal table and ur final internal table are diffrent structures u hav to use MOVE-CORRESPONDING statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like...........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab1 INTO wa1.&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING wa1 TO ifinal.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 04:28:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573172#M860123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T04:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: merging internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573173#M860124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Declare an internal table that contains all the fields of the four internal table.&lt;/P&gt;&lt;P&gt;Loop the first internal table.&lt;/P&gt;&lt;P&gt;Move the fields using move statement.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;Do the same procedure for the rest of the tables.&lt;/P&gt;&lt;P&gt;You can also give condition based on the requirement in loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 04:35:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573173#M860124</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T04:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: merging internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573174#M860125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;k&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edited by anvar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 05:04:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573174#M860125</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2008-03-17T05:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: merging internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573175#M860126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that you have four internal tables with a common key field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that merging internal table is not merely moving contents of one table to another.  You need to ensure that you are moving the records (rows) of one itab that corresponds to the records in another table.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence assume that we have two internal table with the following fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab1 with field1 field2 field3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and itab2 with field1 field4 field5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now if you want to merge the above two tables either you need to have a third internal table itab3 with field1 field2 field3 field4 and field5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;once this is available just judge which is the larger table in terms of number of records (itab1 or itab2).  Assume that itab1 is larger and contains at least 1 record corresponding to an entry in itab2 and itab2 does not contain duplicate records for the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now follow the below algorithm:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab2 by field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read itab2 where field1 = field2 binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(you can include code to read itab4 and itab5 also here if they have the same common field)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move-correspond itab1 to itab3.&lt;/P&gt;&lt;P&gt;move itab2-field4 to itab4-field4.&lt;/P&gt;&lt;P&gt;move itab2-field5 to itab4-field5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(include the code to move fields from itab4 and itab5 here )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append itab3.&lt;/P&gt;&lt;P&gt;clear: itab2, itab3 (itab4 and itab5).&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now itab3 will have the all the fields of itab1 and itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope the above addresses your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Girish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: girish kumar on Mar 17, 2008 10:51 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 05:19:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573175#M860126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T05:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: merging internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573176#M860127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Build an internal table with all the fields u find in all the tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check any commmon fields are there in between those tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assignments&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;commands to do that. U will find syntaxes for these in ABAP documentation&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 05:27:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-internal-tables/m-p/3573176#M860127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T05:27:15Z</dc:date>
    </item>
  </channel>
</rss>

