<?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: diff between innerjoin and forallentries in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-innerjoin-and-forallentries/m-p/1798864#M343127</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I m nt really sure whether i got it right myself...........however from what I understand simply put its the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inner Join between the two tables will compare the common entries in the field mentioned and then display them,&lt;/P&gt;&lt;P&gt;however when using for all entries, all the occurences of the entry table from the second table will be displayed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i m wrong then i wld appreciate if anyone of the others can correct. thanks&lt;/P&gt;&lt;P&gt;Janak&lt;/P&gt;&lt;P&gt;Starters so dnt be too critical&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Dec 2006 19:00:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-13T19:00:37Z</dc:date>
    <item>
      <title>diff between innerjoin and forallentries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-innerjoin-and-forallentries/m-p/1798861#M343124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is innerjoin and forallentries ? diff between innerjoin and forallentries?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Dec 2006 18:34:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-innerjoin-and-forallentries/m-p/1798861#M343124</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-13T18:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: diff between innerjoin and forallentries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-innerjoin-and-forallentries/m-p/1798862#M343125</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;When multiple SAP tables are logically joined, it is always advisable to use inner join to read the data from them. This certainly reduces the load on the network. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us take an example of 2 tables, zairln and zflight. The table zairln has the field airln, which is the airline code and the field lnnam, which is the name of the airline. The table zflight has the field airln, the airline code and other fields which hold the details of the flights that an airline operates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since these 2 tables a re logically joined by the airln field, it is advisable to use the inner join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             Select a&lt;SUB&gt;airln a&lt;/SUB&gt;lnnam b&lt;SUB&gt;fligh b&lt;/SUB&gt;cntry into table int_airdet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            From zairln as a inner join zflight as b on a&lt;SUB&gt;airln = b&lt;/SUB&gt;airln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; In order to restrict the data as per the selection criteria, a where clause can be added to the above inner join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The for all entries creates a where clause, where all the entries in the driver table are combined with OR. If the number of entries in the driver table is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the length of the WHERE clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The plus: &lt;/P&gt;&lt;P&gt;- Large amount of data &lt;/P&gt;&lt;P&gt;- Mixing processing and reading of data &lt;/P&gt;&lt;P&gt;- Fast internal reprocessing of data &lt;/P&gt;&lt;P&gt;- Fast &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Minus: &lt;/P&gt;&lt;P&gt;- Difficult to program/understand &lt;/P&gt;&lt;P&gt;- Memory could be critical (use FREE or PACKAGE size) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some steps that might make FOR ALL ENTRIES more efficient: &lt;/P&gt;&lt;P&gt;- Removing duplicates from the driver table &lt;/P&gt;&lt;P&gt;- Sorting the driver table &lt;/P&gt;&lt;P&gt;- If possible, convert the data in the driver table to ranges so a BETWEEN statement is used instead of and OR statement: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          FOR ALL ENTRIES IN i_tab&lt;/P&gt;&lt;P&gt;          WHERE mykey &amp;gt;= i_tab-low and&lt;/P&gt;&lt;P&gt;                mykey &amp;lt;= i_tab-high.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Dec 2006 18:40:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-innerjoin-and-forallentries/m-p/1798862#M343125</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2006-12-13T18:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: diff between innerjoin and forallentries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-innerjoin-and-forallentries/m-p/1798863#M343126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;  Inner join is basically the intersection of two sets based on certain condition.&lt;/P&gt;&lt;P&gt;You can read data from more than one database table in a single SELECT statement by using inner or left outer joins in the FROM clause. &lt;/P&gt;&lt;P&gt;The disadvantage of using joins is that redundant data is read from the hierarchically-superior table if there is a 1:N relationship between the outer and inner tables. This can considerably increase the amount of data transferred from the database to the application server. Therefore, when you program a join, you should ensure that the SELECT clause contains a list of only the columns that you really need. Furthermore, joins bypass the table buffer and read directly from the database. For this reason, you should use an ABAP Dictionary view instead of a join if you only want to read the data.&lt;/P&gt;&lt;P&gt;The runtime of a join statement is heavily dependent on the database optimizer, especially when it contains more than two database tables. However, joins are nearly always quicker than using nested SELECT statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;For all entries&amp;lt;/b&amp;gt;&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 &amp;lt;itab&amp;gt; WHERE &amp;lt;cond&amp;gt; ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;cond&amp;gt; may be formulated as described above. If you specify a field of the internal table &amp;lt;itab&amp;gt; as an operand in a condition, you address all lines of the internal table. The comparison is then performed for each line of the internal table. For each line, the system selects the lines from the database table that satisfy the condition. The result set of the SELECT statement is the union of the individual selections for each line of the internal table. Duplicate lines are automatically eliminated from the result set. If &amp;lt;itab&amp;gt; is empty, the addition FOR ALL ENTRIES is disregarded, and all entries are read. &lt;/P&gt;&lt;P&gt;The internal table &amp;lt;itab&amp;gt; must have a structured line type, and each field that occurs in the condition &amp;lt;cond&amp;gt; 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;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;Regards,&lt;/P&gt;&lt;P&gt;Vara&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        varaprasad bhagavatula&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Dec 2006 18:48:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-innerjoin-and-forallentries/m-p/1798863#M343126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-13T18:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: diff between innerjoin and forallentries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-innerjoin-and-forallentries/m-p/1798864#M343127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I m nt really sure whether i got it right myself...........however from what I understand simply put its the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inner Join between the two tables will compare the common entries in the field mentioned and then display them,&lt;/P&gt;&lt;P&gt;however when using for all entries, all the occurences of the entry table from the second table will be displayed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i m wrong then i wld appreciate if anyone of the others can correct. thanks&lt;/P&gt;&lt;P&gt;Janak&lt;/P&gt;&lt;P&gt;Starters so dnt be too critical&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Dec 2006 19:00:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-innerjoin-and-forallentries/m-p/1798864#M343127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-13T19:00:37Z</dc:date>
    </item>
  </channel>
</rss>

