<?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: Index in ABAP program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355461#M805040</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;this may occur when you are selecting on several different fields, not only those in the secondary index.&lt;/P&gt;&lt;P&gt;If too many fields are involved, the optimizer may not find the best index any more.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Possible reasons:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- table statistics are not up to date&lt;/P&gt;&lt;P&gt;- bug in the database software (Oracle 10 had some of those...)&lt;/P&gt;&lt;P&gt;- bad ABAP coding&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, you can use a hint to force the database to use a certain index, if you know what you're doing. But keep in mind that you are not database-independent any more with your code.&lt;/P&gt;&lt;P&gt;I have done this successfully with the BKPF table (90 million entries in our box...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jan 2008 15:55:53 GMT</pubDate>
    <dc:creator>ThomasZloch</dc:creator>
    <dc:date>2008-01-23T15:55:53Z</dc:date>
    <item>
      <title>Index in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355459#M805038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem with index.  I created index on VBRK table with fieldsd VKORG &amp;amp; FKDAT and in selection query i am using only these two fields in where condition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most of the times the application is running perfectly.  But some times it is running too long and giving a dump.&lt;/P&gt;&lt;P&gt;I checked with basis &amp;amp; dba team, they are saying it is running on different index when it is giving a dump i.e., it is executing on different index some times.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody give me a suggestion why it is taking a different index?&lt;/P&gt;&lt;P&gt;Or is there any chance to give a HINT in select statement in ABAP or specifically mension the index name in select statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;shylesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 15:44:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355459#M805038</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T15:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Index in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355460#M805039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use database hints in ABAP.  See OSS note 129385 for details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 15:50:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355460#M805039</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-01-23T15:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Index in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355461#M805040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;this may occur when you are selecting on several different fields, not only those in the secondary index.&lt;/P&gt;&lt;P&gt;If too many fields are involved, the optimizer may not find the best index any more.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Possible reasons:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- table statistics are not up to date&lt;/P&gt;&lt;P&gt;- bug in the database software (Oracle 10 had some of those...)&lt;/P&gt;&lt;P&gt;- bad ABAP coding&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, you can use a hint to force the database to use a certain index, if you know what you're doing. But keep in mind that you are not database-independent any more with your code.&lt;/P&gt;&lt;P&gt;I have done this successfully with the BKPF table (90 million entries in our box...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 15:55:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355461#M805040</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-01-23T15:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Index in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355462#M805041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for quick reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you give me a sample code for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shylesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 16:03:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355462#M805041</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T16:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Index in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355463#M805042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Sailesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did you include the MANDT field (client) into your index? It matters, when you have several clients in the system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 16:05:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355463#M805042</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-01-23T16:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Index in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355464#M805043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are only two SAP delivered indexes on this table - the primary index (VBELN) and a secondary on LCNUM. It seems unlikly that any SELECT you may be using will use either of these. So I suspect that the problem is that the values you are using in the WHERE would pick up too many records to use your index effectively, so it is going for a full table scan instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in this case, my guess that using Oracle HINTS would do more harm than good. Try being more restrictive in the date range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 16:06:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355464#M805043</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T16:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Index in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355465#M805044</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 used MANDT as field in Index.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob,  but why it is going to different index when i am using a custom one?  Is SAP or Oracle will automatically use different Optimization process if it is taking long time?  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shylesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 16:20:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355465#M805044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T16:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Index in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355466#M805045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The query analyser makes the decision of which index to use (if any at all) based on your where clause and the statistical distribution of the field entries (which is why the statistics need to be up to date) If the where clause is too long or complex, it may decide that it is easier to table scan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 16:27:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355466#M805045</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T16:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Index in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355467#M805046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here's the code for BKPF and Oracle:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;      SELECT ...
             INTO TABLE ...
             FROM BKPF
             WHERE ...
               %_HINTS ORACLE 'INDEX("BKPF" "BKPF~5")'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;replace with your table VBRK and the name of your index, e.g. VBRK~Z01.&lt;/P&gt;&lt;P&gt;If your DB is not Oracle, you'll have too lookup the syntax in SAP notes or online documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 16:31:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355467#M805046</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-01-23T16:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Index in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355468#M805047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See Chris's answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 16:31:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-in-abap-program/m-p/3355468#M805047</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T16:31:13Z</dc:date>
    </item>
  </channel>
</rss>

