<?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: Inner join in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815065#M658245</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;maybe this solve your problem&lt;/P&gt;&lt;P&gt;+The WHERE clause of the SELECT statement has a special variant that allows you to derive conditions from the lines and columns of an internal table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ... FOR ALL ENTRIES IN  must be compatible with the column of the database with which it is compared. Do not use the operators LIKE, BETWEEN, and IN in comparisons using internal table fields. You may not use the ORDER BY clause in the same SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the option FOR ALL ENTRIES to replace nested select loops by operations on internal tables. This can significantly improve the performance for large sets of selected data.&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;+Tabular conditions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF LINE,&lt;/P&gt;&lt;P&gt;        CARRID   TYPE SPFLI-CARRID,&lt;/P&gt;&lt;P&gt;        CONNID   TYPE SPFLI-CONNID,&lt;/P&gt;&lt;P&gt;        CITYFROM TYPE SPFLI-CITYFROM,&lt;/P&gt;&lt;P&gt;        CITYTO   TYPE SPFLI-CITYTO,&lt;/P&gt;&lt;P&gt;      END OF LINE,&lt;/P&gt;&lt;P&gt;      ITAB LIKE TABLE OF LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LINE-CITYFROM = 'FRANKFURT'.&lt;/P&gt;&lt;P&gt;LINE-CITYTO   = 'BERLIN'.&lt;/P&gt;&lt;P&gt;APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LINE-CITYFROM = 'NEW YORK'.&lt;/P&gt;&lt;P&gt;LINE-CITYTO   = 'SAN FRANCISCO'.&lt;/P&gt;&lt;P&gt;APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT CARRID CONNID CITYFROM CITYTO&lt;/P&gt;&lt;P&gt;INTO   CORRESPONDING FIELDS OF LINE&lt;/P&gt;&lt;P&gt;FROM   SPFLI&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN ITAB&lt;/P&gt;&lt;P&gt;WHERE  CITYFROM = ITAB-CITYFROM AND CITYTO = ITAB-CITYTO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE: / LINE-CARRID, LINE-CONNID, LINE-CITYFROM, LINE-CITYTO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output is as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This example selects all lines in which the following conditions are fulfilled: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;· The CITYFROM column contains FRANKFURT and the CITYTO column contains BERLIN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;· The CITYFROM column contains NEW YORK and the CITYTO column contains SAN FRANCISCO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tabular conditions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: TAB_SPFLI   TYPE TABLE OF SPFLI,&lt;/P&gt;&lt;P&gt;      TAB_SFLIGHT TYPE SORTED TABLE OF SFLIGHT&lt;/P&gt;&lt;P&gt;                       WITH UNIQUE KEY TABLE LINE,&lt;/P&gt;&lt;P&gt;      WA LIKE LINE OF TAB_SFLIGHT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT CARRID CONNID&lt;/P&gt;&lt;P&gt;INTO   CORRESPONDING FIELDS OF TABLE TAB_SPFLI&lt;/P&gt;&lt;P&gt;FROM   SPFLI&lt;/P&gt;&lt;P&gt;WHERE  CITYFROM  = 'NEW YORK'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT CARRID CONNID FLDATE&lt;/P&gt;&lt;P&gt;INTO   CORRESPONDING FIELDS OF TABLE TAB_SFLIGHT&lt;/P&gt;&lt;P&gt;FROM   SFLIGHT&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN TAB_SPFLI&lt;/P&gt;&lt;P&gt;WHERE  CARRID = TAB_SPFLI-CARRID AND&lt;/P&gt;&lt;P&gt;       CONNID = TAB_SPFLI-CONNID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT TAB_SFLIGHT INTO WA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  AT NEW CONNID.&lt;/P&gt;&lt;P&gt;    WRITE: / WA-CARRID, WA-CONNID.&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE: / WA-FLDATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output is as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This example selects flight data from SFLIGHT for all connections for which the column CITYFROM in table SPFLI has the value NEW YORK. You could also use a join in the FROM clause to select the same data in a single SELECT statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gianpietro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Oct 2007 12:37:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-05T12:37:04Z</dc:date>
    <item>
      <title>Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815059#M658239</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 have got a scenario in which i need to fetch values from 5 tables which contains more that 2 lakh entries.&lt;/P&gt;&lt;P&gt;If i use inner join query it takes 2 min for executing that select query. Sometimes it goes to dump.&lt;/P&gt;&lt;P&gt;Can anyone pls help me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 12:29:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815059#M658239</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T12:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815060#M658240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try "FOR ALL Entries"....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;search for the string "FOR ALL Entries" in the forum and you will get lot of entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward the helpful entries.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raman.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 12:33:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815060#M658240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T12:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815061#M658241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;It depends on the tables data from which you are fetching &lt;/P&gt;&lt;P&gt;All tables should have proper keys linked with each other then it works fine&lt;/P&gt;&lt;P&gt;other wise it may lead to dump&lt;/P&gt;&lt;P&gt;unless you tell the tables it is not easy to comment on joins&lt;/P&gt;&lt;P&gt;otherwise better to use join between first 2 then use for all entries and fetch data from other tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 12:34:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815061#M658241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T12:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815062#M658242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;performance will get affected when u join more tables.&lt;/P&gt;&lt;P&gt;Try changing it to FOR ALL ENTRIES&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 12:34:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815062#M658242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T12:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815063#M658243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shori,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For better performance you can join only four tables in one select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hemnat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 12:35:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815063#M658243</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T12:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815064#M658244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shori,&lt;/P&gt;&lt;P&gt;Use database view. That will be efficient in this kind of scenarios.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 12:36:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815064#M658244</guid>
      <dc:creator>asik_shameem</dc:creator>
      <dc:date>2007-10-05T12:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815065#M658245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;maybe this solve your problem&lt;/P&gt;&lt;P&gt;+The WHERE clause of the SELECT statement has a special variant that allows you to derive conditions from the lines and columns of an internal table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ... FOR ALL ENTRIES IN  must be compatible with the column of the database with which it is compared. Do not use the operators LIKE, BETWEEN, and IN in comparisons using internal table fields. You may not use the ORDER BY clause in the same SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the option FOR ALL ENTRIES to replace nested select loops by operations on internal tables. This can significantly improve the performance for large sets of selected data.&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;+Tabular conditions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF LINE,&lt;/P&gt;&lt;P&gt;        CARRID   TYPE SPFLI-CARRID,&lt;/P&gt;&lt;P&gt;        CONNID   TYPE SPFLI-CONNID,&lt;/P&gt;&lt;P&gt;        CITYFROM TYPE SPFLI-CITYFROM,&lt;/P&gt;&lt;P&gt;        CITYTO   TYPE SPFLI-CITYTO,&lt;/P&gt;&lt;P&gt;      END OF LINE,&lt;/P&gt;&lt;P&gt;      ITAB LIKE TABLE OF LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LINE-CITYFROM = 'FRANKFURT'.&lt;/P&gt;&lt;P&gt;LINE-CITYTO   = 'BERLIN'.&lt;/P&gt;&lt;P&gt;APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LINE-CITYFROM = 'NEW YORK'.&lt;/P&gt;&lt;P&gt;LINE-CITYTO   = 'SAN FRANCISCO'.&lt;/P&gt;&lt;P&gt;APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT CARRID CONNID CITYFROM CITYTO&lt;/P&gt;&lt;P&gt;INTO   CORRESPONDING FIELDS OF LINE&lt;/P&gt;&lt;P&gt;FROM   SPFLI&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN ITAB&lt;/P&gt;&lt;P&gt;WHERE  CITYFROM = ITAB-CITYFROM AND CITYTO = ITAB-CITYTO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE: / LINE-CARRID, LINE-CONNID, LINE-CITYFROM, LINE-CITYTO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output is as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This example selects all lines in which the following conditions are fulfilled: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;· The CITYFROM column contains FRANKFURT and the CITYTO column contains BERLIN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;· The CITYFROM column contains NEW YORK and the CITYTO column contains SAN FRANCISCO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tabular conditions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: TAB_SPFLI   TYPE TABLE OF SPFLI,&lt;/P&gt;&lt;P&gt;      TAB_SFLIGHT TYPE SORTED TABLE OF SFLIGHT&lt;/P&gt;&lt;P&gt;                       WITH UNIQUE KEY TABLE LINE,&lt;/P&gt;&lt;P&gt;      WA LIKE LINE OF TAB_SFLIGHT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT CARRID CONNID&lt;/P&gt;&lt;P&gt;INTO   CORRESPONDING FIELDS OF TABLE TAB_SPFLI&lt;/P&gt;&lt;P&gt;FROM   SPFLI&lt;/P&gt;&lt;P&gt;WHERE  CITYFROM  = 'NEW YORK'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT CARRID CONNID FLDATE&lt;/P&gt;&lt;P&gt;INTO   CORRESPONDING FIELDS OF TABLE TAB_SFLIGHT&lt;/P&gt;&lt;P&gt;FROM   SFLIGHT&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN TAB_SPFLI&lt;/P&gt;&lt;P&gt;WHERE  CARRID = TAB_SPFLI-CARRID AND&lt;/P&gt;&lt;P&gt;       CONNID = TAB_SPFLI-CONNID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT TAB_SFLIGHT INTO WA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  AT NEW CONNID.&lt;/P&gt;&lt;P&gt;    WRITE: / WA-CARRID, WA-CONNID.&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE: / WA-FLDATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output is as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This example selects flight data from SFLIGHT for all connections for which the column CITYFROM in table SPFLI has the value NEW YORK. You could also use a join in the FROM clause to select the same data in a single SELECT statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gianpietro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 12:37:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815065#M658245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T12:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815066#M658246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, It is not adviceable to use inner joins with more than 3 tables, and tables with size category 4. You can check the size category in se11 (technical settings). I think you should do the selection not in one step. Mention the size category, and you can join the smaller tables, then you can do the remaining selection in another simple selection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 12:38:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2815066#M658246</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T12:38:22Z</dc:date>
    </item>
  </channel>
</rss>

