<?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: performance problem in select in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232632#M480495</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Dont use Select..End select in side the loops, make use of READ Statements and Use FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suresh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Apr 2007 09:53:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-26T09:53:57Z</dc:date>
    <item>
      <title>performance problem in select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232630#M480493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;could someone please give me a hint about why this sentence is causing performance problems?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort i_bote by matnr idnrk vbeln posnr werks clabs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_bote.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if i_bote-WERKS_PED = i_bote-WERKS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      i_list_acu-vbeln         = i_bote-vbeln.&lt;/P&gt;&lt;P&gt;      i_list_acu-posnr         = i_bote-posnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;lt;b&amp;gt;     select t1&lt;SUB&gt;kwmeng sum( t3&lt;/SUB&gt;lfimg )&lt;/P&gt;&lt;P&gt;              from vbap as t1 join vbuk as t2&lt;/P&gt;&lt;P&gt;              on t1&lt;SUB&gt;vbeln = t2&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;              join lips as t3&lt;/P&gt;&lt;P&gt;              on t1&lt;SUB&gt;vbeln = t3&lt;/SUB&gt;vgbel and&lt;/P&gt;&lt;P&gt;                 t1&lt;SUB&gt;posnr = t3&lt;/SUB&gt;vgpos&lt;/P&gt;&lt;P&gt;              into (i_list_acu-kwmeng, g_lfimg)&lt;/P&gt;&lt;P&gt;              where t1~vbeln =  i_list_acu-vbeln&lt;/P&gt;&lt;P&gt;                and t1~posnr =  i_list_acu-posnr&lt;/P&gt;&lt;P&gt;                and t2~wbstk &amp;lt;&amp;gt; 'C'&lt;/P&gt;&lt;P&gt;       group by t1~kwmeng.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;           i_list_acu-kwmeng = i_list_acu-kwmeng - g_lfimg.&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;    endif.&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;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2007 09:48:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232630#M480493</guid>
      <dc:creator>former_member182371</dc:creator>
      <dc:date>2007-04-26T09:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: performance problem in select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232631#M480494</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;1. Remove Joins and use for all entries statement and use select into table than using select ...end select statment ..&lt;/P&gt;&lt;P&gt;2. Never use select inside loop ... endloop.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Santosh Kumar Patha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2007 09:51:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232631#M480494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-26T09:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: performance problem in select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232632#M480495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Dont use Select..End select in side the loops, make use of READ Statements and Use FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suresh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2007 09:53:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232632#M480495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-26T09:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: performance problem in select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232633#M480496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..&lt;/P&gt;&lt;P&gt;U r &amp;lt;b&amp;gt;selecting data inside a loop&amp;lt;/b&amp;gt;..which is a very bad logic..&lt;/P&gt;&lt;P&gt;so..use for all entries..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one more thing..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the loop u r retreiving the fields but &amp;lt;b&amp;gt;not storing them&amp;lt;/b&amp;gt; any where...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ur output values are always works for the last itab loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;change..the code..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2007 09:56:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232633#M480496</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-26T09:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: performance problem in select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232634#M480497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is very inefficient if u consider the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;what you can do:&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;1. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at i_bote.

if i_bote-WERKS_PED = i_bote-WERKS.

endif.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;without having loop endloop and chicking condition use read internal table with condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use select into internal table in case od select...endselect.&lt;/P&gt;&lt;P&gt;3. Instead of join, use for all entries.&lt;/P&gt;&lt;P&gt;4. In condition of select give the condition in such a order that a existing index could be selected by the optimiser.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2007 09:58:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232634#M480497</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-26T09:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: performance problem in select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232635#M480498</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;1. Avoid select inside loop.&lt;/P&gt;&lt;P&gt;2. avoid &amp;lt;&amp;gt; in the WHERE clause. delete it after fetching the data.&lt;/P&gt;&lt;P&gt;this will neglect the index scan.&lt;/P&gt;&lt;P&gt;3. Avoid Group By clause.&lt;/P&gt;&lt;P&gt;4. Split the Join on the tables vbap, vbuk and lips.&lt;/P&gt;&lt;P&gt;5. Avoid select-endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;madhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2007 09:59:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232635#M480498</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-26T09:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: performance problem in select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232636#M480499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;pablo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_bote.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if i_bote-WERKS_PED = i_bote-WERKS&lt;/P&gt;&lt;P&gt;        i_list_acu-vbeln = i_bote-vbeln.&lt;/P&gt;&lt;P&gt;       i_list_acu-posnr = i_bote-posnr.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;       APPEND i_list_acu.&lt;/P&gt;&lt;P&gt;       CLEAR i_list_acu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Endif.&lt;/P&gt;&lt;P&gt;Endloop.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use forall entries of   " i_list_acu"  into below select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select t1&lt;SUB&gt;kwmeng sum( t3&lt;/SUB&gt;lfimg )&lt;/P&gt;&lt;P&gt;from vbap as t1 join vbuk as t2&lt;/P&gt;&lt;P&gt;on t1&lt;SUB&gt;vbeln = t2&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;join lips as t3&lt;/P&gt;&lt;P&gt;on t1&lt;SUB&gt;vbeln = t3&lt;/SUB&gt;vgbel and&lt;/P&gt;&lt;P&gt;t1&lt;SUB&gt;posnr = t3&lt;/SUB&gt;vgpos&lt;/P&gt;&lt;P&gt;into (i_list_acu-kwmeng, g_lfimg)&lt;/P&gt;&lt;P&gt;where t1~vbeln = i_list_acu-vbeln&lt;/P&gt;&lt;P&gt;and t1~posnr = i_list_acu-posnr&lt;/P&gt;&lt;P&gt;and t2~wbstk &amp;lt;&amp;gt; 'C'&lt;/P&gt;&lt;P&gt;group by t1~kwmeng.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't forget to reward if useful..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2007 10:03:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232636#M480499</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-26T10:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: performance problem in select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232637#M480500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi can you make clear what is the exact performance problem you are getting.Check whether the table is itself a sorted table first.The sort process is only stable if you stable addition.The number of sort fields is also restricted to 250. The selected statement you are using may also create a performance problem. So please post the exact issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2007 10:16:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-select/m-p/2232637#M480500</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-26T10:16:26Z</dc:date>
    </item>
  </channel>
</rss>

