<?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 issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529957#M1070653</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have some performance issue. I wanted to remove below loops. &lt;/P&gt;&lt;P&gt;Actually WA_DELIVERY_MASTER is my output table. i do want to append values into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Merging all the delivery related data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT li_delivery INTO lwa_delivery.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-vbeln      = lwa_delivery-vbeln.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-ernam      = lwa_delivery-ernam.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-erdat      = lwa_delivery-erdat.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-lifsk      = lwa_delivery-lifsk.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-lfdat      = lwa_delivery-lfdat.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-lddat      = lwa_delivery-lddat.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-wadat      = lwa_delivery-wadat.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-tddat      = lwa_delivery-tddat.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-route      = lwa_delivery-route.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-wadat_ist  = lwa_delivery-wadat_ist.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-vgbel      = lwa_delivery-vgbel.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-vgpos      = lwa_delivery-vgpos.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-posnr      = lwa_delivery-posnr.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-lfimg      = lwa_delivery-lfimg.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-mbdat      = lwa_delivery-mbdat.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-kostk      = lwa_delivery-kostk.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-wbstk      = lwa_delivery-wbstk.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-pkstk      = lwa_delivery-pkstk.&lt;/P&gt;&lt;P&gt;    lv_count                      = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Merging Shipment data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    LOOP AT li_shipment INTO lwa_shipment&lt;/P&gt;&lt;P&gt;      WHERE vbeln = lwa_delivery-vbeln.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-tknum      = lwa_shipment-tknum.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-ernam_vttk = lwa_shipment-ernam.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-sttrg      = lwa_shipment-sttrg.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-vsart      = lwa_shipment-vsart.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-vsart_desc = lwa_shipment-vsart_desc.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-tplst      = lwa_shipment-tplst.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-tdlnr      = lwa_shipment-tdlnr.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-dalbg      = lwa_shipment-dalbg.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-dalen      = lwa_shipment-dalen.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-datbg      = lwa_shipment-datbg.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-stlad      = lwa_shipment-stlad.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-tpnum      = lwa_shipment-tpnum.&lt;/P&gt;&lt;P&gt;      APPEND wa_delivery_master TO gi_delivery_master.&lt;/P&gt;&lt;P&gt;      lv_count                      = 1.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;    IF lv_count NE 1.&lt;/P&gt;&lt;P&gt;      APPEND wa_delivery_master TO gi_delivery_master.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    CLEAR wa_delivery_master.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not want to use 2 loops. It is affecting my performance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 20 Sep 2008 13:26:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-20T13:26:22Z</dc:date>
    <item>
      <title>Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529957#M1070653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have some performance issue. I wanted to remove below loops. &lt;/P&gt;&lt;P&gt;Actually WA_DELIVERY_MASTER is my output table. i do want to append values into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Merging all the delivery related data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT li_delivery INTO lwa_delivery.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-vbeln      = lwa_delivery-vbeln.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-ernam      = lwa_delivery-ernam.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-erdat      = lwa_delivery-erdat.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-lifsk      = lwa_delivery-lifsk.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-lfdat      = lwa_delivery-lfdat.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-lddat      = lwa_delivery-lddat.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-wadat      = lwa_delivery-wadat.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-tddat      = lwa_delivery-tddat.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-route      = lwa_delivery-route.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-wadat_ist  = lwa_delivery-wadat_ist.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-vgbel      = lwa_delivery-vgbel.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-vgpos      = lwa_delivery-vgpos.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-posnr      = lwa_delivery-posnr.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-lfimg      = lwa_delivery-lfimg.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-mbdat      = lwa_delivery-mbdat.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-kostk      = lwa_delivery-kostk.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-wbstk      = lwa_delivery-wbstk.&lt;/P&gt;&lt;P&gt;    wa_delivery_master-pkstk      = lwa_delivery-pkstk.&lt;/P&gt;&lt;P&gt;    lv_count                      = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Merging Shipment data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    LOOP AT li_shipment INTO lwa_shipment&lt;/P&gt;&lt;P&gt;      WHERE vbeln = lwa_delivery-vbeln.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-tknum      = lwa_shipment-tknum.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-ernam_vttk = lwa_shipment-ernam.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-sttrg      = lwa_shipment-sttrg.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-vsart      = lwa_shipment-vsart.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-vsart_desc = lwa_shipment-vsart_desc.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-tplst      = lwa_shipment-tplst.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-tdlnr      = lwa_shipment-tdlnr.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-dalbg      = lwa_shipment-dalbg.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-dalen      = lwa_shipment-dalen.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-datbg      = lwa_shipment-datbg.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-stlad      = lwa_shipment-stlad.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-tpnum      = lwa_shipment-tpnum.&lt;/P&gt;&lt;P&gt;      APPEND wa_delivery_master TO gi_delivery_master.&lt;/P&gt;&lt;P&gt;      lv_count                      = 1.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;    IF lv_count NE 1.&lt;/P&gt;&lt;P&gt;      APPEND wa_delivery_master TO gi_delivery_master.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    CLEAR wa_delivery_master.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not want to use 2 loops. It is affecting my performance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Sep 2008 13:26:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529957#M1070653</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-20T13:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529958#M1070654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rohit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of inner Loop you can use the Read statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;READ TABLE li_shipment into lwa_shipment WITH TABLE KEY vbeln = lwa_delivery-vbeln.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just replace that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reply back if you need more help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Karthik D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Sep 2008 13:35:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529958#M1070654</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-20T13:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529959#M1070655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Karthik - READ won't help at all unless the BINARY SEARCH addition is used. And in this case, it will not return all the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Sep 2008 16:42:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529959#M1070655</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-20T16:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529960#M1070656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No we can not use read statement as my each delivery there are more shipment number.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 06:43:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529960#M1070656</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T06:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529961#M1070657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will not work in my case as there is a query like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT a&lt;SUB&gt;vbeln a&lt;/SUB&gt;ernam a&lt;SUB&gt;erdat a&lt;/SUB&gt;lifsk a~lfdat&lt;/P&gt;&lt;P&gt;         a&lt;SUB&gt;lddat a&lt;/SUB&gt;wadat a&lt;SUB&gt;tddat a&lt;/SUB&gt;route a~wadat_ist&lt;/P&gt;&lt;P&gt;         b&lt;SUB&gt;vgbel b&lt;/SUB&gt;vgpos b&lt;SUB&gt;vbeln b&lt;/SUB&gt;posnr b~lfimg&lt;/P&gt;&lt;P&gt;         b&lt;SUB&gt;mbdat c&lt;/SUB&gt;vbeln c&lt;SUB&gt;kostk c&lt;/SUB&gt;wbstk c~pkstk&lt;/P&gt;&lt;P&gt;    INTO TABLE   SELECT a&lt;SUB&gt;vbeln a&lt;/SUB&gt;ernam a&lt;SUB&gt;erdat a&lt;/SUB&gt;lifsk a~lfdat&lt;/P&gt;&lt;P&gt;         a&lt;SUB&gt;lddat a&lt;/SUB&gt;wadat a&lt;SUB&gt;tddat a&lt;/SUB&gt;route a~wadat_ist&lt;/P&gt;&lt;P&gt;         b&lt;SUB&gt;vgbel b&lt;/SUB&gt;vgpos b&lt;SUB&gt;vbeln b&lt;/SUB&gt;posnr b~lfimg&lt;/P&gt;&lt;P&gt;         b&lt;SUB&gt;mbdat c&lt;/SUB&gt;vbeln c&lt;SUB&gt;kostk c&lt;/SUB&gt;wbstk c~pkstk&lt;/P&gt;&lt;P&gt;    INTO TABLE li_delivery&lt;/P&gt;&lt;P&gt;    FROM ( ( likp AS a&lt;/P&gt;&lt;P&gt;             LEFT OUTER JOIN lips AS b&lt;/P&gt;&lt;P&gt;             ON a&lt;SUB&gt;vbeln = b&lt;/SUB&gt;vbeln )&lt;/P&gt;&lt;P&gt;             LEFT OUTER JOIN vbuk AS c&lt;/P&gt;&lt;P&gt;             ON a&lt;SUB&gt;vbeln = c&lt;/SUB&gt;vbeln )&lt;/P&gt;&lt;P&gt;  WHERE a~vbeln IN s_vbelnd&lt;/P&gt;&lt;P&gt;    AND a~ernam IN s_ernamd&lt;/P&gt;&lt;P&gt;    AND a~erdat IN s_erdatd.&lt;/P&gt;&lt;P&gt;    FROM ( ( likp AS a&lt;/P&gt;&lt;P&gt;             LEFT OUTER JOIN lips AS b&lt;/P&gt;&lt;P&gt;             ON a&lt;SUB&gt;vbeln = b&lt;/SUB&gt;vbeln )&lt;/P&gt;&lt;P&gt;             LEFT OUTER JOIN vbuk AS c&lt;/P&gt;&lt;P&gt;             ON a&lt;SUB&gt;vbeln = c&lt;/SUB&gt;vbeln )&lt;/P&gt;&lt;P&gt;  WHERE a~vbeln IN s_vbelnd&lt;/P&gt;&lt;P&gt;    AND a~ernam IN s_ernamd&lt;/P&gt;&lt;P&gt;    AND a~erdat IN s_erdatd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so each vbeln with this item so there are many rows for each VBELN in my internal table   there are more than one rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in this case to feth data from &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT li_shipment INTO lwa_shipment&lt;/P&gt;&lt;P&gt;      WHERE vbeln = lwa_delivery-vbeln.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-tknum      = lwa_shipment-tknum.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-ernam_vttk = lwa_shipment-ernam.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-sttrg      = lwa_shipment-sttrg.&lt;/P&gt;&lt;P&gt;      wa_delivery_master-vsart      = lwa_shipment-vsart.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it will not work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 07:43:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529961#M1070657</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T07:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529962#M1070658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just define the second table as a sorted table and your performance is dramatically improved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best use always sorted tables if possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it must be a standard table then use binary search ... of coursre togehter with a loop see here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_blogpost" href="https://community.sap.com/" __jive_macro_name="blogpost" modifiedtitle="true" __default_attr="44623"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Section on loops.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without that you run into problems described here&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_blogpost" href="https://community.sap.com/" __jive_macro_name="blogpost" modifiedtitle="true" __default_attr="45582"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try move-corresponding, I don't think that is costs much, and if something changes in your structures, it will save you a lot of trouble.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 07:51:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529962#M1070658</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T07:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529963#M1070659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you can use loop inside loop if you make sure that the WHERE-conditions, especially of the inner loop, are supported by the table keys of sorted internal tables (defined as ... TYPE SORTED TABLE OF ... WITH (NON-)UNIQUE KEY ... &lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. Did not see Siegfried's post before sending mine, he beat me again...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 08:00:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529963#M1070659</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-09-22T08:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529964#M1070660</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 above suggestions, I would like to add few points. When using nested loops we need to consider the volume of data in each internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say ITAB1 has 1 million records and ITAB2 has 1.5 million records, in this case if you may have to use nested loops then loop on ITAB1 (outer loop) and inside the loop, perform loop on ITAB2 with the addition of WHERE clause. Which means in case of nested loops always outer loop should contain less itterations. One more point here I don't see any reason why you are assigning each work area's field values seperately to another work area and append it to internal table. I would use the syntax MOVE-CORRESPONDING WA1 TO WA2 and append WA2 TO ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 09:33:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529964#M1070660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T09:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529965#M1070661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Say ITAB1 has 1 million records and ITAB2 has 1.5 million records, in this case if you may have to use nested loops then loop on ITAB1 (outer loop) and inside the loop, perform loop on ITAB2 with the addition of WHERE clause. Which means in case of nested loops always outer loop should contain less itterations. One more point here I don't see any reason why you are assigning each work area's field values seperately to another work area and append it to internal table. I would use the syntax MOVE-CORRESPONDING WA1 TO WA2 and append WA2 TO ITAB2.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Regards,&lt;/P&gt;&lt;P&gt;&amp;gt; Venkat&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Venkat - unfortunately, that's basically wrong on both counts:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT...WHERE will still have to read all entries in both tables in order to evaluate the WHERE condition..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING will add some overhead, but not enough to worry about.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Run some tests to see if this is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 13:44:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529965#M1070661</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T13:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529966#M1070662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question for you, say I have an internal table with records something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB1-FIELD1   ITAB1-FIELD2&lt;/P&gt;&lt;P&gt;1001                 XX&lt;/P&gt;&lt;P&gt;1001                 YY&lt;/P&gt;&lt;P&gt;1001                 ZZ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FIELD1    ITAB2-FIELD2&lt;/P&gt;&lt;P&gt;1001                  XYZ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What way of looping would you suggest for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) LOOP AT ITAB1.&lt;/P&gt;&lt;P&gt;       LOOP AT ITAB2 WHERE FIELD1 = ITAB1-FIELD1.&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;* * * *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       ENDLOOP.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) LOOP AT ITAB2.&lt;/P&gt;&lt;P&gt;       LOOP AT ITAB1 WHERE FIELD1 = ITAB2-FIELD2.&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;* * * *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       ENDLOOP.&lt;/P&gt;&lt;P&gt;   ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In example 1 the no. of itterations including outer and inner loops are 6.&lt;/P&gt;&lt;P&gt;In example 2 the no. of itterations including outer and inner loops are 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2008 15:07:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529966#M1070662</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-23T15:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529967#M1070663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Neither - see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Performance of Nested Loops|&lt;A class="jive_macro jive_macro_blogpost" href="https://community.sap.com/" __jive_macro_name="blogpost" modifiedtitle="true" __default_attr="41337"&gt;&lt;/A&gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2008 15:21:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529967#M1070663</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-23T15:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529968#M1070664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Venkat:&lt;/P&gt;&lt;P&gt; if you want to use Loop inside a Loop.&lt;/P&gt;&lt;P&gt;I think it is the better way,&lt;/P&gt;&lt;P&gt;Loop at internal table1 into wa_itab1.&lt;/P&gt;&lt;P&gt; v_tabix = sy-tabix.&lt;/P&gt;&lt;P&gt;   Loop at internal table2 into wa_itab2 from v_tabix.&lt;/P&gt;&lt;P&gt;     Code here.&lt;/P&gt;&lt;P&gt;   endloop.itab2&lt;/P&gt;&lt;P&gt;endloop."Itab 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2008 19:47:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529968#M1070664</guid>
      <dc:creator>BH2408</dc:creator>
      <dc:date>2008-09-23T19:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529969#M1070665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;  if you want to use Loop inside a Loop.&lt;/P&gt;&lt;P&gt;&amp;gt; I think it is the better way,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nested loops are a performance killer. See my earlier post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2008 19:54:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529969#M1070665</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-23T19:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529970#M1070666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;I will agree that loop inside a loop is the performance killer but the by using the INDEX method we can get better performance .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2008 12:22:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529970#M1070666</guid>
      <dc:creator>BH2408</dc:creator>
      <dc:date>2008-09-24T12:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529971#M1070667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi Rob,&lt;/P&gt;&lt;P&gt;&amp;gt; I will agree that loop inside a loop is the performance killer but the by using the INDEX method we can get better performance .&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, but you have to have an exit when the field you are watching changes.&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, 24 Sep 2008 12:56:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4529971#M1070667</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-24T12:56:44Z</dc:date>
    </item>
  </channel>
</rss>

