<?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: problem with two open cursor in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-two-open-cursor/m-p/736466#M34927</link>
    <description>&lt;P&gt;this is what i tried to tell her in other post but seem like she need sample code instead :).&lt;/P&gt;</description>
    <pubDate>Wed, 05 Dec 2018 00:32:04 GMT</pubDate>
    <dc:creator>DoanManhQuynh</dc:creator>
    <dc:date>2018-12-05T00:32:04Z</dc:date>
    <item>
      <title>problem with two open cursor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-two-open-cursor/m-p/736461#M34922</link>
      <description>&lt;P&gt;Hi Expert,&lt;/P&gt;
  &lt;P&gt;I am using two open Cursor to call the data from two database table then I am trying to compare the data to find out the different data and records between them, but everything was in vain because the&lt;STRONG&gt; first cursor called 10000 &lt;/STRONG&gt;records let us say material numbers..&lt;STRONG&gt; the sound cursor call 10000 &lt;/STRONG&gt;material numbers but they are totally different from the first cursor called data.....&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;The operation is going wrongly as no one of the first 10000 is in the second 10000 although they are in the second database but has not been called in this pass of looping....&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;I have tried to make append lines to a new intern tables and then to compare them but this is not a solution as I have millions of records and this will be like a select statement....&lt;BR /&gt;&lt;BR /&gt;Please, any advises solving this..&lt;/P&gt;
  &lt;P&gt;Best Regards&lt;/P&gt;
  &lt;P&gt;Jenie&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 10:36:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-two-open-cursor/m-p/736461#M34922</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-12-04T10:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: problem with two open cursor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-two-open-cursor/m-p/736462#M34923</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;SELECT... FROM table1 INTO TABLE first_data_set PACKAGE SIZE 10000.&lt;BR /&gt;  SELECT ... FROM table2 INTO TABLE second_data_set 
       FOR ALL ENTRIES IN first_data_set
       WHERE key eq first_data_set-key
  " compare first_data_set with second_data_set.
  ...
ENDSELECT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;No need for a cursor.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 12:24:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-two-open-cursor/m-p/736462#M34923</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2018-12-04T12:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: problem with two open cursor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-two-open-cursor/m-p/736463#M34924</link>
      <description>&lt;P&gt;Well you could try to optimize if the select are 'ordered' (select order by) some pseudocode could be&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;open cursor 1.
open cursor 2.
do 
  Fetch a package from table 1 into internal table 1
  if no record, exit 
  loop at internal table 1 into record 1.
    while cursor 2 open and second table last value lower than record 1 key
      fetch a package of table2 
      if no record, close cursor 2 and exit 
    endwhile
    compare data with record 1 with internal table 2
  endloop
enddo
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Dec 2018 12:54:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-two-open-cursor/m-p/736463#M34924</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2018-12-04T12:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: problem with two open cursor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-two-open-cursor/m-p/736464#M34925</link>
      <description>&lt;P&gt;If you select data from table1 and table with some order by clause, the for all entries could be replaced by some range of data, getting usually much better performance?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT ... FROM table2 INTO TABLE second_data_set 
       WHERE key between table1_min_key and table1_max_key.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Dec 2018 12:55:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-two-open-cursor/m-p/736464#M34925</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2018-12-04T12:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: problem with two open cursor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-two-open-cursor/m-p/736465#M34926</link>
      <description>&lt;P&gt;Oh yes. A far better solution - combine my answer with yours. i.e. with order, but without cursor.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 15:53:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-two-open-cursor/m-p/736465#M34926</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2018-12-04T15:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: problem with two open cursor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-two-open-cursor/m-p/736466#M34927</link>
      <description>&lt;P&gt;this is what i tried to tell her in other post but seem like she need sample code instead :).&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 00:32:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-two-open-cursor/m-p/736466#M34927</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2018-12-05T00:32:04Z</dc:date>
    </item>
  </channel>
</rss>

