<?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 Performance improvement inside the loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212409#M1716478</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;I have to do the performance tuning of the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have inside the loop 2 select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single servorder from vbak into table itab1 where vbeln eq itab-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single * from zzsdflightinfo into table it_flightinfo where zzservorder eq itab1-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what i have done is the taken 2 select statement out side the loop and used for all entries statement and using read table&lt;/P&gt;&lt;P&gt;inside the loop, i have read the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one this way we can do best performannce improvement or any other method is there for above code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Udupi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 19 Jan 2013 06:00:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2013-01-19T06:00:26Z</dc:date>
    <item>
      <title>Performance improvement inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212409#M1716478</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;I have to do the performance tuning of the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have inside the loop 2 select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single servorder from vbak into table itab1 where vbeln eq itab-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single * from zzsdflightinfo into table it_flightinfo where zzservorder eq itab1-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what i have done is the taken 2 select statement out side the loop and used for all entries statement and using read table&lt;/P&gt;&lt;P&gt;inside the loop, i have read the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one this way we can do best performannce improvement or any other method is there for above code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Udupi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Jan 2013 06:00:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212409#M1716478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-01-19T06:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212410#M1716479</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;One request from my side,&lt;/P&gt;&lt;P&gt;Don't use select statement inside loop.&lt;/P&gt;&lt;P&gt;If your client side, they will send you out.&lt;/P&gt;&lt;P&gt;Remove that one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rearrange your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Jan 2013 06:03:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212410#M1716479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-01-19T06:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212411#M1716480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Program written long before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;requirement come to us to tuning.. thats what i told, i have taken out select statement from loop and used for all entries and used inside reaad statement. this is best way to performaance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Jan 2013 06:07:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212411#M1716480</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-01-19T06:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212412#M1716481</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;You have to do like this only by using for all entries.but if you need to call loop inside the loop only means first select the entries outside the loop and use the Parallel cursor method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best way is select all the entries from outside of the loop using for all entries and use read statement to read the entries inside the loop with binary search .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Jan 2013 06:14:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212412#M1716481</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-01-19T06:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212413#M1716482</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;very good.&lt;/P&gt;&lt;P&gt;Try to use always read statement and provide statement.&lt;/P&gt;&lt;P&gt;try to avoid loop inside loop as much as possible.&lt;/P&gt;&lt;P&gt;If your using for HR module, use LDB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Jan 2013 06:26:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212413#M1716482</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-01-19T06:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212414#M1716483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have writen like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not itab[] is initial.&lt;/P&gt;&lt;P&gt;select vbeln zzservord into table it_vbak from vbak&lt;/P&gt;&lt;P&gt;for all entries in itab where vbeln eq itaab-vbeln.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it_vbak[] is not initital.&lt;/P&gt;&lt;P&gt;select * from zzsdflight into table it_flightinfo w&lt;/P&gt;&lt;P&gt;for all entries in it_vbak&lt;/P&gt;&lt;P&gt;where zzservorder eqq it_flightinfo-zzservorder.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_vbak with key vbeln eq it_vbak-vbeln.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;read table it_flightinf with key zzservorder eq it_vbak-zzserovrder&lt;/P&gt;&lt;P&gt;if subrc eq 0.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any suggestion to improve performaance in this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;udupi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Jan 2013 07:32:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212414#M1716483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-01-19T07:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212415#M1716484</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;Use binary search in read statement. before that sort both internal tables followed by key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Balaji.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Jan 2013 07:39:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212415#M1716484</guid>
      <dc:creator>former_member392866</dc:creator>
      <dc:date>2013-01-19T07:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212416#M1716485</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;In addition to this Befor reading the Tables in the loop SORT the internal tables by Key and use the Binary search addition to your READ statement if your internal table is a standard internal table .this will increase your program perfromance more.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Jan 2013 07:41:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212416#M1716485</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-01-19T07:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212417#M1716486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi abap udupi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt; 1.&amp;nbsp; first sort itab[].&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;sort itab[] by vbeln. &lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;2. then need to delete duplicate entries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete adjacent duplicates from itab[] comparing vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. need to delete all blank joining fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete itab[] where vbeln eq space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when use read table statement use binary search. but before use it sort it_vbak by vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt; sort it_vbak by vbeln.&lt;/P&gt;&lt;P&gt;read table it_vbak into wa_vbak with key vbeln eq itab-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;follow it......it will be helpful to you...this is the best performance tuning&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Jan 2013 07:51:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212417#M1716486</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-01-19T07:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212418#M1716487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ABAP Udupi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U'r code above looks just fine. Try using EPC check and Sql Trace after activating u'r program.&lt;/P&gt;&lt;P&gt;You can consider following points to tune performance when working with a loop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Sort the Tables based on key fields using " BY " keyword. &lt;/P&gt;&lt;P&gt;2. Use Read table statements within the loop based on binary key search.&lt;/P&gt;&lt;P&gt;3. Use Parallel cursor processing Technique when using Loop within a Loop.&lt;/P&gt;&lt;P&gt;4. Clear the work area after Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz reward points if it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Vivek &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Jan 2013 07:53:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212418#M1716487</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-01-19T07:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212419#M1716488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just some additions to Vivek's answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. You can use internal table of TYPE SORTED TABLE OF(saves the sort statement) with UNIQUE/NON-UNIQUE KEY keyyy(the value on which you are retrieving data)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. You can use loop with where clause for nested loops. Else if data is huge, you can use parallel cursor also. Both of them work efficiently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Clear the work areas just before endloop. &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1142/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Jan 2013 09:38:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212419#M1716488</guid>
      <dc:creator>former_member491621</dc:creator>
      <dc:date>2013-01-19T09:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Performance improvement inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212420#M1716489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And still some millisecs to gain: &lt;/P&gt;&lt;P&gt;If you don't need them, don't read them. &lt;/P&gt;&lt;P&gt;Your read statement should explicitly state, which fields you need to know by adding&lt;/P&gt;&lt;P&gt;... transporting f1 f2 f3.&lt;/P&gt;&lt;P&gt;Even faster, use field-symbols instead of workarea. But beware of unintentional changes.&lt;/P&gt;&lt;P&gt;read table .... assigning &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;Every memory transport consumes time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jörg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2013 10:46:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-improvement-inside-the-loop/m-p/9212420#M1716489</guid>
      <dc:creator>jrg_wulf</dc:creator>
      <dc:date>2013-01-21T10:46:24Z</dc:date>
    </item>
  </channel>
</rss>

