<?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 Select query taking more time.. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-taking-more-time/m-p/6466407#M1416452</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below inner join statement is taking more time ,  can any  body sugget me to improve the performance . I tried FOR ALL ENTRIES also but that also taking more time than inner join statement .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT a~vbeln from vbap as a inner join vakpa as b&lt;/P&gt;&lt;P&gt;      on a&lt;SUB&gt;vbeln = b&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;      into corresponding fields of table IT_VAKPA&lt;/P&gt;&lt;P&gt;      where a~WERKS IN S_IWERKS&lt;/P&gt;&lt;P&gt;      and a~pstyv NE 'ZRS'&lt;/P&gt;&lt;P&gt;      and b~vkorg = IVKORG&lt;/P&gt;&lt;P&gt;      and b~audat IN IAUDAT&lt;/P&gt;&lt;P&gt;      and b~vtweg IN IVTWEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Chetan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Jan 2010 10:07:11 GMT</pubDate>
    <dc:creator>former_member192432</dc:creator>
    <dc:date>2010-01-07T10:07:11Z</dc:date>
    <item>
      <title>Select query taking more time..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-taking-more-time/m-p/6466407#M1416452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below inner join statement is taking more time ,  can any  body sugget me to improve the performance . I tried FOR ALL ENTRIES also but that also taking more time than inner join statement .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT a~vbeln from vbap as a inner join vakpa as b&lt;/P&gt;&lt;P&gt;      on a&lt;SUB&gt;vbeln = b&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;      into corresponding fields of table IT_VAKPA&lt;/P&gt;&lt;P&gt;      where a~WERKS IN S_IWERKS&lt;/P&gt;&lt;P&gt;      and a~pstyv NE 'ZRS'&lt;/P&gt;&lt;P&gt;      and b~vkorg = IVKORG&lt;/P&gt;&lt;P&gt;      and b~audat IN IAUDAT&lt;/P&gt;&lt;P&gt;      and b~vtweg IN IVTWEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Chetan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jan 2010 10:07:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-taking-more-time/m-p/6466407#M1416452</guid>
      <dc:creator>former_member192432</dc:creator>
      <dc:date>2010-01-07T10:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Select query taking more time..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-taking-more-time/m-p/6466408#M1416453</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;VAKPA is an index table to quickly get sales orders for a given partner (sold-to party, bill-to, ship-to, etc.). It only makes sense to use it if yo know the partner number; in your case you don't, so it doesn't make sense to use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If what you need is to filter by VKORG, VTWEG, AUDAT then replace VAKPA by VBAK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rui Dantas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jan 2010 10:24:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-taking-more-time/m-p/6466408#M1416453</guid>
      <dc:creator>Rui_Dantas</dc:creator>
      <dc:date>2010-01-07T10:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Select query taking more time..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-taking-more-time/m-p/6466409#M1416454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chetan ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VAKPA is an index table. From the select query , it has been observed that you are not fetching any data from VAKPA. Only you have added some selection paramenters in where clause of select query.&lt;/P&gt;&lt;P&gt;My suggestion will be instead of using VAKPA in inner join you use VBAK along with VBAP. All the fields that you are using as selection condition from VAKPA are there in VBAK.&lt;/P&gt;&lt;P&gt;I am sure performance of query will be improved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If still duo to business logic you need to use VAKPA, try to create secondary non unique index on fields VKORD,AUDATand VTWEG on table VAKPA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I will recommend you to go for first option only. If this does not work then go for second option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopfully this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nikhil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jan 2010 11:17:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-taking-more-time/m-p/6466409#M1416454</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-07T11:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Select query taking more time..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-taking-more-time/m-p/6466410#M1416455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chetan , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prefer not to use NE in select query and also into corresponding fields of table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

SELECT a~vbeln from vbap as a inner join vakpa as b
on a~vbeln = b~vbeln
into corresponding fields of table IT_VAKPA "Try to avoid this
where a~WERKS IN S_IWERKS
"and a~pstyv NE 'ZRS'
and b~vkorg = IVKORG
and b~audat IN IAUDAT
and b~vtweg IN IVTWEG.

Delete from table T_VAKPA where pstyv = 'ZRS'.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Harsh Bhalla on Jan 7, 2010 9:52 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jan 2010 16:21:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-taking-more-time/m-p/6466410#M1416455</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-07T16:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Select query taking more time..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-taking-more-time/m-p/6466411#M1416456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;NE in a where is OK so long as the other key fileds in the WHERE are selective enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is nothing wrong with using INTO CORRESPONDING.&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, 07 Jan 2010 16:37:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-taking-more-time/m-p/6466411#M1416456</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-07T16:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Select query taking more time..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-taking-more-time/m-p/6466412#M1416457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for reply....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2010 09:32:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-taking-more-time/m-p/6466412#M1416457</guid>
      <dc:creator>former_member192432</dc:creator>
      <dc:date>2010-01-08T09:32:15Z</dc:date>
    </item>
  </channel>
</rss>

