<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968777#M1158061</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Split this in two queries.&lt;/P&gt;&lt;P&gt;Fiirst perform inner join , then do for all entries.. Performance should increase and also check if u can create index.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vinod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Dec 2008 12:17:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-29T12:17:21Z</dc:date>
    <item>
      <title>Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968771#M1158055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi gurus,&lt;/P&gt;&lt;P&gt;Select query shown below takes about 10 to 15 minutes to complete or execute. Here gt_matnr is having approximate 4000 data entries. Please suggest any alternative way to write this query. Should I need to split this query in two?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF gt_matnr[] IS NOT INITIAL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT&lt;/P&gt;&lt;P&gt;             DISTINCT&lt;/P&gt;&lt;P&gt;             a~mblnr&lt;/P&gt;&lt;P&gt;             a~mjahr&lt;/P&gt;&lt;P&gt;             a~bwart&lt;/P&gt;&lt;P&gt;             a~matnr&lt;/P&gt;&lt;P&gt;             a~werks&lt;/P&gt;&lt;P&gt;             a~lgort&lt;/P&gt;&lt;P&gt;             a~charg&lt;/P&gt;&lt;P&gt;             a~lifnr&lt;/P&gt;&lt;P&gt;             a~menge&lt;/P&gt;&lt;P&gt;             a~meins&lt;/P&gt;&lt;P&gt;             a~erfmg&lt;/P&gt;&lt;P&gt;             a~erfme&lt;/P&gt;&lt;P&gt;             a~aufnr&lt;/P&gt;&lt;P&gt;             a~ebeln&lt;/P&gt;&lt;P&gt;             a~umwrk&lt;/P&gt;&lt;P&gt;             a~hsdat&lt;/P&gt;&lt;P&gt;             a~SHKZG&lt;/P&gt;&lt;P&gt;             b~bldat&lt;/P&gt;&lt;P&gt;             b~cputm&lt;/P&gt;&lt;P&gt;           INTO TABLE gt_mseg&lt;/P&gt;&lt;P&gt;             FROM mseg AS a&lt;/P&gt;&lt;P&gt;             INNER JOIN mkpf AS b ON&lt;/P&gt;&lt;P&gt;             a&lt;SUB&gt;mblnr = b&lt;/SUB&gt;mblnr AND&lt;/P&gt;&lt;P&gt;             a&lt;SUB&gt;mjahr = b&lt;/SUB&gt;mjahr&lt;/P&gt;&lt;P&gt;             FOR ALL ENTRIES IN gt_matnr&lt;/P&gt;&lt;P&gt;             WHERE  a~matnr = gt_matnr-matnr AND&lt;/P&gt;&lt;P&gt;                    a~werks IN s_werks AND&lt;/P&gt;&lt;P&gt;                    a~mblnr IN s_mblnr AND&lt;/P&gt;&lt;P&gt;                    a~mjahr IN s_mjahr AND&lt;/P&gt;&lt;P&gt;                    a~bwart IN s_bwart AND&lt;/P&gt;&lt;P&gt;                    a~kzbew IN s_kzbew AND&lt;/P&gt;&lt;P&gt;                    a~kzzug IN s_kzzug AND&lt;/P&gt;&lt;P&gt;                    a~sobkz IN s_sobkz AND&lt;/P&gt;&lt;P&gt;                    b~xblnr IN s_xblnr AND&lt;/P&gt;&lt;P&gt;                    a~aufnr IN s_aufnr AND&lt;/P&gt;&lt;P&gt;                    a~ebeln IN s_ebeln AND&lt;/P&gt;&lt;P&gt;                    b~CPUDT GE p_datum and&lt;/P&gt;&lt;P&gt;                    b~cputm GT p_uzeit.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advanced.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 12:08:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968771#M1158055</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-29T12:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968772#M1158056</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;Add this code before checking for initial condiditon..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
sort gt_matnr by matnr.
delete adjacent duplicates from gt_matnr comparing matnr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 12:10:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968772#M1158056</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-29T12:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968773#M1158057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If using For all entries and delete adjacent duplicates doesnt help..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the best solution is to split the query.. no other way.. i guess......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can even see..whether its possible to give any other selection criteria also.. but .. you have already given enough i think...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 12:13:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968773#M1158057</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-29T12:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968774#M1158058</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;Avoid DISTINCT statement in the select query and see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 12:13:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968774#M1158058</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2008-12-29T12:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968775#M1158059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;How abt trying with for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 12:13:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968775#M1158059</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-29T12:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968776#M1158060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have sorted gt_matnr by matnr at just before select query. Thnaks for reply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 12:17:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968776#M1158060</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-29T12:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968777#M1158061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Split this in two queries.&lt;/P&gt;&lt;P&gt;Fiirst perform inner join , then do for all entries.. Performance should increase and also check if u can create index.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vinod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 12:17:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968777#M1158061</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-29T12:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968778#M1158062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One more point apart from performance is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below statement will miss some entries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b~CPUDT GE p_datum and&lt;/P&gt;&lt;P&gt;b~cputm GT p_uzeit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(in the above case the time will be checked for all days and all the entries will be skipped if created time is less than the given time)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So that you have to use like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b&lt;SUB&gt;CPUDT GE p_datum. (In the select statement remove b&lt;/SUB&gt;cputm GT p_uzeit.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete table gt_mseg where CPUDT = p_datum and CPutm &amp;gt; p_uzeit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Sasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 12:20:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968778#M1158062</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-29T12:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968779#M1158063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for reply but select query is working correct only thing is that it is taking 15 mins to run.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 12:23:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968779#M1158063</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-29T12:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968780#M1158064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Snehal..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the select query is still using more that 15 min..after using FOR ALL ENTRIES then... split the select query...i dont think there is any other alternative..&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;&lt;/P&gt;&lt;P&gt;Also.. have a look at Sasi's point... i think he is correct...but it all depends on the scenarios.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 12:29:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968780#M1158064</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-29T12:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968781#M1158065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Snehal..&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; If the select query is still using more that 15 min..after using FOR ALL ENTRIES then... split the select query...i dont think there is any other alternative..&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; And.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Also.. have a look at Sasi's point... i think he is correct...but it all depends on the scenarios.....&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Cheers..&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't understand this, what do you mean by split the query?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, if from 4000 records of gt_matnr, none of them has duplicate material number, delete adjacent duplicates will not affect anything. Instead, delete adjacent duplicates in gt_matnr itself will add more cost to the running time of the program.&lt;/P&gt;&lt;P&gt;And yes snehal, sasi is correct. If your query give correct result now, it does not mean it will give correct result for all cases. If your date is 28th of December and yoru time is 10 AM, you will only get data that creation time is greater than 10 am. You will miss data that created in 29th of December from 00:00 to 10 AM and 30th of December from 00:00 to 10 AM. &lt;/P&gt;&lt;P&gt;Try do a sql trace also and check whether your select statement hit the index or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abraham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2008 02:33:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968781#M1158065</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-30T02:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968782#M1158066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Abraham..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have a point buddy...... but..as per the given code .... i am not really sure whether GT_MATNR has MATNR has key field.. if thats the case..DELETE ADJACENT is not required..but otherwise..it is...!!....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So..it all depends on .. how GT_MATNR is populated...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2008 06:49:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4968782#M1158066</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-30T06:49:44Z</dc:date>
    </item>
  </channel>
</rss>

