<?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: Performance issue with a Select statement? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420349#M540286</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;If the selections are parameters, then you need to &amp;lt;b&amp;gt;Equate&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, atleast make the &amp;lt;b&amp;gt;key fields  mandatory&amp;lt;/b&amp;gt;. So that, you can get the data based on those fields, and then &amp;lt;b&amp;gt;apply other filetrations based on inputs&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jun 2007 07:25:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-28T07:25:07Z</dc:date>
    <item>
      <title>Performance issue with a Select statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420347#M540284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;                 I am facing a problem where a particular select from CAUFV view is taking nearly 1 and half hours .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT AUFNR AUART AUTYP PLNBEZ WERKS RSNUM GAMNG GMEIN&lt;/P&gt;&lt;P&gt;         GSTRP GLTRP OBJNR SFCPF DISPO FEVOR FTRMS IGMNG&lt;/P&gt;&lt;P&gt;         APPENDING CORRESPONDING FIELDS OF TABLE I_TAB&lt;/P&gt;&lt;P&gt;         FROM  CAUFV&lt;/P&gt;&lt;P&gt;         WHERE AUFNR  IN PA_AUFNR&lt;/P&gt;&lt;P&gt;         AND   PLNBEZ IN PA_MATNR&lt;/P&gt;&lt;P&gt;         AND   AUART  IN PA_AUART&lt;/P&gt;&lt;P&gt;         AND   WERKS  =  PA_WERKS&lt;/P&gt;&lt;P&gt;         AND   DISPO  IN PA_DISPO&lt;/P&gt;&lt;P&gt;         AND   FEVOR  IN PA_FEVOR&lt;/P&gt;&lt;P&gt;         AND   GSTRP  IN PA_GSTRP&lt;/P&gt;&lt;P&gt;         AND   GLTRP  IN PA_GLTRP&lt;/P&gt;&lt;P&gt;         AND   FTRMS  IN PA_FTRMS&lt;/P&gt;&lt;P&gt;         AND   LOEKZ  =  SPACE.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the selection screen none of the above mentioned parameters are entered.So maintaining indexes also wont help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly suggest if ther is sme other way of improving the performance .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ashwin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 07:18:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420347#M540284</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T07:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a Select statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420348#M540285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1st arrenge the order of field in internal table same as in order  u r fetch from database table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT AUFNR AUART AUTYP PLNBEZ WERKS RSNUM GAMNG GMEIN
GSTRP GLTRP OBJNR SFCPF DISPO FEVOR FTRMS IGMNG

FROM CAUFV into table I_TAB
WHERE AUFNR IN PA_AUFNR
AND PLNBEZ IN PA_MATNR
AND AUART IN PA_AUART
AND WERKS = PA_WERKS
AND DISPO IN PA_DISPO
AND FEVOR IN PA_FEVOR
AND GSTRP IN PA_GSTRP
AND GLTRP IN PA_GLTRP
AND FTRMS IN PA_FTRMS
AND LOEKZ = SPACE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kishan negi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 07:20:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420348#M540285</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T07:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a Select statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420349#M540286</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;If the selections are parameters, then you need to &amp;lt;b&amp;gt;Equate&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, atleast make the &amp;lt;b&amp;gt;key fields  mandatory&amp;lt;/b&amp;gt;. So that, you can get the data based on those fields, and then &amp;lt;b&amp;gt;apply other filetrations based on inputs&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 07:25:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420349#M540286</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T07:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a Select statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420350#M540287</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;  Try to avoid APPENDING, CORRESPONDING FIELDS and the where condition should be as per the Index according to the base table u r using,&lt;/P&gt;&lt;P&gt; Try to use primary key in where condition&lt;/P&gt;&lt;P&gt; Create internal table as per the Field selection remove Correspondin fields&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nandha&lt;/P&gt;&lt;P&gt;Reward if it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 07:29:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420350#M540287</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T07:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a Select statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420351#M540288</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 know that CAUFV is a view.But try changing the order of the fields in the where condition according to the fields ordered in that view.&lt;/P&gt;&lt;P&gt;For Eg: You can put AUART next to AUFNR in where condition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 07:30:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420351#M540288</guid>
      <dc:creator>former_member491305</dc:creator>
      <dc:date>2007-06-28T07:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a Select statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420352#M540289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ashwin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If performance is still an issue, you can try creating a materialized view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ganesh.S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Jul 2007 08:23:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420352#M540289</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-01T08:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a Select statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420353#M540290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ganesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please provide me with some more details for what exactly you mean by a materialized view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ashwin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2007 11:15:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420353#M540290</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-02T11:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a Select statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420354#M540291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Ashwin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to get one created with Basis help as I do no have direct access to DB.&lt;/P&gt;&lt;P&gt;If we can get that done, it will be awesome.  I will keep you posted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ganesh.S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 20:03:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420354#M540291</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T20:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a Select statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420355#M540292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is counter-intuitive, but so long as you are selecting on a single value of WERKS, try:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

RANGES: r_autyp FOR caufv-autyp.
DATA  : d1 LIKE dd07l-domvalue_l,
        d2 LIKE dd07l-domvalue_h.

r_autyp-sign   = 'I'.
SELECT domvalue_l domvalue_h
  FROM  dd07l
  INTO  (d1, d2)
  WHERE domname  = 'AUFTYP'
  AND   as4local = 'A'.
  IF d2 IS INITIAL.
    r_autyp-option = 'EQ'.
    r_autyp-low    = d1.
    CLEAR r_autyp-high.
  ELSE.
    r_autyp-option = 'BT'.
    r_autyp-low    = d1.
    r_autyp-high   = d2.
  ENDIF.
  APPEND r_autyp.
ENDSELECT.

SELECT aufnr auart autyp plnbez werks rsnum gamng gmein
        gstrp gltrp objnr sfcpf dispo fevor ftrms igmng
        APPENDING CORRESPONDING FIELDS OF TABLE i_tab
  FROM caufv
  WHERE aufnr  IN pa_aufnr
    AND plnbez IN pa_matnr
    AND auart  IN pa_auart
    AND autyp  IN r_autyp   &amp;lt;======== Forces use of index
    AND werks   = pa_werks
    AND dispo  IN pa_dispo
    AND fevor  IN pa_fevor
    AND gstrp  IN pa_gstrp
    AND gltrp  IN pa_gltrp
    AND ftrms  IN pa_ftrms
    AND loekz   = space.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Index AUFK~B is on AUTYP and WERKS. By selecting all possible values of AUTYP from the domain and using that in the select, it can forse the use of this index and should cut execution time in about half; not great, but it's a start.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Rob Burbank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 20:46:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2420355#M540292</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T20:46:36Z</dc:date>
    </item>
  </channel>
</rss>

