<?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 performance issues in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issues/m-p/2597729#M595085</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 a code to modify for its performance issues.&lt;/P&gt;&lt;P&gt;I found some queries in it containing FOR ALL ENTRIES and INNER JOIN .&lt;/P&gt;&lt;P&gt;Is it ok to blindly change these lines with something or some other reasons are there with the code for performance issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If something is to be done with FOR ALL ENTRIES, then please suggest an alternative for the following lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT gpart vkont&lt;/P&gt;&lt;P&gt;    INTO TABLE t_bpca&lt;/P&gt;&lt;P&gt;    FROM fkkvkp&lt;/P&gt;&lt;P&gt;    FOR ALL ENTRIES IN t_respart&lt;/P&gt;&lt;P&gt;    WHERE gpart =  t_respart-partner&lt;/P&gt;&lt;P&gt;    AND   opbuk NE c_siebel&lt;/P&gt;&lt;P&gt;    AND   vkpbz =  'AC'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is an alternative for INNER JOINS ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Binay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jul 2007 07:14:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-24T07:14:36Z</dc:date>
    <item>
      <title>performance issues</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issues/m-p/2597729#M595085</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 a code to modify for its performance issues.&lt;/P&gt;&lt;P&gt;I found some queries in it containing FOR ALL ENTRIES and INNER JOIN .&lt;/P&gt;&lt;P&gt;Is it ok to blindly change these lines with something or some other reasons are there with the code for performance issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If something is to be done with FOR ALL ENTRIES, then please suggest an alternative for the following lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT gpart vkont&lt;/P&gt;&lt;P&gt;    INTO TABLE t_bpca&lt;/P&gt;&lt;P&gt;    FROM fkkvkp&lt;/P&gt;&lt;P&gt;    FOR ALL ENTRIES IN t_respart&lt;/P&gt;&lt;P&gt;    WHERE gpart =  t_respart-partner&lt;/P&gt;&lt;P&gt;    AND   opbuk NE c_siebel&lt;/P&gt;&lt;P&gt;    AND   vkpbz =  'AC'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is an alternative for INNER JOINS ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Binay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 07:14:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issues/m-p/2597729#M595085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T07:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: performance issues</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issues/m-p/2597730#M595086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;    &amp;lt;b&amp;gt;FOR ALL ENTRIES&amp;lt;/b&amp;gt; is an effective way of doing away with using JOIN on two tables.&lt;/P&gt;&lt;P&gt;You can check the below code -&lt;/P&gt;&lt;P&gt;SELECT BUKRS BELNR GJAHR AUGDT&lt;/P&gt;&lt;P&gt;FROM BSEG&lt;/P&gt;&lt;P&gt;INTO TABLE I_BSEG&lt;/P&gt;&lt;P&gt;WHERE BUKRS = ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT BUKRS BELNR BLART BLDAT&lt;/P&gt;&lt;P&gt;FROM BKPF&lt;/P&gt;&lt;P&gt;INTO TABLE I_BKPF&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN I_BSEG&lt;/P&gt;&lt;P&gt;WHERE BUKRS = I_BSEG-BUKRS&lt;/P&gt;&lt;P&gt;AND BELNR = I_BSEG-BELNR&lt;/P&gt;&lt;P&gt;AND BLDAT IN SO_BLDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************************8&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;look another example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is the use of FOR ALL ENTRIES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. INNER JOIN&lt;/P&gt;&lt;P&gt;DBTAB1 &amp;lt;----&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&lt;P&gt;&amp;gt; DBTAB2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is used to JOIN two DATABASE tables&lt;/P&gt;&lt;P&gt;having some COMMON fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Whereas &lt;/P&gt;&lt;P&gt;For All Entries,&lt;/P&gt;&lt;P&gt;DBTAB1 &amp;lt;----&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&lt;P&gt;&amp;gt; ITAB1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is not at all related to two DATABASE tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is related to INTERNAL table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. If we want to fetch data &lt;/P&gt;&lt;P&gt;from some DBTABLE1&lt;/P&gt;&lt;P&gt;but we want to fetch&lt;/P&gt;&lt;P&gt;for only some records&lt;/P&gt;&lt;P&gt;which are contained in some internal table,&lt;/P&gt;&lt;P&gt;then we use for alll entries.&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;HR originaltext="-----------------" /&gt;&lt;P&gt;1. simple example of for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. NOTE THAT &lt;/P&gt;&lt;P&gt;In for all entries,&lt;/P&gt;&lt;P&gt;it is NOT necessary to use TWO DBTABLES.&lt;/P&gt;&lt;P&gt;(as against JOIN)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. use this program (just copy paste)&lt;/P&gt;&lt;P&gt;it will fetch data&lt;/P&gt;&lt;P&gt;from T001&lt;/P&gt;&lt;P&gt;FOR ONLY TWO COMPANIES (as mentioned in itab)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 07:18:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issues/m-p/2597730#M595086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T07:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: performance issues</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issues/m-p/2597731#M595087</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;Part1&lt;/P&gt;&lt;P&gt;*************&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES is used when we have to select values from one database table with respect to some value in an internal table&lt;/P&gt;&lt;P&gt;eg: ITAB1,ITAB2 be the internal tables....you have ITAB1 filled..then you need to get values for ITAB2 based on fields/conditions from  database table......you use select from Database table for all enties in ITAB1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please dont change the existing code because of the following reasons.....&lt;/P&gt;&lt;P&gt;For all entries is used to avoid loops and multiple read statements with respect to an internal table........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg:step1) Pass value into internal_table1 from a standard database select or otherwise&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)to get records with respect to internal_table1 one can use loop at internal_table1 or read table internal_table1  with index X.&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;Use for all entries with respect to internal_table1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Part2&lt;/P&gt;&lt;P&gt;*************&lt;/P&gt;&lt;P&gt;Inner join is used when we have to select values from one database table with respect to value of another&lt;/P&gt;&lt;P&gt;eg: Db1/DB2/DB3 be standard tables with identifiable common keys..if you do &lt;/P&gt;&lt;P&gt;select from DB1--&amp;gt; select from DB2 where key = DB1-XXX -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;&amp;gt; select from DB3 where key = DB2-XXX .....then inner join is better&lt;/P&gt;&lt;P&gt;Alternative to inner join is by going to each table and doing select single or select *&lt;/P&gt;&lt;P&gt;But if there are more than 2 tables it is advisable to use inner join than the select because performance decreases if select is used&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all helpful answers &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Byju&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 07:37:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issues/m-p/2597731#M595087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T07:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: performance issues</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issues/m-p/2597732#M595088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The differences between inner joins and for all entries was explained by the 2 responses you got already. You can see FOR ALL ENTRIES as an inner join of a DB table with an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please read the online documentation for details and check always before the select whether the inner table has entries at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coming back to your performance problem, your coding example is by itself o.k, you must test its performance with the SQL trace (transaction ST05), to see how long it needs and to judge whether it is correctly supported by database indexes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just changing coding will not help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 11:02:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issues/m-p/2597732#M595088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-25T11:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: performance issues</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issues/m-p/2597733#M595089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Use of FOR ALL Entries&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;Outer join can be created using this addition to the where clause in a select statement. It speeds up the performance tremendously, but the cons of using this variation are listed below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Duplicates are automatically removed from the resulting data set. Hence care should be taken that the unique key of the detail line items should be given in the select statement. &lt;/P&gt;&lt;P&gt;If the table on which the For All Entries IN clause is based is empty, all rows are selected into the destination table. Hence it is advisable to check before-hand that the first table is not empty. &lt;/P&gt;&lt;P&gt;If the table on which the For All Entries IN clause is based is very large, the performance will go down instead of improving. Hence attempt should be made to keep the table size to a moderate level. &lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;&amp;lt;b&amp;gt;Not Recommended&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            Loop at int_cntry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             Select single * from zfligh into int_fligh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; where cntry = int_cntry-cntry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Append int_fligh. &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; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;Recommended&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            Select * from zfligh appending table int_fligh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            For all entries in int_cntry &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            Where cntry = int_cntry-cntry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;ANOTHER WAY :&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Use of Views instead of base tables&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Many times ABAP programmers deal with base tables and nested selects. Instead it is always advisable to see whether there is any view provided by SAP on those base tables, so that the data can be filtered out directly, rather than specially coding for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;&amp;lt;b&amp;gt;Not recommended&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            Select * from zcntry where cntry like &amp;#145;IN%&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             Select single * from zflight where cntry = zcntry-cntry and airln = &amp;#145;LF&amp;#146;.&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; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;Recommended&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            Select * from zcnfl where cntry like &amp;#145;IN%&amp;#146; and airln = &amp;#145;LF&amp;#146;.&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;&amp;lt;i&amp;gt;&amp;lt;b&amp;gt;regards&lt;/P&gt;&lt;P&gt;Debjani &lt;/P&gt;&lt;P&gt;Rewards point for all helpful answers&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 11:32:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issues/m-p/2597733#M595089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-25T11:32:39Z</dc:date>
    </item>
  </channel>
</rss>

