<?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 Code to be optimized in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-be-optimized/m-p/7200548#M1521157</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 database 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;Is there any specific reason why the performance is getting progressively degraded?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly provide a solution for optimizing the performance.&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>Fri, 13 Aug 2010 01:57:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-08-13T01:57:17Z</dc:date>
    <item>
      <title>Code to be optimized</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-be-optimized/m-p/7200548#M1521157</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 database 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;Is there any specific reason why the performance is getting progressively degraded?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly provide a solution for optimizing the performance.&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>Fri, 13 Aug 2010 01:57:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-be-optimized/m-p/7200548#M1521157</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-13T01:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Code to be optimized</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-be-optimized/m-p/7200549#M1521158</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;performance issue in your pgm is: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Loop statement&lt;/P&gt;&lt;P&gt;2) Read statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Main reason to take time is updating the table.  my suggestion is  reduce the data passing to diffrent  tables(reduce READ Staements as much as in loop ).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 04:24:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-be-optimized/m-p/7200549#M1521158</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-13T04:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Code to be optimized</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-be-optimized/m-p/7200550#M1521159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Avishek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Few questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I hope you've SORTed the table before using BINARY SEARCH.&lt;/P&gt;&lt;P&gt;2. How did you measure the runtimes of blocks of 100 records each ?&lt;/P&gt;&lt;P&gt;3. Are you directly updating your database table inside the LOOP ? You need to remove the stmt &amp;amp; put it outside of the LOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if this helps but there are a couple of [blogs|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/u/46921] &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt;; by Siegfried Boes which might interest you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Aug 13, 2010 10:11 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 04:41:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-be-optimized/m-p/7200550#M1521159</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-08-13T04:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Code to be optimized</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-be-optimized/m-p/7200551#M1521160</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 it possible for you to post the contents of the code within the LOOP....ENDLOOP? &lt;/P&gt;&lt;P&gt;Will be difficult to comment anything without having a look at the code if there are really no Select statements within and any direct hits on the database tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Harsh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 06:34:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-be-optimized/m-p/7200551#M1521160</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-13T06:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Code to be optimized</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-be-optimized/m-p/7200552#M1521161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Avishek,&lt;/P&gt;&lt;P&gt;You can use parallel RFC &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 09:42:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-be-optimized/m-p/7200552#M1521161</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-13T09:42:07Z</dc:date>
    </item>
  </channel>
</rss>

