<?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: Loop inise loop performance affected in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078258#M1505604</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi karthik,&lt;/P&gt;&lt;P&gt;Observe the changes in your code.&lt;/P&gt;&lt;P&gt;I am using parallel cursor approach to improve the performance of nested loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{LOOP AT it_part.&lt;/P&gt;&lt;P&gt;IF it_part-belnr NE it_part-rebzg AND it_part-augbl EQ ' '.&lt;/P&gt;&lt;P&gt;CLEAR w_count.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;read table it_pos with key belnr = it_part-rebzg and konto = it_part-konto&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOOP AT it_pos FROM sy-tabix&lt;/STRONG&gt;. " and blart = 'DZ' and blart = 'AB'.&lt;/P&gt;&lt;P&gt;it_part-dmshb = it_part-dmshb * -1.&lt;/P&gt;&lt;P&gt;it_pos-dmshb = it_pos-dmshb - it_part-dmshb.&lt;/P&gt;&lt;P&gt;MODIFY it_pos.&lt;/P&gt;&lt;P&gt;w_count = w_count + 1.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;IF w_count EQ 0.&lt;/P&gt;&lt;P&gt;APPEND it_part TO it_pos.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;IF it_part-belnr EQ it_part-rebzg AND it_part-augbl NE ' '.&lt;/P&gt;&lt;P&gt;APPEND it_part TO it_part_filter.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;IF it_part-belnr EQ it_part-rebzg AND it_part-augbl EQ ' '.&lt;/P&gt;&lt;P&gt;CLEAR w_on_acc_total.&lt;/P&gt;&lt;P&gt;wa_on_acc-konto = it_part-konto.&lt;/P&gt;&lt;P&gt;wa_on_acc-dmshb = it_part-dmshb.&lt;/P&gt;&lt;P&gt;APPEND wa_on_acc TO it_on_acc.&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;Regards,&lt;/P&gt;&lt;P&gt;Vinod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Jun 2010 11:48:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-06-28T11:48:20Z</dc:date>
    <item>
      <title>Loop inise loop performance affected</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078251#M1505597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Friends,&lt;/P&gt;&lt;P&gt;                &lt;/P&gt;&lt;P&gt;                  In my report we used loop inside the loop so the performance is affecting much worse. so Kindly help me to resolve this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{LOOP AT it_part.&lt;/P&gt;&lt;P&gt;    IF it_part-belnr NE it_part-rebzg AND it_part-augbl EQ ' '.&lt;/P&gt;&lt;P&gt;      CLEAR w_count.&lt;/P&gt;&lt;P&gt;      LOOP AT it_pos WHERE belnr = it_part-rebzg and  konto = it_part-konto.  " and blart = 'DZ' and blart = 'AB'.&lt;/P&gt;&lt;P&gt;        it_part-dmshb = it_part-dmshb * -1.&lt;/P&gt;&lt;P&gt;        it_pos-dmshb = it_pos-dmshb - it_part-dmshb.&lt;/P&gt;&lt;P&gt;        MODIFY it_pos.&lt;/P&gt;&lt;P&gt;        w_count = w_count + 1.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;      IF w_count EQ 0.&lt;/P&gt;&lt;P&gt;        APPEND it_part TO it_pos.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    IF it_part-belnr EQ it_part-rebzg AND it_part-augbl NE ' '.&lt;/P&gt;&lt;P&gt;      APPEND it_part TO it_part_filter.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    IF it_part-belnr EQ it_part-rebzg AND it_part-augbl EQ ' '.&lt;/P&gt;&lt;P&gt;      CLEAR w_on_acc_total.&lt;/P&gt;&lt;P&gt;      wa_on_acc-konto = it_part-konto.&lt;/P&gt;&lt;P&gt;      wa_on_acc-dmshb = it_part-dmshb.&lt;/P&gt;&lt;P&gt;      APPEND wa_on_acc TO it_on_acc.&lt;/P&gt;&lt;P&gt;    ENDIF.}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Karthik&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: karthikani on Jun 28, 2010 4:39 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jun 2010 11:09:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078251#M1505597</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-28T11:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inise loop performance affected</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078252#M1505598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;use read instead of inner loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read it_pos with belnr = it_part-rebzg and konto = it_part-konto. " and blart = 'DZ' and blart = 'AB'.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;ur code&lt;/P&gt;&lt;P&gt;endif.&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;Hope this will help you.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Uma Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jun 2010 11:12:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078252#M1505598</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-28T11:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inise loop performance affected</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078253#M1505599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The LOOP where can only be optimized with an internal table of type SORTED, if the criteria of the WHERE are the keys of the table. (ref: [WHERE log_exp|http://help.sap.com/abapdocu_70/en/ABAPLOOP_AT_ITAB_COND.htm#!ABAP_ADDITION_3@3@])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you dont want or cannot use such a type, you can use a SORT statement before the external loop, insure that the table stay sorted when you insert/update record, and replace the LOOP with a READ TABLE statement, and reading next records incrementing index, checking that the criteria is valid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jun 2010 11:14:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078253#M1505599</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2010-06-28T11:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inise loop performance affected</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078254#M1505600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friend,&lt;/P&gt;&lt;P&gt;             Itz really been very much thankful for your reply. But would you plz mention wer shud i make the changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jun 2010 11:20:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078254#M1505600</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-28T11:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inise loop performance affected</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078255#M1505601</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 the following logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{LOOP AT it_part.&lt;/P&gt;&lt;P&gt;IF it_part-belnr NE it_part-rebzg AND it_part-augbl EQ ' '.&lt;/P&gt;&lt;P&gt;CLEAR w_count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_pos with key belnr = it_part-rebzg &lt;/P&gt;&lt;P&gt;			   konto = it_part-konto.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_part-dmshb = it_part-dmshb * -1.&lt;/P&gt;&lt;P&gt;it_pos-dmshb = it_pos-dmshb - it_part-dmshb.&lt;/P&gt;&lt;P&gt;MODIFY it_pos.&lt;/P&gt;&lt;P&gt;w_count = w_count + 1.&lt;/P&gt;&lt;P&gt;IF w_count EQ 0.&lt;/P&gt;&lt;P&gt;APPEND it_part TO it_pos.&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;&lt;/P&gt;&lt;P&gt;IF it_part-belnr EQ it_part-rebzg AND it_part-augbl NE ' '.&lt;/P&gt;&lt;P&gt;APPEND it_part TO it_part_filter.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;IF it_part-belnr EQ it_part-rebzg AND it_part-augbl EQ ' '.&lt;/P&gt;&lt;P&gt;CLEAR w_on_acc_total.&lt;/P&gt;&lt;P&gt;wa_on_acc-konto = it_part-konto.&lt;/P&gt;&lt;P&gt;wa_on_acc-dmshb = it_part-dmshb.&lt;/P&gt;&lt;P&gt;APPEND wa_on_acc TO it_on_acc.&lt;/P&gt;&lt;P&gt;ENDIF.}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Preetham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jun 2010 11:34:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078255#M1505601</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-28T11:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inise loop performance affected</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078256#M1505602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friend preetham and dave,&lt;/P&gt;&lt;P&gt;                                     Your both answer worked. But wen i checked in se30(runtime analysis) the performance criteria was still little bit high. Is anyother solution which should increase more.&lt;/P&gt;&lt;P&gt;If you find any plz let me know.\&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanka and regards,&lt;/P&gt;&lt;P&gt;Karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jun 2010 11:39:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078256#M1505602</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-28T11:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inise loop performance affected</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078257#M1505603</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;Check whether have you sorted the internal tables with key fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Preetham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jun 2010 11:43:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078257#M1505603</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-28T11:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inise loop performance affected</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078258#M1505604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi karthik,&lt;/P&gt;&lt;P&gt;Observe the changes in your code.&lt;/P&gt;&lt;P&gt;I am using parallel cursor approach to improve the performance of nested loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{LOOP AT it_part.&lt;/P&gt;&lt;P&gt;IF it_part-belnr NE it_part-rebzg AND it_part-augbl EQ ' '.&lt;/P&gt;&lt;P&gt;CLEAR w_count.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;read table it_pos with key belnr = it_part-rebzg and konto = it_part-konto&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOOP AT it_pos FROM sy-tabix&lt;/STRONG&gt;. " and blart = 'DZ' and blart = 'AB'.&lt;/P&gt;&lt;P&gt;it_part-dmshb = it_part-dmshb * -1.&lt;/P&gt;&lt;P&gt;it_pos-dmshb = it_pos-dmshb - it_part-dmshb.&lt;/P&gt;&lt;P&gt;MODIFY it_pos.&lt;/P&gt;&lt;P&gt;w_count = w_count + 1.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;IF w_count EQ 0.&lt;/P&gt;&lt;P&gt;APPEND it_part TO it_pos.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;IF it_part-belnr EQ it_part-rebzg AND it_part-augbl NE ' '.&lt;/P&gt;&lt;P&gt;APPEND it_part TO it_part_filter.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;IF it_part-belnr EQ it_part-rebzg AND it_part-augbl EQ ' '.&lt;/P&gt;&lt;P&gt;CLEAR w_on_acc_total.&lt;/P&gt;&lt;P&gt;wa_on_acc-konto = it_part-konto.&lt;/P&gt;&lt;P&gt;wa_on_acc-dmshb = it_part-dmshb.&lt;/P&gt;&lt;P&gt;APPEND wa_on_acc TO it_on_acc.&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;Regards,&lt;/P&gt;&lt;P&gt;Vinod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jun 2010 11:48:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inise-loop-performance-affected/m-p/7078258#M1505604</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-28T11:48:20Z</dc:date>
    </item>
  </channel>
</rss>

