<?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: Program execution taking a long time in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190868#M1519759</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Avishek,&lt;/P&gt;&lt;P&gt;check this thread&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="9414222"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Bala Duvvuri&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Aug 2010 17:19:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-08-13T17:19:49Z</dc:date>
    <item>
      <title>Program execution taking a long time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190865#M1519756</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;&lt;/P&gt;&lt;P&gt;We have a program which has a loop inside which; in order to optimize the performance,&lt;/P&gt;&lt;P&gt;we have used read statements with Binary Search after sorting the internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code inside the loop contains multiple read statements (as mentioned) followed by one BDC and one Update statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When we executed the program by scheduling it in background it took 33000 seconds to execute; which is around 9 hours which is not acceptable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mentioned herewith are the findings which might help you to analyze and propose the solution.&lt;/P&gt;&lt;P&gt;1) Records in scope for the program to process : 45000&lt;/P&gt;&lt;P&gt;2) We have also noticed that the time taken for processing a fixed number of records increases gradually with the passage of time.&lt;/P&gt;&lt;P&gt; for example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the 1st 100 records executed in 25secs&lt;/P&gt;&lt;P&gt;next 100 records executed in 75secs&lt;/P&gt;&lt;P&gt;the next 100 in 100 secs and ....... the gradual increase continues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just for your information sake: there are no select queries inside the loop ... endloop.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly provide a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Avishek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Aug 2010 15:10:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190865#M1519756</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-12T15:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Program execution taking a long time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190866#M1519757</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;have you traced the program (SE30, ST12) in order to see where the time is spent?&lt;/P&gt;&lt;P&gt;Once you found the time consumers you can think about (or ask for help) how to optimize...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Aug 2010 17:05:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190866#M1519757</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2010-08-12T17:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Program execution taking a long time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190867#M1519758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can't wait to see some code!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 13:39:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190867#M1519758</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-13T13:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Program execution taking a long time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190868#M1519759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Avishek,&lt;/P&gt;&lt;P&gt;check this thread&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="9414222"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Bala Duvvuri&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 17:19:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190868#M1519759</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-13T17:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Program execution taking a long time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190869#M1519760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Avishek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any other of optimizing the code by way of local table buffering, using field symbols, etc. The above mentioned things are a part of the general coding guidelines and will help to optimize the code 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;Thanks,&lt;/P&gt;&lt;P&gt;Samantak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Aug 2010 04:18:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190869#M1519760</guid>
      <dc:creator>samantak_chatterjee</dc:creator>
      <dc:date>2010-08-15T04:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Program execution taking a long time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190870#M1519761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Avishek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Increasing time, it's a strange behavior here on your description.&lt;/P&gt;&lt;P&gt;Questions:&lt;/P&gt;&lt;P&gt;1) This BDC is standard?&lt;/P&gt;&lt;P&gt;2) Are you refreshing BDC before set it again?&lt;/P&gt;&lt;P&gt;3) This UPDATE have index support or it always run a sequencial access on databases?&lt;/P&gt;&lt;P&gt;4) You need execute this sequencially or you can take advantage of app servers running in parallel?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Fernando Da Ró&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Aug 2010 22:42:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190870#M1519761</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-15T22:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Program execution taking a long time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190871#M1519762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Avishek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree with Fernando. You may try using a Function Module for BDC and Update, which will get called in parallel procress.&lt;/P&gt;&lt;P&gt;You can call the function Module for a set of 100 - 500 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Preyansh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Aug 2010 08:28:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190871#M1519762</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-16T08:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Program execution taking a long time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190872#M1519763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please show the code, change name if you don't want to show internals.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Aug 2010 08:02:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190872#M1519763</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-17T08:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Program execution taking a long time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190873#M1519764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can we using cursor?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Sep 2010 11:42:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190873#M1519764</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-02T11:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Program execution taking a long time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190874#M1519765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest to perform following steps to optimize your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please run SE30 runtime analysis and figure out if ABAP/Database/System is taking time&lt;/P&gt;&lt;P&gt;Also run Code inspector &amp;amp; Extended program check to remove all warnings errors&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then run ST05 and figure out if any select query is taking time. In this case use secondary index if required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have select query's in your program avoid correponding clause and ensure you select fields in the order they are defined in the database tables... you internal table structure should match the sequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try and use for all entries if required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;restrict your database selects by ensuring you dont select unwanted records while data fetching.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding ABAP code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use binary search..&lt;/P&gt;&lt;P&gt;clear your work areas and internal tables&lt;/P&gt;&lt;P&gt;try and use field symbols if your modyfing internal tables&lt;/P&gt;&lt;P&gt;if possible your views&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a nice day&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sumit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Sep 2010 21:07:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190874#M1519765</guid>
      <dc:creator>former_member193284</dc:creator>
      <dc:date>2010-09-18T21:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Program execution taking a long time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190875#M1519766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have standard BAPI's available then avoid BDC and go for that, you can see the difference in the execution time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@-Aniesh - Cursors never improve the execution time !!! .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the 1st 100 records executed in 25secs&lt;/P&gt;&lt;P&gt;next 100 records executed in 75secs&lt;/P&gt;&lt;P&gt;the next 100 in 100 secs and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have told that you are using read statement inside the loop, that too it triggers multiple times.&lt;/P&gt;&lt;P&gt;have you checked how many times it gets triggered for the above three steps ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And donot expect a mass upload program to get finished within a short time &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Sep 2010 22:17:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-execution-taking-a-long-time/m-p/7190875#M1519766</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-09-18T22:17:03Z</dc:date>
    </item>
  </channel>
</rss>

