<?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 improvement for the select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-for-the-select-statement/m-p/2481431#M559123</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;Below SELECT statement is taking too much of time.How can I modify this statement to improve the performance?&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF customer,&lt;/P&gt;&lt;P&gt;       vbeln LIKE vbfa-vbeln,&lt;/P&gt;&lt;P&gt;       kunnr LIKE kna1-kunnr,&lt;/P&gt;&lt;P&gt;       END OF customer.&lt;/P&gt;&lt;P&gt;DATA: srch_kunnr TYPE customer OCCURS 0 WITH HEADER LINE .&lt;/P&gt;&lt;P&gt;SELECT vbeln  INTO CORRESPONDING FIELDS OF TABLE&lt;/P&gt;&lt;P&gt;                                   srch_kunnr&lt;/P&gt;&lt;P&gt;                                   FROM vbpa&lt;/P&gt;&lt;P&gt;                                   WHERE parvw  = l_parvw AND&lt;/P&gt;&lt;P&gt;                                   land1 IN so_co_ag.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jun 2007 06:11:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-21T06:11:24Z</dc:date>
    <item>
      <title>Performance improvement for the select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-for-the-select-statement/m-p/2481431#M559123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;Below SELECT statement is taking too much of time.How can I modify this statement to improve the performance?&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF customer,&lt;/P&gt;&lt;P&gt;       vbeln LIKE vbfa-vbeln,&lt;/P&gt;&lt;P&gt;       kunnr LIKE kna1-kunnr,&lt;/P&gt;&lt;P&gt;       END OF customer.&lt;/P&gt;&lt;P&gt;DATA: srch_kunnr TYPE customer OCCURS 0 WITH HEADER LINE .&lt;/P&gt;&lt;P&gt;SELECT vbeln  INTO CORRESPONDING FIELDS OF TABLE&lt;/P&gt;&lt;P&gt;                                   srch_kunnr&lt;/P&gt;&lt;P&gt;                                   FROM vbpa&lt;/P&gt;&lt;P&gt;                                   WHERE parvw  = l_parvw AND&lt;/P&gt;&lt;P&gt;                                   land1 IN so_co_ag.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 06:11:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-for-the-select-statement/m-p/2481431#M559123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-21T06:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement for the select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-for-the-select-statement/m-p/2481432#M559124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Basavraj,&lt;/P&gt;&lt;P&gt; I beleive your fetching only vbeln into table, then why are you using into coresponding fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELCT VBELN&lt;/P&gt;&lt;P&gt;           INTO TABLE srch_kunnr&lt;/P&gt;&lt;P&gt;           FROM VBAP&lt;/P&gt;&lt;P&gt;           WHERE parvw = l_parvw AND&lt;/P&gt;&lt;P&gt;land1 IN so_co_ag.&lt;/P&gt;&lt;P&gt;Hope this helps you. Reply for queries, shall post the updates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.  &lt;/P&gt;&lt;P&gt;Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 06:57:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-for-the-select-statement/m-p/2481432#M559124</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-21T06:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement for the select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-for-the-select-statement/m-p/2481433#M559125</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;try like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF customer,&lt;/P&gt;&lt;P&gt; vbeln type vbeln,&lt;/P&gt;&lt;P&gt;kunnr type kunnr,&lt;/P&gt;&lt;P&gt;END OF customer.&lt;/P&gt;&lt;P&gt;DATA: srch_kunnr TYPE table of  customer.&lt;/P&gt;&lt;P&gt;SELECT vbeln kunnr INTO  TABLE srch_kunnr&lt;/P&gt;&lt;P&gt;FROM vbpa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE  parvw = l_parvw AND&lt;/P&gt;&lt;P&gt;land1 IN so_co_ag.&lt;/P&gt;&lt;P&gt;" wat is your where condition? it should be some ralation with field like&lt;/P&gt;&lt;P&gt;kunnr = vbpa-kunnr and vbeln = vbpa-vbeln, something like that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if useful,&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;seshu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 07:20:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-for-the-select-statement/m-p/2481433#M559125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-21T07:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement for the select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-for-the-select-statement/m-p/2481434#M559126</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 agree with Seshu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your where condition don't use fields neither of your table key nor of standard secondary index.&lt;/P&gt;&lt;P&gt;Consequently, that means that this statement will implies a &amp;lt;b&amp;gt;table scan&amp;lt;/b&amp;gt; on VBPA which is certainly the source of performances problem.&lt;/P&gt;&lt;P&gt;Whether you can add key field in your where condition, or eventually create a specific index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 08:44:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-for-the-select-statement/m-p/2481434#M559126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-21T08:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement for the select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-for-the-select-statement/m-p/2481435#M559127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;Thanks for your time.&lt;/P&gt;&lt;P&gt;Seshu ans alex,Could you please explain how can avoid this table scan.&lt;/P&gt;&lt;P&gt;how to create a specific index..&lt;/P&gt;&lt;P&gt;If you can modify the existing code ..that would be very helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;basavaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 03:20:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-for-the-select-statement/m-p/2481435#M559127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T03:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement for the select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-for-the-select-statement/m-p/2481436#M559128</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 too agree that you need to give any of primary key for filtering in where condition. As all vbeln needs to be considered, then just check the below code.&lt;/P&gt;&lt;P&gt;This should not take much time but just check the records in vbfa is not so huge that it leads for memory short dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF customer,&lt;/P&gt;&lt;P&gt;vbeln LIKE vbfa-vbeln,&lt;/P&gt;&lt;P&gt;parvw like vbfa-parvw,&lt;/P&gt;&lt;P&gt;land1 like vbfa-land1,&lt;/P&gt;&lt;P&gt;kunnr LIKE kna1-kunnr,&lt;/P&gt;&lt;P&gt;END OF customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: srch_kunnr TYPE customer OCCURS 0 WITH HEADER LINE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT vbeln parvw land1 INTO TABLE&lt;/P&gt;&lt;P&gt;srch_kunnr&lt;/P&gt;&lt;P&gt;FROM vbpa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE srch_kunnr NOT parvw = l_parvw AND&lt;/P&gt;&lt;P&gt;NOT land1 IN so_co_ag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Navneet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Jun 2007 21:32:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-for-the-select-statement/m-p/2481436#M559128</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-23T21:32:46Z</dc:date>
    </item>
  </channel>
</rss>

