<?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 improvement in select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879925#M1478349</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vinay and Shiva - have you not read &lt;SPAN __jive_macro_name="thread" id="1174072"&gt;&lt;/SPAN&gt; ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is probably entirely due to the contents of the SELECT-OPTIONS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 May 2010 13:11:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-05-06T13:11:22Z</dc:date>
    <item>
      <title>Performance improvement in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879921#M1478345</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 to improve the performance of the one custome program. I applied SQL trace &amp;amp; found out that below extract of code is taking maximum time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT vbak~vbeln&lt;/P&gt;&lt;P&gt;           vbak~erdat&lt;/P&gt;&lt;P&gt;           vbak~auart&lt;/P&gt;&lt;P&gt;           vbak~augru&lt;/P&gt;&lt;P&gt;           vbak~vkorg&lt;/P&gt;&lt;P&gt;           vbak~vtweg&lt;/P&gt;&lt;P&gt;           vbak~spart&lt;/P&gt;&lt;P&gt;           vbak~kunnr&lt;/P&gt;&lt;P&gt;           vbak~submi&lt;/P&gt;&lt;P&gt;           vbak~knumv&lt;/P&gt;&lt;P&gt;           vbuk~fksak&lt;/P&gt;&lt;P&gt;           INTO CORRESPONDING FIELDS OF TABLE it_vbak&lt;/P&gt;&lt;P&gt;           FROM vbak&lt;/P&gt;&lt;P&gt;           INNER JOIN vbuk  ON  vbak&lt;SUB&gt;vbeln EQ vbuk&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;           WHERE vbak~vbeln IN s_vbeln&lt;/P&gt;&lt;P&gt;           AND   vbak~vkorg EQ p_vkorg&lt;/P&gt;&lt;P&gt;           AND   vbak~vtweg EQ p_vtweg&lt;/P&gt;&lt;P&gt;           AND   vbak~spart IN s_spart&lt;/P&gt;&lt;P&gt;           AND   vbak~erdat IN s_erdat&lt;/P&gt;&lt;P&gt;           AND   vbak~kunnr IN s_kunnr&lt;/P&gt;&lt;P&gt;           AND   vbak~auart IN r_auart&lt;/P&gt;&lt;P&gt;           AND   vbak~augru EQ c_zcb&lt;/P&gt;&lt;P&gt;           AND   vbuk~fksak EQ c_c.&lt;/P&gt;&lt;P&gt;How can i use the for all entries in above code.. Will it enhance the performance of the code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 May 2010 11:37:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879921#M1478345</guid>
      <dc:creator>vinay_pasalkar</dc:creator>
      <dc:date>2010-05-06T11:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879922#M1478346</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 am not sure about you internal table structure &lt;/P&gt;&lt;P&gt;but usage of CORRESPONDING FIELDS OF TABLE &lt;/P&gt;&lt;P&gt;may burden the Database&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raghava Channooru&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 May 2010 12:01:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879922#M1478346</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-06T12:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879923#M1478347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Internal table has structure as follows&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF it_vbak OCCURS 0,&lt;/P&gt;&lt;P&gt;       vbeln LIKE vbak-vbeln,&lt;/P&gt;&lt;P&gt;       erdat LIKE vbak-erdat,&lt;/P&gt;&lt;P&gt;       auart LIKE vbak-auart,&lt;/P&gt;&lt;P&gt;       augru LIKE vbak-augru,&lt;/P&gt;&lt;P&gt;       vkorg LIKE vbak-vkorg,&lt;/P&gt;&lt;P&gt;       vtweg LIKE vbak-vtweg,&lt;/P&gt;&lt;P&gt;       spart LIKE vbak-spart,&lt;/P&gt;&lt;P&gt;       kunnr LIKE vbak-kunnr,&lt;/P&gt;&lt;P&gt;       ship_to LIKE vbak-kunnr,&lt;/P&gt;&lt;P&gt;       submi LIKE vbak-submi,&lt;/P&gt;&lt;P&gt;       bstkd LIKE vbkd-bstkd,&lt;/P&gt;&lt;P&gt;       bstdk LIKE vbkd-bstdk,&lt;/P&gt;&lt;P&gt;       belnr LIKE ekbe-belnr,&lt;/P&gt;&lt;P&gt;       cpudt LIKE ekbe-cpudt,&lt;/P&gt;&lt;P&gt;       fksak LIKE vbuk-fksak,&lt;/P&gt;&lt;P&gt;       fkdat LIKE vbrk-fkdat,&lt;/P&gt;&lt;P&gt;       knumv LIKE vbak-knumv,&lt;/P&gt;&lt;P&gt;       konda LIKE t188-konda,&lt;/P&gt;&lt;P&gt;       obj_key LIKE nast-objky,&lt;/P&gt;&lt;P&gt;       END OF it_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest way to improve the performance.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 May 2010 12:39:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879923#M1478347</guid>
      <dc:creator>vinay_pasalkar</dc:creator>
      <dc:date>2010-05-06T12:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879924#M1478348</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;Instead of a Join go with FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First fetch the data from VBAK into GT_VBAK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then do the for all entries on VBUK based on the entries in GT_VBAK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Please have all the fields in the where conditions in the same order as they are in the tables...for better performance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Search a VIEW which has both the tables VBAK/VBUK..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 May 2010 12:58:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879924#M1478348</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-06T12:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879925#M1478349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vinay and Shiva - have you not read &lt;SPAN __jive_macro_name="thread" id="1174072"&gt;&lt;/SPAN&gt; ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is probably entirely due to the contents of the SELECT-OPTIONS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 May 2010 13:11:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879925#M1478349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-06T13:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879926#M1478350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Suggest you take the time to review &lt;STRONG&gt;SAP Note 185530&lt;/STRONG&gt; regarding customer SD programs.  That would lead you to alternative sources for data selection, such as table VAKPA, VAPMA, etc. (but these must be turned ON in config).  You may be able to improve performance in all your SD/LE programs by using the suggestions in that SAP Note.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are similar notes for other modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone who reports SD/LE with ABAP should read the note.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 May 2010 13:09:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879926#M1478350</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-07T13:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879927#M1478351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you give it a try?&lt;/P&gt;&lt;P&gt;Create an itab with the required fields and rewrite the query removing corresponding clause. AFter the data is fetched move the data from this small itab to your main itab by small_itab1-field1 = main_tab-field1. Then blow up the small itab to free the memory.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 May 2010 10:55:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879927#M1478351</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-10T10:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879928#M1478352</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;It's good option to select the data from first table &amp;amp; then select data from second table using for all entries . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However don't you think combined ttime taken to execute two select quries will be same as time to execute single select query above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 07:24:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879928#M1478352</guid>
      <dc:creator>vinay_pasalkar</dc:creator>
      <dc:date>2010-05-11T07:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879929#M1478353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;same, same same ...&lt;/P&gt;&lt;P&gt;the INTO CORRESPONDING is o.k., and the JOIN is mandatory!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
WHERE vbak~vbeln IN s_vbeln
AND vbak~vkorg EQ p_vkorg
AND vbak~vtweg EQ p_vtweg
AND vbak~spart IN s_spart
AND vbak~erdat IN s_erdat
AND vbak~kunnr IN s_kunnr
AND vbak~auart IN r_auart
AND vbak~augru EQ c_zcb
AND vbuk~fksak EQ c_c.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only Rob is correct. There are 5 IN clauses !!!, they are dynamic, they can be empty, they can be filled which selective options or unselective options. This statements has finitely many different versions and not all can be optimized.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the content of the select-options in your example?  Which ones are empty?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 10:39:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-in-select-query/m-p/6879929#M1478353</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-11T10:39:03Z</dc:date>
    </item>
  </channel>
</rss>

