<?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: To optimize expensive select queries ... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-optimize-expensive-select-queries/m-p/6204868#M1376747</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;The EKPO query is perfectly ok as you are using PO no to get PO line items. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the EKBO query you can add MBLNR also as your driver table is t_MSEG - but still it looks quite ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put the initial check for the driver table in both these queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So where are you getting the performance problem ? In production or Quality ? It might be the case that database has too much data and it's time to archive some data so that the system runs better. Just check the no of entries in all these table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About BKPF access - please see if yiu can use other tables like BSIS, BSID etc&lt;/P&gt;&lt;P&gt;-ashim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Oct 2009 11:14:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-10-08T11:14:17Z</dc:date>
    <item>
      <title>To optimize expensive select queries ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-optimize-expensive-select-queries/m-p/6204867#M1376746</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 optimization for report in sap abap.&lt;/P&gt;&lt;P&gt;Below query for EKPO  , EKBE and BKPF is taking much time , i tried but i did not find any alternate subindexes or any other solution . please any body suggest me how optimize it .. Is there any other way to fetch the data or what i can do..&lt;/P&gt;&lt;P&gt;SELECT ebeln ebelp pstyp bednr mtart mwskz FROM ekpo  " Addition of  bednr mtart mwskz by venkat on 21/9/2009&lt;/P&gt;&lt;P&gt;         INTO TABLE t_ekpo&lt;/P&gt;&lt;P&gt;         FOR ALL ENTRIES IN t_ekko&lt;/P&gt;&lt;P&gt;         WHERE ebeln = t_ekko-ebeln AND&lt;/P&gt;&lt;P&gt;               loekz = ' ' AND&lt;/P&gt;&lt;P&gt;               pstyp IN r_pstyp.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;SELECT ebeln ebelp belnr gjahr lfbnr SHKZG menge FROM ekbe&lt;/P&gt;&lt;P&gt;INTO TABLE t_pohis&lt;/P&gt;&lt;P&gt;         FOR ALL ENTRIES IN t_mseg&lt;/P&gt;&lt;P&gt;WHERE ebeln = t_mseg-ebeln AND&lt;/P&gt;&lt;P&gt;               ebelp = t_mseg-ebelp AND&lt;/P&gt;&lt;P&gt;               gjahr = t_mseg-mjahr AND&lt;/P&gt;&lt;P&gt;               bewtp = 'Q'          AND&lt;/P&gt;&lt;P&gt;               lfbnr = t_mseg-lfbnr .&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;SELECT belnr bukrs gjahr awkey blart FROM bkpf&lt;/P&gt;&lt;P&gt;         INTO TABLE t_bkpf&lt;/P&gt;&lt;P&gt;         WHERE bukrs IN s_bukrs AND&lt;/P&gt;&lt;P&gt;               gjahr IN r_year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;chetan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message - Please see &lt;SPAN __jive_macro_name="thread" id="1283414"&gt;&lt;/SPAN&gt; before posting - post locked&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Oct 8, 2009 9:24 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2009 05:38:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-optimize-expensive-select-queries/m-p/6204867#M1376746</guid>
      <dc:creator>former_member192432</dc:creator>
      <dc:date>2009-10-08T05:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: To optimize expensive select queries ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-optimize-expensive-select-queries/m-p/6204868#M1376747</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;The EKPO query is perfectly ok as you are using PO no to get PO line items. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the EKBO query you can add MBLNR also as your driver table is t_MSEG - but still it looks quite ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put the initial check for the driver table in both these queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So where are you getting the performance problem ? In production or Quality ? It might be the case that database has too much data and it's time to archive some data so that the system runs better. Just check the no of entries in all these table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About BKPF access - please see if yiu can use other tables like BSIS, BSID etc&lt;/P&gt;&lt;P&gt;-ashim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2009 11:14:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-optimize-expensive-select-queries/m-p/6204868#M1376747</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-08T11:14:17Z</dc:date>
    </item>
  </channel>
</rss>

