<?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: Long run time for ABAP Program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577090#M1272038</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECTing a large amount of data will take time. That's one of the first rules in performance tuning. So sometimes there's a bullet that you just have to bite.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only thing that I can suggest is that you make sure that t_marc is not empty and contains no duplicates comparing matnr and werks.&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, 13 May 2009 14:15:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-13T14:15:49Z</dc:date>
    <item>
      <title>Long run time for ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577087#M1272035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;When I run a program I see that 2 particular select statements are taking a very long time to execute thus causing performance issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st select statement:&lt;/P&gt;&lt;P&gt;1) SELECT banfn bnfpo bsart matnr werks&lt;/P&gt;&lt;P&gt;                 menge flief badat lfdat&lt;/P&gt;&lt;P&gt;  INTO TABLE t_pur_reqs&lt;/P&gt;&lt;P&gt;  FROM eban FOR ALL ENTRIES IN t_marc&lt;/P&gt;&lt;P&gt;  WHERE    matnr = t_marc-matnr&lt;/P&gt;&lt;P&gt;  AND      werks = t_marc-werks&lt;/P&gt;&lt;P&gt;  AND      bsart  IN s_prbsrt    "From the input variant&lt;/P&gt;&lt;P&gt;  AND      knttp  IN s_prkntt&lt;/P&gt;&lt;P&gt;  AND      banfn IN s_banfn      "From the input variant&lt;/P&gt;&lt;P&gt;  AND      bstyp = 'B'    "Purchase Doc category PR&lt;/P&gt;&lt;P&gt;  AND      loekz = ''     "Purchase Requisition Doc not deleted&lt;/P&gt;&lt;P&gt;  AND      ebakz &amp;lt;&amp;gt; 'X'   "Purchase Requisition must not be closed&lt;/P&gt;&lt;P&gt;  AND      statu &amp;lt;&amp;gt; 'B'.  "PR not transformed to PO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are about 474358 entries for this selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly, the second statement : &lt;/P&gt;&lt;P&gt;2) SELECT a&lt;SUB&gt;ebeln b&lt;/SUB&gt;ebelp c~etenr&lt;/P&gt;&lt;P&gt;                 a&lt;SUB&gt;bsart a&lt;/SUB&gt;bedat a~lifnr&lt;/P&gt;&lt;P&gt;                 b&lt;SUB&gt;matnr b&lt;/SUB&gt;werks&lt;/P&gt;&lt;P&gt;                 c&lt;SUB&gt;eindt c&lt;/SUB&gt;menge a~ekorg&lt;/P&gt;&lt;P&gt;                 c~wemng&lt;/P&gt;&lt;P&gt;                 c~slfdt&lt;/P&gt;&lt;P&gt;   INTO CORRESPONDING FIELDS OF TABLE t_poschedline&lt;/P&gt;&lt;P&gt;   FROM ekko AS a INNER JOIN&lt;/P&gt;&lt;P&gt;             ekpo AS b&lt;/P&gt;&lt;P&gt;   ON a&lt;SUB&gt;ebeln = b&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;    INNER JOIN eket AS c&lt;/P&gt;&lt;P&gt;    ON b&lt;SUB&gt;ebeln = c&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;      AND b&lt;SUB&gt;ebelp = c&lt;/SUB&gt;ebelp&lt;/P&gt;&lt;P&gt;      FOR ALL ENTRIES IN t_marc&lt;/P&gt;&lt;P&gt;                     WHERE b~matnr = t_marc-matnr&lt;/P&gt;&lt;P&gt;                         AND b~werks = t_marc-werks&lt;/P&gt;&lt;P&gt;                         AND a~bsart IN s_pobsrt&lt;/P&gt;&lt;P&gt;                         AND b~knttp IN s_pokntt&lt;/P&gt;&lt;P&gt;                         AND a~ebeln IN s_ebeln&lt;/P&gt;&lt;P&gt;                         AND a~loekz = ''   "PO header deletion indicator&lt;/P&gt;&lt;P&gt;                         AND b~loekz = ''   "PO item Deletion indicator&lt;/P&gt;&lt;P&gt;                         AND b~elikz = ''   "Delivery Not complete&lt;/P&gt;&lt;P&gt;                         AND c~menge &amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are about 7 lakh entries for this selection.&lt;/P&gt;&lt;P&gt;The program takes about 7000 secs to execute. Is there any work around for this piece of code which can decrease its execution time?&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rachana.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 13:36:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577087#M1272035</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T13:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Long run time for ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577088#M1272036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Just try like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) First fetch the data from EBAN (as you are already doing)&lt;/P&gt;&lt;P&gt;2) For all entries fetech above, Get the data from EKKO,&lt;/P&gt;&lt;P&gt;3) For all entries fetched(from EKKO) above , fetch the data from EKPO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since inner join and for all entries are used, it may take time...as for all entries will in turn do the inner join...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you are done, compare the both cases in SE30 or ST05 and check the time/performance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 13:57:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577088#M1272036</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T13:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Long run time for ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577089#M1272037</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;Also to add to above, to increase the performance of select query, use the fields in same order as in the table in the wherre conditon..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg: BSART should come first in where conditon on EBAN then MATNR or WERKS..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 13:58:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577089#M1272037</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T13:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Long run time for ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577090#M1272038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECTing a large amount of data will take time. That's one of the first rules in performance tuning. So sometimes there's a bullet that you just have to bite.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only thing that I can suggest is that you make sure that t_marc is not empty and contains no duplicates comparing matnr and werks.&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, 13 May 2009 14:15:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577090#M1272038</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T14:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Long run time for ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577091#M1272039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rachana,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to use joins here. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why dont u join EBAN and MARC?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For all entries will definitely decrease performance in this case. Get the PR details in one internal table using one query. This will be much better than using &lt;STRONG&gt;for all entries&lt;/STRONG&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ditto for PO/RFQ tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abdullah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2009 08:52:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577091#M1272039</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-14T08:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Long run time for ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577092#M1272040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to use indexes for the table where you are making "SELECT" statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2009 14:03:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577092#M1272040</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-14T14:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Long run time for ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577093#M1272041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Join EBAN and MARC.....this shud improve the performance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2009 04:44:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577093#M1272041</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-15T04:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Long run time for ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577094#M1272042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Before using for all entries addition make sure its not initial.You can just put an initial check as&lt;/P&gt;&lt;P&gt;If not t_marc is initial.&lt;/P&gt;&lt;P&gt;Your select statament&lt;/P&gt;&lt;P&gt;Endif. &lt;/P&gt;&lt;P&gt;And try avoiding into corresponding fields of table&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Akmal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2009 11:14:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/long-run-time-for-abap-program/m-p/5577094#M1272042</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-15T11:14:54Z</dc:date>
    </item>
  </channel>
</rss>

