<?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: doubt: For all entries or Loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-for-all-entries-or-loop/m-p/2924401#M688847</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even i think so..&lt;/P&gt;&lt;P&gt;but  i  have checked in se30 so my lower statement(loop) works faster and &lt;/P&gt;&lt;P&gt;even i n my whole report output also gives beter performance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;coz, my report was taking 10 min to give an output coz my mseg has 7 lakh and vbap(also an item table) has 10,000 entries &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so for this perticular case it gives me the output in 1 min 85 sec only..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so i m in a dilema which one is better...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls guide me on this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 20 Oct 2007 06:17:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-20T06:17:11Z</dc:date>
    <item>
      <title>doubt: For all entries or Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-for-all-entries-or-loop/m-p/2924397#M688843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello experts,&lt;/P&gt;&lt;P&gt;in my report i had a select statement on mseg which is having a 7 lakh records&lt;/P&gt;&lt;P&gt;so it takes hell of time to give an output..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the query was like this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;lt;b&amp;gt;SELECT MBLNR MJAHR ZEILE  BWART KDAUF KDPOS WERKS ERFMG&lt;/P&gt;&lt;P&gt;          FROM MSEG INTO TABLE GT_MSEG&lt;/P&gt;&lt;P&gt;           FOR ALL ENTRIES IN GT_VBAP&lt;/P&gt;&lt;P&gt;                WHERE KDAUF = GT_VBAP-VBELN&lt;/P&gt;&lt;P&gt;                     AND KDPOS = GT_VBAP-POSNR&lt;/P&gt;&lt;P&gt;                     AND WERKS = GT_VBAP-WERKS&lt;/P&gt;&lt;P&gt;                     AND BWART IN (641, 101, 102).&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;now i have chage the query to below and giving me the out put very fast and correct one..&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;    SELECT mblnr mjahr&lt;/P&gt;&lt;P&gt;              zeile&lt;/P&gt;&lt;P&gt;              bwart&lt;/P&gt;&lt;P&gt;              kdauf&lt;/P&gt;&lt;P&gt;              kdpos&lt;/P&gt;&lt;P&gt;              werks&lt;/P&gt;&lt;P&gt;              erfmg&lt;/P&gt;&lt;P&gt;              xauto&lt;/P&gt;&lt;P&gt;      FROM mseg&lt;/P&gt;&lt;P&gt;      INTO TABLE gt_mseg1&lt;/P&gt;&lt;P&gt;      WHERE bwart IN (641, 101, 102).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT gt_mseg1 INTO  wa_mseg.&lt;/P&gt;&lt;P&gt;      READ TABLE gt_vbap INTO wa_vbap WITH KEY vbeln = wa_mseg-kdauf&lt;/P&gt;&lt;P&gt;                                               posnr = wa_mseg-kdpos&lt;/P&gt;&lt;P&gt;                                               werks = wa_mseg-werks.&lt;/P&gt;&lt;P&gt;      IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        APPEND wa_mseg TO gt_mseg.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;but i have a doute that both this query gives same output and both means the same...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and particularly in case of mseg which one is better and correct one&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Oct 2007 04:28:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-for-all-entries-or-loop/m-p/2924397#M688843</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-20T04:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: doubt: For all entries or Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-for-all-entries-or-loop/m-p/2924398#M688844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raja,&lt;/P&gt;&lt;P&gt;1)  Commend Either of the one select statement.&lt;/P&gt;&lt;P&gt;2) Go to SE30 transaction&lt;/P&gt;&lt;P&gt;3) In "Program" Give ur Program name.&lt;/P&gt;&lt;P&gt;4) Click on "Execute" Button&lt;/P&gt;&lt;P&gt;5) After Executing Click on "&amp;lt;- " back button ( Come out clicking back button only if its having a selection screen 2 may need tp press that twice )&lt;/P&gt;&lt;P&gt;6) Click on the "Evaluate  " button below.&lt;/P&gt;&lt;P&gt;7) You can see The total time taken by Abap , Database and System.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do the same for Select from Mseg into gt_mesg + Loop .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See which one is taking less time .You can see the details if you click "F5"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if help full.&lt;/P&gt;&lt;P&gt;Avi.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Oct 2007 05:16:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-for-all-entries-or-loop/m-p/2924398#M688844</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-20T05:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: doubt: For all entries or Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-for-all-entries-or-loop/m-p/2924399#M688845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Logically speaking first statement should take less time.&lt;/P&gt;&lt;P&gt;Just add &lt;/P&gt;&lt;P&gt;IF NOT GT_VBAP[] IS INITIAL.&lt;/P&gt;&lt;P&gt;SELECT MBLNR MJAHR ZEILE BWART KDAUF KDPOS WERKS ERFMG&lt;/P&gt;&lt;P&gt;FROM MSEG INTO TABLE GT_MSEG&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN GT_VBAP&lt;/P&gt;&lt;P&gt;WHERE KDAUF = GT_VBAP-VBELN&lt;/P&gt;&lt;P&gt;AND KDPOS = GT_VBAP-POSNR&lt;/P&gt;&lt;P&gt;AND WERKS = GT_VBAP-WERKS&lt;/P&gt;&lt;P&gt;AND BWART IN (641, 101, 102).&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;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Oct 2007 05:39:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-for-all-entries-or-loop/m-p/2924399#M688845</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-20T05:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: doubt: For all entries or Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-for-all-entries-or-loop/m-p/2924400#M688846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the first should be faster!&lt;/P&gt;&lt;P&gt;you should pay more attention the key fields you must select into the internal table&lt;/P&gt;&lt;P&gt;because sometime the record will be reduce&lt;/P&gt;&lt;P&gt; the best mthod is add index!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Oct 2007 06:01:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-for-all-entries-or-loop/m-p/2924400#M688846</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-20T06:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: doubt: For all entries or Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-for-all-entries-or-loop/m-p/2924401#M688847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even i think so..&lt;/P&gt;&lt;P&gt;but  i  have checked in se30 so my lower statement(loop) works faster and &lt;/P&gt;&lt;P&gt;even i n my whole report output also gives beter performance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;coz, my report was taking 10 min to give an output coz my mseg has 7 lakh and vbap(also an item table) has 10,000 entries &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so for this perticular case it gives me the output in 1 min 85 sec only..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so i m in a dilema which one is better...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls guide me on this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Oct 2007 06:17:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-for-all-entries-or-loop/m-p/2924401#M688847</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-20T06:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: doubt: For all entries or Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-for-all-entries-or-loop/m-p/2924402#M688848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would never use the first statement for an easy reason. It uses more than one field of the FOR ALL ENTRIES INT-Table in the where clause. If you do so the database statement ignores all database caches which will decrease the performance extremely. getting lines from the db cache is saifd to be approx. 10 times faster than bypassing buffers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Furthermore if you use the sencond statement you must ensure to dersign it in a way that you have a hash table and use the table key access. this ensures that the read statement won't need longer and longer the more lines you have. This should speed it even more.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW: SE30 is nice for performance checking but if you just want to check 2 statements against each other you can also navigate to the performance examples through menue in SE80 there u have boxes where u can enter the coding an check it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Oct 2007 22:47:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-for-all-entries-or-loop/m-p/2924402#M688848</guid>
      <dc:creator>romanweise</dc:creator>
      <dc:date>2007-10-20T22:47:39Z</dc:date>
    </item>
  </channel>
</rss>

