<?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: Optimise Select in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimise-select/m-p/8817755#M1681889</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I can see, table rbkp has an index per vendor and invoice status. There is a chance to improve you current select statement by using this index.&lt;/P&gt;&lt;P&gt;Add an empty range for vendor and select using status and vendor. Then, read only the entries for the year you are looking for. Sometimes is most fast to collect many entries with an index and then try to read only the required entries from an internal table than to select the exact entries from the table in once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try that and reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jun 2012 13:35:38 GMT</pubDate>
    <dc:creator>laurent_fournier2</dc:creator>
    <dc:date>2012-06-27T13:35:38Z</dc:date>
    <item>
      <title>Optimise Select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimise-select/m-p/8817754#M1681888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have select statement that takes a lot of time to be executed&amp;nbsp; and I am looking for the best way to improve it. &lt;/P&gt;&lt;P&gt;gjahr is key field . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advice if there is any addition that can improve the performance .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52"&gt;SELECT bukrs gjahr blart belnr rmwwr bldat budat erfnam rbstat&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52"&gt;FROM&lt;/SPAN&gt; rbkp&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52"&gt;INTO&lt;/SPAN&gt; CORRESPONDING &lt;SPAN class="L1S52"&gt;FIELDS&lt;/SPAN&gt; &lt;SPAN class="L1S52"&gt;OF&lt;/SPAN&gt; &lt;SPAN class="L1S52"&gt;TABLE&lt;/SPAN&gt; it_output&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52"&gt;WHERE&lt;/SPAN&gt; gjahr &lt;SPAN class="L1S52"&gt;IN&lt;/SPAN&gt; gjahr &lt;SPAN class="L1S52"&gt;and&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rbstat = &lt;SPAN class="L1S33"&gt;'A'&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;Thanks &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;Chris &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2012 13:29:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimise-select/m-p/8817754#M1681888</guid>
      <dc:creator>k_gjergja</dc:creator>
      <dc:date>2012-06-27T13:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Optimise Select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimise-select/m-p/8817755#M1681889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I can see, table rbkp has an index per vendor and invoice status. There is a chance to improve you current select statement by using this index.&lt;/P&gt;&lt;P&gt;Add an empty range for vendor and select using status and vendor. Then, read only the entries for the year you are looking for. Sometimes is most fast to collect many entries with an index and then try to read only the required entries from an internal table than to select the exact entries from the table in once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try that and reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2012 13:35:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimise-select/m-p/8817755#M1681889</guid>
      <dc:creator>laurent_fournier2</dc:creator>
      <dc:date>2012-06-27T13:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: Optimise Select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimise-select/m-p/8817756#M1681890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GJAHR is one of the primary key but not the first, so &lt;SPAN class="short_text" id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;almost&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;all&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;databases&lt;/SPAN&gt;&lt;/SPAN&gt; won't be able to optimize access..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Execute a SQL trace and analyze execution plan. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At last solution you could create a secondary index (with RBSTAT ?), but look for any other criteria to access the data, as well as other database table that can share the required data like FI/CO documents &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2012 13:43:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimise-select/m-p/8817756#M1681890</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2012-06-27T13:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Optimise Select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimise-select/m-p/8817757#M1681891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also refrain from using INTO CORRESPONDING FIELDS OF. Create your internal table with fields in the same order as you want to select. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shravan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2012 13:58:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimise-select/m-p/8817757#M1681891</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-27T13:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Optimise Select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimise-select/m-p/8817758#M1681892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RBKP is a transactional table.&lt;/P&gt;&lt;P&gt;With your query, it will try to fetch all the data in the particular year. Of course it is going to be to a huge data. Also, RBSTAT is a non-key field. This select query &lt;STRONG&gt;HAS&lt;/STRONG&gt; to take lot of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Talk with the functional person. See if you can restrict or narrow down the number of Documents (BELNR). Apply that criteria in the ABAP and fetch the document numbers in a dummy intermediate table. Then use For all entries in your current query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would not recommend the secondary index. As the field is about status and it will rather hog system resources and might impact other standard functionality. I strongly suggest you not to do that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2012 14:47:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimise-select/m-p/8817758#M1681892</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-27T14:47:17Z</dc:date>
    </item>
  </channel>
</rss>

