<?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: Improve Performance (SCI: sequential search LOOP AT ... WHERE ...) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-sci-sequential-search-loop-at-where/m-p/2122973#M445192</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sometimes the answer can be so easy (&lt;STRONG&gt;hits head&lt;/STRONG&gt;)!&lt;/P&gt;&lt;P&gt;Thanks. I will check this, but of course, instead of using the WHERE, even a simple nested loop may be better and easier on the system. And the blog about parallel cursor method is also very helpful in improving the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll first check the solution and will then post back the result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Apr 2007 07:57:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-18T07:57:27Z</dc:date>
    <item>
      <title>Improve Performance (SCI: sequential search LOOP AT ... WHERE ...)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-sci-sequential-search-loop-at-where/m-p/2122969#M445188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I loop over an internal table like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT me-&amp;gt;objects INTO lwa_object WHERE trkorr IN ira_trkorr[].
...
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The warning I get from the Code Inspector is:&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;When using the current statement for an internal table of the STANDARD type, the system runs a sequential search. In some cases, the entire table is read (internally). This has a considerable negative effect on performance if the table contains numerous entries.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The me-&amp;gt;objects is defined as a sorted table type with (almost) all the fields as key (UNIQUE). The table type is a sorted table with (almost) all the fields as key (UNIQUE). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table contains transports and the objects in those transports. So multiple lines for one transport.&lt;/P&gt;&lt;P&gt;Like:&lt;/P&gt;&lt;P&gt;Transport  Object&lt;/P&gt;&lt;P&gt;1..............A&lt;/P&gt;&lt;P&gt;1..............B&lt;/P&gt;&lt;P&gt;2..............A&lt;/P&gt;&lt;P&gt;2..............B&lt;/P&gt;&lt;P&gt;3..............A&lt;/P&gt;&lt;P&gt;4..............A&lt;/P&gt;&lt;P&gt;4..............B&lt;/P&gt;&lt;P&gt;I need to only check certain selected transport numbers. For example the user has selected transport number 1 and 4. ira_trkorr[] is a range table with the selected transports.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I can do to solve this performance warning is to first loop over the me-&amp;gt;objects table and append the selected lines into a temporary internal table. Then the above loop can be done on the second table... But that would not improve performance. I think it would even be worse.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And finally, my question: &amp;lt;b&amp;gt;Is there a better solution for this&amp;lt;/b&amp;gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Edwin Vleeshouwers&lt;/P&gt;&lt;P&gt;Added: Table type is SORTED (Unique key)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 06:37:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-sci-sequential-search-loop-at-where/m-p/2122969#M445188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T06:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Improve Performance (SCI: sequential search LOOP AT ... WHERE ...)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-sci-sequential-search-loop-at-where/m-p/2122970#M445189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What you can do is sort the table on trcorr before the loop statement, &lt;/P&gt;&lt;P&gt;or use a sorted internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Hans&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward all helpful answers !!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 07:06:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-sci-sequential-search-loop-at-where/m-p/2122970#M445189</guid>
      <dc:creator>h_senden2</dc:creator>
      <dc:date>2007-04-18T07:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Improve Performance (SCI: sequential search LOOP AT ... WHERE ...)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-sci-sequential-search-loop-at-where/m-p/2122971#M445190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nah, it's already sorted...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The me-&amp;gt;objects is defined as a internal table based on a table type. The table type is a sorted table with (almost) all the fields as key (UNIQUE). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The TRKORR field is leading. Still, the LOOP AT... WHERE... does give this warning.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 07:25:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-sci-sequential-search-loop-at-where/m-p/2122971#M445190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T07:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Improve Performance (SCI: sequential search LOOP AT ... WHERE ...)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-sci-sequential-search-loop-at-where/m-p/2122972#M445191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Edwin ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try the paralel cursor method, you can make the range table as another table and i think you can use paralel cursor there, or you can make your range table as a hashed table,  can access it with key (read table ..) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Caglar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 07:32:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-sci-sequential-search-loop-at-where/m-p/2122972#M445191</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T07:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Improve Performance (SCI: sequential search LOOP AT ... WHERE ...)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-sci-sequential-search-loop-at-where/m-p/2122973#M445192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sometimes the answer can be so easy (&lt;STRONG&gt;hits head&lt;/STRONG&gt;)!&lt;/P&gt;&lt;P&gt;Thanks. I will check this, but of course, instead of using the WHERE, even a simple nested loop may be better and easier on the system. And the blog about parallel cursor method is also very helpful in improving the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll first check the solution and will then post back the result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 07:57:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-sci-sequential-search-loop-at-where/m-p/2122973#M445192</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T07:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Improve Performance (SCI: sequential search LOOP AT ... WHERE ...)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-sci-sequential-search-loop-at-where/m-p/2122974#M445193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, this parallel cursor method solved the problem.&lt;/P&gt;&lt;P&gt;Thanks very much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS. Points have been awarded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 13:58:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-sci-sequential-search-loop-at-where/m-p/2122974#M445193</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T13:58:49Z</dc:date>
    </item>
  </channel>
</rss>

