<?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: Optimizing select question .. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147004#M991561</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ah thanks that helps , when searching I found DD07D and I could not find related tables on the fiedtypes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for company codes I have around 30 company codes .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it also allowed from an index point of view to use the BT in the range option or does the index only work when using EQ in the s_bukrs ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ok I will ask if bstat = space should be sufficient. the requirement is to make a report which shows all the LIFNR which are not used in a certain period till now.  so I start at bkpf with the budat , put those values in a table and select all the lifnr from BSAK and BSIK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;arthur&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: A. de Smidt on Jul 14, 2008 12:05 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Jul 2008 10:02:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-14T10:02:10Z</dc:date>
    <item>
      <title>Optimizing select question ..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147000#M991557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a select statement which takes an awful time to execute&lt;/P&gt;&lt;P&gt;the problem is that the only factor I know is the BUDAT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now I was looking if I could use an index. there is an index on the BKPF which contains the BUDAT, BSTAT and BUKRS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to make this index happen I have to add alt the available BSTATs into a range and all available BUKRS to a range and add it to the select &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now I wonder if this would really enhance the performance of the select statement ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  SELECT bukrs belnr gjahr FROM bkpf
           INTO CORRESPONDING FIELDS OF TABLE ta_bkpf
           WHERE budat GE p_budat.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;arthur de smidt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2008 09:29:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147000#M991557</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-14T09:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Optimizing select question ..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147001#M991558</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;doing so will improve the performance for that if you want to explicitly refer the index name even ...also remove CORRESPONDING FIELDS OF TABLE to INTO TABLE statement ..&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  SELECT bukrs belnr gjahr FROM bkpf
           INTO TABLE ta_bkpf
           WHERE budat GE p_budat and
                        bstat in s_bstat and
                        bukrs in s_bukrs 
            %_HINTS ORACLE 'INDEX("BKPF""Z02")'. " Z02 is the name of secondary index... &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2008 09:34:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147001#M991558</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-14T09:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Optimizing select question ..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147002#M991559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ah I will give it a ttry, but still looking how to select all the possible status for BSTAT , the domain points to fixed values ? is there anyway to select those so I can append them to the s_bstat ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2008 09:44:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147002#M991559</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-14T09:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Optimizing select question ..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147003#M991560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;Most&lt;/EM&gt; of the time it is sufficient to select BSTAT = space, since this will give you all &lt;EM&gt;real&lt;/EM&gt; documents with actual line items, the rest is parked documents, clearing documents etc. (see the domain values). You might want to analyse whether BSTAT = space is sufficient. Otherwise, domain values are stored in table DD07L.&lt;/P&gt;&lt;P&gt;As for BUKRS, how many different ones do you have? If just a few, putting them in a range as single values for the select should be beneficial.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2008 09:55:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147003#M991560</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-07-14T09:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Optimizing select question ..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147004#M991561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ah thanks that helps , when searching I found DD07D and I could not find related tables on the fiedtypes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for company codes I have around 30 company codes .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it also allowed from an index point of view to use the BT in the range option or does the index only work when using EQ in the s_bukrs ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ok I will ask if bstat = space should be sufficient. the requirement is to make a report which shows all the LIFNR which are not used in a certain period till now.  so I start at bkpf with the budat , put those values in a table and select all the lifnr from BSAK and BSIK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;arthur&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: A. de Smidt on Jul 14, 2008 12:05 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2008 10:02:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147004#M991561</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-14T10:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Optimizing select question ..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147005#M991562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; is it also allowed from an index point of view to use the BT in the range option or does the index only work when using EQ in the s_bukrs ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I strongly recommend EQ instead of BT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; the requirement is to make a report which shows all the LIFNR which are not used in a certain period till now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, in this case it might be more efficient to check for vendor &lt;EM&gt;balances&lt;/EM&gt; in table LFC1, you might not need to read single items at all.&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>Mon, 14 Jul 2008 10:38:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147005#M991562</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-07-14T10:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Optimizing select question ..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147006#M991563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hmmm I had checked the LFC1 table yesterday. problem is that we also have to calculate all the periodes for all companies where the vendor is created for and therefor has a record in LFC1. I have to add all the periodes to find if there are booking.  when I look at the table I have 1 milion records but most records have no amount in the perriodes and there is no field in the LFC1 which shows a total or something..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;guess I could use the table but I think I will transfer the problem from select delay to abap calculations over 1 milion records .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or is there a easy way to regocnize without calculation or clear empty rows in this table ?? I guess more thath 80% has 0 bookings  in this table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;arthur de smidt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2008 12:15:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147006#M991563</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-14T12:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Optimizing select question ..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147007#M991564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see what you mean. It's difficult to make another suggestion from the distance for this special case. You might have to compare both options (LFC1 or BKPF/BSIK/BSAK). Make sure you always use qualified keys when working with database or internal tables, the rest is finetuning.&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>Mon, 14 Jul 2008 12:43:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147007#M991564</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-07-14T12:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Optimizing select question ..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147008#M991565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yep the condition on the BKPF really worked, only I tried to omplement it for the BSAK also and used index 5 &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  SELECT lifnr FROM bsak
           INTO TABLE ta_cred
           FOR ALL ENTRIES IN ta_bkpf
           WHERE bukrs EQ ta_bkpf-bukrs
           AND belnr EQ ta_bkpf-belnr
           AND gjahr EQ ta_bkpf-gjahr
           and BUZEI le '100'
           %_HINTS ORACLE 'INDEX("BKPF""Z05")'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;only this had a 4 times worst performance that just &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  SELECT lifnr FROM bsak
           INTO TABLE ta_cred
           FOR ALL ENTRIES IN ta_bkpf
           WHERE bukrs EQ ta_bkpf-bukrs
           AND belnr EQ ta_bkpf-belnr
           AND gjahr EQ ta_bkpf-gjahr

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the LFC1 is also nice but perhaps if we implement BW that we make a substract of that one for direct access. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;arthur de smidt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2008 12:59:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147008#M991565</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-14T12:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Optimizing select question ..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147009#M991566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Using an Index When You Don't Have all of the Fields|&lt;A class="jive_macro jive_macro_blogpost" href="https://community.sap.com/" __jive_macro_name="blogpost" modifiedtitle="true" __default_attr="42298"&gt;&lt;/A&gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[ Quickly Retrieving FI document Data from BSEG|&lt;A class="jive_macro jive_macro_blogpost" href="https://community.sap.com/" __jive_macro_name="blogpost" modifiedtitle="true" __default_attr="45043"&gt;&lt;/A&gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2008 13:23:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimizing-select-question/m-p/4147009#M991566</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-14T13:23:52Z</dc:date>
    </item>
  </channel>
</rss>

