<?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: Optimized select statement - performance issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimized-select-statement-performance-issue/m-p/8620498#M1663884</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Just as&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt; &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://answers.sap.com/people/vinit.joshi3" id="jive-4096378855556322566560"&gt;Vinit &lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;said: Remove SELECT STATEMENT inside the loop. Get it before looping using FOR ALL ENTRIES then in your looping use READ TABLE.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jake&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Mar 2012 04:49:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-03-20T04:49:16Z</dc:date>
    <item>
      <title>Optimized select statement - performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimized-select-statement-performance-issue/m-p/8620494#M1663880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I have a select statement on table FMFCTRT which is hitting the performance badly in my report which is called inside a BSEG table loop. I have included all the primary keys in the where condition still I do not see the difference in performance. Can anyone check and see if this is a optimized select statement on FMFCTRT table ?&lt;/P&gt;&lt;P&gt;SELECT BESCHR INTO LS_FILSTRU-BESCHR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;UP TO 1 ROWS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM FMFCTRT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;WHERE SPRAS = SY-LANGU&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;AND&amp;nbsp;&amp;nbsp; FIKRS = L_FIKRS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;AND&amp;nbsp;&amp;nbsp; FICTR = LS_FILSTRU-FISTL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt; AND&amp;nbsp;&amp;nbsp; DATBIS =&amp;gt; LS_FILSTRU-BLDAT.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Praneeth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Mar 2012 11:12:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimized-select-statement-performance-issue/m-p/8620494#M1663880</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-17T11:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Optimized select statement - performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimized-select-statement-performance-issue/m-p/8620495#M1663881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Remove select statement if its inside the loop. Write before looping. &lt;/P&gt;&lt;P&gt;Then use READ TABLE inside your bseg loop to read respective entries from your&amp;nbsp; FMFCTRT internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Mar 2012 19:35:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimized-select-statement-performance-issue/m-p/8620495#M1663881</guid>
      <dc:creator>former_member189779</dc:creator>
      <dc:date>2012-03-17T19:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Optimized select statement - performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimized-select-statement-performance-issue/m-p/8620496#M1663882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Avoid using select inside Loop as mentioned by Vinit. Apart from this check the database statistics in DB20 for the table and ask your basis team to update the same if its needed.&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;Vijay V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Mar 2012 22:23:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimized-select-statement-performance-issue/m-p/8620496#M1663882</guid>
      <dc:creator>vijaymanikandan</dc:creator>
      <dc:date>2012-03-17T22:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Optimized select statement - performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimized-select-statement-performance-issue/m-p/8620497#M1663883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I would use a SELECT SINGLE rather than UP TO 1 ROWS, but I don't think that is your problem. Check you SELECT on BSEG. &lt;/P&gt;&lt;P&gt;Also - how many records in the BSEG loop?&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2012 15:03:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimized-select-statement-performance-issue/m-p/8620497#M1663883</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-19T15:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Optimized select statement - performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimized-select-statement-performance-issue/m-p/8620498#M1663884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Just as&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt; &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://answers.sap.com/people/vinit.joshi3" id="jive-4096378855556322566560"&gt;Vinit &lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;said: Remove SELECT STATEMENT inside the loop. Get it before looping using FOR ALL ENTRIES then in your looping use READ TABLE.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jake&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2012 04:49:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimized-select-statement-performance-issue/m-p/8620498#M1663884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-20T04:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Optimized select statement - performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimized-select-statement-performance-issue/m-p/8620499#M1663885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I really don't think having the SELECT in the LOOP is the problem.&lt;/P&gt;&lt;P&gt;It's more likely that the BSEG internal table has multiple entries for the same value of the primary keys. So the samne SELKECT is done over and over for no particular reason.&lt;/P&gt;&lt;P&gt;Only do the SELECT once for each unique value of the primary key.&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2012 14:35:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimized-select-statement-performance-issue/m-p/8620499#M1663885</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-20T14:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Optimized select statement - performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimized-select-statement-performance-issue/m-p/8620500#M1663886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I also think you should not use the select within a loop. For every entry in the loop a database select is performed. Better is to select all entries at once and use a read.&lt;/P&gt;&lt;P&gt;Furthermore, when you are only dealing with cleared items, open iotems or customer items, you should consider to use the tabel BSIS, BSAS or BSID instead, since they are for that purpose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2012 14:58:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimized-select-statement-performance-issue/m-p/8620500#M1663886</guid>
      <dc:creator>PeterJonker</dc:creator>
      <dc:date>2012-03-20T14:58:57Z</dc:date>
    </item>
  </channel>
</rss>

