<?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: Performance issue - which one is better in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225766#M769375</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Better go for Select ..... For all enteries .....&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;&lt;/P&gt;&lt;P&gt;Naveen Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Jan 2008 13:51:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-07T13:51:55Z</dc:date>
    <item>
      <title>Performance issue - which one is better</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225762#M769371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Method 1 :&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt; IF ig_matwerks[] IS NOT INITIAL.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;   SELECT  m~matnr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           m~werks&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           m~ekgrp&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           m~mmsta&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           m~lgfsb&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           m~eisbe&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           m~bstfe&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           k~maktx&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           FROM marc AS m INNER JOIN makt AS k&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           ON m&lt;SUB&gt;matnr = k&lt;/SUB&gt;matnr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           INTO CORRESPONDING FIELDS OF TABLE ig_prefinal&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           FOR ALL ENTRIES IN ig_matwerks&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           WHERE m~matnr = ig_matwerks-matnr AND&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;                 m~werks = ig_matwerks-werks AND&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;                 k~spras = sy-langu.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;   SELECT  m~matnr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           r~werks&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           m~mtart&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           m~matkl&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           FROM mara AS m INNER JOIN marc AS r&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           ON m&lt;SUB&gt;matnr = r&lt;/SUB&gt;matnr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           INTO CORRESPONDING FIELDS OF TABLE ig_mara&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           FOR ALL ENTRIES IN ig_matwerks&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           WHERE m~matnr = ig_matwerks-matnr AND&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;                 r~werks = ig_matwerks-werks.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt; ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="4" type="ul"&gt;&lt;P&gt;Moving values mtart &amp;amp; matkl to prefinal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt; IF ig_prefinal[] IS NOT INITIAL.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;   LOOP AT ig_prefinal.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           SORT ig_mara BY matnr werks.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           READ TABLE ig_mara WITH KEY matnr = ig_prefinal-matnr werks = ig_prefinal-werks BINARY SEARCH TRANSPORTING mtart matkl.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           IF SY-SUBRC = 0.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;               ig_prefinal-mtart = ig_mara-mtart.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;               ig_prefinal-matkl = ig_mara-matkl.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;               MODIFY ig_prefinal TRANSPORTING mtart matkl.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;           CLEAR: ig_mara, ig_prefinal.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;   ENDLOOP.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt; ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                    ( OR )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Method 2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ig_matwerks[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;    SELECT  m~matnr&lt;/P&gt;&lt;P&gt;            m~werks&lt;/P&gt;&lt;P&gt;            m~ekgrp&lt;/P&gt;&lt;P&gt;            m~mmsta&lt;/P&gt;&lt;P&gt;            m~lgfsb&lt;/P&gt;&lt;P&gt;            m~eisbe&lt;/P&gt;&lt;P&gt;            m~bstfe&lt;/P&gt;&lt;P&gt;            k~maktx&lt;/P&gt;&lt;P&gt;            a~mtart&lt;/P&gt;&lt;P&gt;            a~matkl&lt;/P&gt;&lt;P&gt;            FROM  ( ( marc AS m INNER JOIN makt AS k&lt;/P&gt;&lt;P&gt;                                                  ON m&lt;SUB&gt;matnr = k&lt;/SUB&gt;matnr )&lt;/P&gt;&lt;P&gt;                             INNER JOIN mara AS a&lt;/P&gt;&lt;P&gt;                                                  ON a&lt;SUB&gt;matnr = k&lt;/SUB&gt;matnr )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            INTO CORRESPONDING FIELDS OF TABLE ig_prefinal&lt;/P&gt;&lt;P&gt;            FOR ALL ENTRIES IN ig_matwerks&lt;/P&gt;&lt;P&gt;            WHERE m~matnr = ig_matwerks-matnr AND&lt;/P&gt;&lt;P&gt;                  m~werks = ig_matwerks-werks AND&lt;/P&gt;&lt;P&gt;                  a~matnr = ig_matwerks-matnr AND&lt;/P&gt;&lt;P&gt;                  k~spras = sy-langu.&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;Please let me know .... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abaper.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 16:09:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225762#M769371</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-02T16:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue - which one is better</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225763#M769372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Method 2 is best than method 1 ,if possible do not use corresponding fields statement within select query,this will save some time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 16:12:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225763#M769372</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-02T16:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue - which one is better</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225764#M769373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, try to test the performance in SE30.&lt;/P&gt;&lt;P&gt;You can test others ways too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 16:12:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225764#M769373</guid>
      <dc:creator>rodrigo_paisante3</dc:creator>
      <dc:date>2008-01-02T16:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue - which one is better</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225765#M769374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The second method is better for the following reasons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) You access the database once.&lt;/P&gt;&lt;P&gt;2) You avoid the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just 3 points to note.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Make sure that the table used in the FOR ALL ENTRIES clause has unique MATNR and WERKS combinations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) The where clause &lt;STRONG&gt;a~matnr = ig_matwerks-matnr AND&lt;/STRONG&gt; is unnecessary as your JOIN statement &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;INNER JOIN mara AS a ON a&lt;SUB&gt;matnr = k&lt;/SUB&gt;matnr&lt;/STRONG&gt; already takes care of this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Use &lt;STRONG&gt;INTO TABLE&lt;/STRONG&gt; instead of &lt;STRONG&gt;INTO CORRESPONDING FIELDS OF TABLE&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at the code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ig_matwerks_tmp LIKE TABLE OF ig_matwerks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ig_matwerks[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ig_matwerks_tmp[] = ig_matwerks[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT  ig_matwerks_tmp BY matnr werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES FROM ig_matwerks_tmp&lt;/P&gt;&lt;P&gt;  COMPARING matnr werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT m~matnr&lt;/P&gt;&lt;P&gt;m~werks&lt;/P&gt;&lt;P&gt;m~ekgrp&lt;/P&gt;&lt;P&gt;m~mmsta&lt;/P&gt;&lt;P&gt;m~lgfsb&lt;/P&gt;&lt;P&gt;m~eisbe&lt;/P&gt;&lt;P&gt;m~bstfe&lt;/P&gt;&lt;P&gt;k~maktx&lt;/P&gt;&lt;P&gt;a~mtart&lt;/P&gt;&lt;P&gt;a~matkl&lt;/P&gt;&lt;P&gt;FROM ( ( marc AS m INNER JOIN makt AS k&lt;/P&gt;&lt;P&gt;ON m&lt;SUB&gt;matnr = k&lt;/SUB&gt;matnr )&lt;/P&gt;&lt;P&gt;INNER JOIN mara AS a&lt;/P&gt;&lt;P&gt;ON a&lt;SUB&gt;matnr = k&lt;/SUB&gt;matnr )&lt;/P&gt;&lt;P&gt;INTO TABLE ig_prefinal&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN ig_matwerks_tmp&lt;/P&gt;&lt;P&gt;WHERE m~matnr = ig_matwerks_tmp-matnr AND&lt;/P&gt;&lt;P&gt;m~werks = ig_matwerks_tmp-werks AND&lt;/P&gt;&lt;P&gt;k~spras = sy-langu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Mark Christian on Jan 2, 2008 3:33 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 20:33:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225765#M769374</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-02T20:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue - which one is better</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225766#M769375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Better go for Select ..... For all enteries .....&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;&lt;/P&gt;&lt;P&gt;Naveen Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2008 13:51:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225766#M769375</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-07T13:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue - which one is better</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225767#M769376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use get runtime field start and get runtime field stop and measure t = stop - start by yourself,&lt;/P&gt;&lt;P&gt;do not forget to repeat the measurements several times&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&amp;gt; no guess but a prove and you get a feeling about the magnitude&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2008 08:44:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225767#M769376</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-08T08:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue - which one is better</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225768#M769377</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 can still use LOOP after the SELECT statement (Option 1). This depends on the data volume you are trying to retrieve and how busy is your data server. Having MARA and MARC in 2 separate internal tables allow you the flexibility to reuse MARA for your other routines. Please pair MAKT with MARA instead of with MARC.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the LOOP statement relieves the data server of the burden on having to match MARC with MARA as this will be handled by the application server. But you have to put your SORT statement outside of the LOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use SE30 - Runtime Evaluation to see how data execution was distributed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Darwin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2008 09:32:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225768#M769377</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-08T09:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue - which one is better</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225769#M769378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see this blog by Rob:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/rob.burbank/blog/2007/03/19/joins-vs-for-all-entries--which-performs-better&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2008 10:17:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-which-one-is-better/m-p/3225769#M769378</guid>
      <dc:creator>rodrigo_paisante3</dc:creator>
      <dc:date>2008-01-08T10:17:46Z</dc:date>
    </item>
  </channel>
</rss>

