<?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: Selecting from multiple tables, into one internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313050#M506850</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use Inner join for 3 tables to get better performance ,always use for all entries with primary key condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inner join - there no limit and you can join n number of tables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 May 2007 22:26:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-29T22:26:39Z</dc:date>
    <item>
      <title>Selecting from multiple tables, into one internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313049#M506849</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;What is the best &amp;amp; most efficient method of selecting from multiple table (in my case 6,) into one internal table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Points will be rewarded and all responses will be highly appreciated.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2007 22:19:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313049#M506849</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-29T22:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting from multiple tables, into one internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313050#M506850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use Inner join for 3 tables to get better performance ,always use for all entries with primary key condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inner join - there no limit and you can join n number of tables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2007 22:26:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313050#M506850</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-29T22:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting from multiple tables, into one internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313051#M506851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have simple example :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; First one - Join 5 tables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data : f1 type i,&lt;/P&gt;&lt;P&gt;          f2 type i,&lt;/P&gt;&lt;P&gt;          f3 type i.&lt;/P&gt;&lt;P&gt;&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;get run time field f1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;write the query 4 or 5 tables join.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;get run time field f2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f3 = f2 - f1 ( Total time).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Second one - joins 3 table and use for all entries&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : f1 type i,&lt;/P&gt;&lt;P&gt;          f2 type i,&lt;/P&gt;&lt;P&gt;          f3 type i.&lt;/P&gt;&lt;P&gt;&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;get run time field f1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;write the query 3 tables join and use for all entries&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;get run time field f2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f3 = f2 - f1. ( Total time )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally you can have time diffrence between the both sql statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2007 22:33:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313051#M506851</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-29T22:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting from multiple tables, into one internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313052#M506852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please specify the table names here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Becuase the most efficient way to fetch data from so many tables is Logical database, if they are in logical hierarchy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can view logical databases using SE36&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2007 22:53:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313052#M506852</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-29T22:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting from multiple tables, into one internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313053#M506853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you need to select from more than one table, you are left with only two options&lt;/P&gt;&lt;P&gt;1. use Join.&lt;/P&gt;&lt;P&gt;2. Select data in one internal table and based on that select into another table and so on. At the End you need to consolidate entried in one internal table or output table using LOOP and READ statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The decision is generally depends upon the table in question, the no. of entries expected and values(keys) available for selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it is clear. Revert back if further query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2007 22:58:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313053#M506853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-29T22:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting from multiple tables, into one internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313054#M506854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main thing which you need to consider are:&lt;/P&gt;&lt;P&gt;1. The number of entries in each table&lt;/P&gt;&lt;P&gt;2. Whether any of the tables from which data needs to be fetched, is a cluster or pool table. In case of cluster table, you can not use JOINS. In this case, you would have to select into individual tables and then LOOP to build a single table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bharati&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2007 00:48:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313054#M506854</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-30T00:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting from multiple tables, into one internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313055#M506855</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; If u want to join multiple tables then go for Inner Join thts the better option for u.&lt;/P&gt;&lt;P&gt;That is using select statement.They r other ways also but this is much useful one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if useful reward with points,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with regards,&lt;/P&gt;&lt;P&gt;madhuri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2007 02:24:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313055#M506855</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-30T02:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting from multiple tables, into one internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313056#M506856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, the tables are used for getting all PERNR numbers, which are entered into different tables. The tables are A867, A865, A830, A864, A835, A869&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2007 12:41:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313056#M506856</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-30T12:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting from multiple tables, into one internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313057#M506857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These are Tax Condition tables and they have almost same structures.&lt;/P&gt;&lt;P&gt;In this case, you can write multiple queries and accumulate data into single internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF ITAB,&lt;/P&gt;&lt;P&gt;KAPPL LIKE A867-KAPPL,&lt;/P&gt;&lt;P&gt;KSCHL LIKE A867-KSCHL,&lt;/P&gt;&lt;P&gt;OIC_OREGIO LIKE A867-OIC_OREGIO,&lt;/P&gt;&lt;P&gt;END OF ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT KAPPL KSCHL OIC_OREGIO&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;APPENDING&amp;lt;/b&amp;gt; CORRESPONDING FIELDS OF TABLE ITAB&lt;/P&gt;&lt;P&gt;FROM A867 WHERE ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT KAPPL KSCHL OIC_OREGIO&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;APPENDING&amp;lt;/b&amp;gt; CORRESPONDING FIELDS OF TABLE ITAB&lt;/P&gt;&lt;P&gt;FROM A865 WHERE ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT KAPPL KSCHL OIC_OREGIO&lt;/P&gt;&lt;P&gt;APPENDING CORRESPONDING FIELDS OF TABLE ITAB&lt;/P&gt;&lt;P&gt;FROM A830 WHERE ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPENDING clause will append the data into internal table and it will not remove the existing data.&lt;/P&gt;&lt;P&gt;CORRESPONDING FIELDS OF TABLE ITAB will move data to matching fields of internal table. It will move data whose name is matching with the table field name. For ex, KSCHL of table will be moved to KSCHL of internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2007 16:58:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313057#M506857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-30T16:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting from multiple tables, into one internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313058#M506858</link>
      <description>&lt;P&gt;Sir,&lt;/P&gt;&lt;P&gt;please tell me step by step how to join bkpf and bseg tables using select.&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 11:05:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-from-multiple-tables-into-one-internal-table/m-p/2313058#M506858</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-05-02T11:05:23Z</dc:date>
    </item>
  </channel>
</rss>

