<?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: Join 2 internal tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-2-internal-tables/m-p/1619989#M277418</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The below should give you the result &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT A&lt;SUB&gt;ID A&lt;/SUB&gt;COL1 sum(B~COL2) INTO TABLE ITAB&lt;/P&gt;&lt;P&gt;FROM TABLE_A AS A INNER JOIN TABLE_B AS B&lt;/P&gt;&lt;P&gt;ON A&lt;SUB&gt;ID = B&lt;/SUB&gt;ID&lt;/P&gt;&lt;P&gt;GROUP BY A&lt;SUB&gt;ID A&lt;/SUB&gt;COL1&lt;/P&gt;&lt;P&gt;ORDER BY A~ID.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Oct 2006 09:38:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-16T09:38:32Z</dc:date>
    <item>
      <title>Join 2 internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-2-internal-tables/m-p/1619984#M277413</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;i have to join the whole content of a table with the content of a aggregated table. i "moved" the content of the 2 dictionary tables into 2 internal tables and i want to join these 2 internal tables now. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first of all, is it generally possible to join 2 internal tables, for example with a read or loop statement?!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at second, i know how i would solve the problem in oracle 10g, but it looks like that open-sql supports not the same features like orcale. knows anyone of you how i can rebuild the following oracle statement in abap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#####&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a.id, a.col1, b.col2 &lt;/P&gt;&lt;P&gt;from table_a as a, (select id, sum(col2) as col2 from table_c group by id) as b where a.id = b.id order by 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#####&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Oct 2006 19:16:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-2-internal-tables/m-p/1619984#M277413</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-14T19:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Join 2 internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-2-internal-tables/m-p/1619985#M277414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's best to "join" two internal tables by looping through the first and reading the second using a binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Oct 2006 19:24:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-2-internal-tables/m-p/1619985#M277414</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-14T19:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Join 2 internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-2-internal-tables/m-p/1619986#M277415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Markus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP open sql ahould be something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a&lt;SUB&gt;id a&lt;/SUB&gt;col1 sum( b~col2 )&lt;/P&gt;&lt;P&gt;from table_a as a&lt;/P&gt;&lt;P&gt;join table_c as b&lt;/P&gt;&lt;P&gt;  on a&lt;SUB&gt;id = b&lt;/SUB&gt;id &lt;/P&gt;&lt;P&gt;  group by b~id&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not sure abour the order by; don't know oracle syntax exactly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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>Sat, 14 Oct 2006 20:50:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-2-internal-tables/m-p/1619986#M277415</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2006-10-14T20:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Join 2 internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-2-internal-tables/m-p/1619987#M277416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A good programming practice is use a join query as stated earlier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else you can use field symbols to define the structure. Then assign the data to them. This is useful if you know dynamic programming.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sandeep Josyula&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2006 09:30:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-2-internal-tables/m-p/1619987#M277416</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-16T09:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Join 2 internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-2-internal-tables/m-p/1619988#M277417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Markus,&lt;/P&gt;&lt;P&gt;   Say we have internal tables itab1 and itab2.&lt;/P&gt;&lt;P&gt;The link between these two tables is say, field1.&lt;/P&gt;&lt;P&gt;Then you should do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;read table itab2 with key field1 = itab1-field1.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;move-correspoding itab1 to it_final.&lt;/P&gt;&lt;P&gt;move-correspoding itab2 to it_final.&lt;/P&gt;&lt;P&gt;append it_final.&lt;/P&gt;&lt;P&gt;clear it_final.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2006 09:34:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-2-internal-tables/m-p/1619988#M277417</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-16T09:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Join 2 internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-2-internal-tables/m-p/1619989#M277418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The below should give you the result &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT A&lt;SUB&gt;ID A&lt;/SUB&gt;COL1 sum(B~COL2) INTO TABLE ITAB&lt;/P&gt;&lt;P&gt;FROM TABLE_A AS A INNER JOIN TABLE_B AS B&lt;/P&gt;&lt;P&gt;ON A&lt;SUB&gt;ID = B&lt;/SUB&gt;ID&lt;/P&gt;&lt;P&gt;GROUP BY A&lt;SUB&gt;ID A&lt;/SUB&gt;COL1&lt;/P&gt;&lt;P&gt;ORDER BY A~ID.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2006 09:38:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-2-internal-tables/m-p/1619989#M277418</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-16T09:38:32Z</dc:date>
    </item>
  </channel>
</rss>

