<?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/2340070#M515609</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; How to avoid this select statement within loop.&lt;/P&gt;&lt;P&gt;This loop may affect the performance .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; loop at idfkkop into waDfkkop.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   concatenate waDfkkop-opbel&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        waDfkkop-opupw&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        waDfkkop-opupk&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        waDfkkop-opupz&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      into w_loobj1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   select single proid lockr from dfkklocks&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     into (waDfkkop-proid, waDfkkop-spzah)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     where loobj1 = w_loobj1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       and gpart  = waDfkkop-gpart.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   if sy-subrc = 0.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     modify idfkkop from waDfkkop.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   clear w_loobj1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jun 2007 05:25:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-14T05:25:25Z</dc:date>
    <item>
      <title>performance issue -</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/2340070#M515609</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; How to avoid this select statement within loop.&lt;/P&gt;&lt;P&gt;This loop may affect the performance .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; loop at idfkkop into waDfkkop.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   concatenate waDfkkop-opbel&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        waDfkkop-opupw&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        waDfkkop-opupk&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        waDfkkop-opupz&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      into w_loobj1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   select single proid lockr from dfkklocks&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     into (waDfkkop-proid, waDfkkop-spzah)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     where loobj1 = w_loobj1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       and gpart  = waDfkkop-gpart.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   if sy-subrc = 0.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     modify idfkkop from waDfkkop.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   clear w_loobj1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 05:25:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/2340070#M515609</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T05:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue -</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/2340071#M515610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can first loop through the whole table and concatenate fields and put it into other internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use FOR ALL ENTRIES clause in the SELECT statement using that new internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 05:30:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/2340071#M515610</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T05:30: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/2340072#M515611</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;Try this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

* create a new internal table with the two fields..
 data: begin of wa_obj,
            loobj1 TYPE dfkklocks-loobj1,
            gpart   TYPE dfkklocks-gpart,
            PROID TYPE dfkklocks-PROID,
            LOCKR TYPE dfkklocks-LOCKR,
         end of wa_obj.

data: t_obj like table of WA_OBJ.
data: t_obj_1 like table of WA_OBJ.

* process the internal table to prepare the internal table T_OBJ.
loop at idfkkop into waDfkkop.
 concatenate waDfkkop-opbel
 waDfkkop-opupw
 waDfkkop-opupk
 waDfkkop-opupz
 into w_loobj1.

  wa_obj-loobj1 = w_loobj1.
   wa_obj-gpart = waDfkkop-gpart.

  append wa_obj to t_obj.

ENDLOOP.

if NOT T_OBJ[] Is initial.
* Select the data from the database table.
  SELECT PROID LOCKR LOOBJ1 GPART
               INTO TABLE T_OBJ_1
               FROM dfkklocks 
               FOR ALL ENTRIES IN T_OBJ
              WHERE LOOBJ1 = T_OBJ-LOOBJ1
              AND     GPART    = T_OBJ-GPART.
ENDIF.

loop at idfkkop into waDfkkop.
 concatenate waDfkkop-opbel
 waDfkkop-opupw
 waDfkkop-opupk
 waDfkkop-opupz
 into w_loobj1.
 READ TABLE LT_OBJ_1 INTO WA_OBJ
   WITH KEY loobj1 = w_loobj1
                    gpart = waDfkkop-gpart.
 if sy-subrc = 0.* modify idfkkop from waDfkkop.
 endif.
 clear w_loobj1.
 endloop.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 05:36:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/2340072#M515611</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T05:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue -</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/2340073#M515612</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;u can avoid select statement in the loop like this,&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;select * from kna1 into table itab where kunnr in p_kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not itab[] is initial.&lt;/P&gt;&lt;P&gt;select * from ekko into table itab1 for all entries in itab where kunnr = itab-kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;seshu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 06:46:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/2340073#M515612</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T06:46:23Z</dc:date>
    </item>
  </channel>
</rss>

