<?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 FETCH NEXT CURSOR in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718881#M33438</link>
    <description>&lt;P&gt;You should check sy-subrc after FETCH. Not after APPEND command.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Dec 2018 15:04:46 GMT</pubDate>
    <dc:creator>Tomas_Buryanek</dc:creator>
    <dc:date>2018-12-03T15:04:46Z</dc:date>
    <item>
      <title>problem with FETCH NEXT CURSOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718880#M33437</link>
      <description>&lt;P&gt;Hi expert,&lt;BR /&gt;could someone tell me why the below FETCH NEXT CURSOR keep getting the data from the database table although it has just 400000 records?&lt;BR /&gt;the statement keep going till I receive a dump with&lt;/P&gt;
  &lt;H1&gt;no more storage space available for extending an internal table&lt;/H1&gt;
  &lt;BR /&gt; 
  &lt;PRE&gt;&lt;CODE&gt;OPEN CURSOR WITH HOLD lv_cursor FOR 
SELECT artkl_id FROM ZZ_artk.
DO. 
CLEAR lt_artk . 
FETCH NEXT CURSOR lv_cursor INTO CORRESPONDING FIELDS OF TABLE lt_artkl_data PACKAGE 
SIZE 10000. 
APPEND LINES OF lt_artk_data TO lt_artk_all.
IF sy-subrc &amp;lt;&amp;gt; 0 . 
CLOSE CURSOR lv_cursor_artkl_id.
EXIT.
ENDIF.
ENDDO.
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Best regards&lt;/P&gt;
  &lt;P&gt;Jenie&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 14:36:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718880#M33437</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-12-03T14:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: problem with FETCH NEXT CURSOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718881#M33438</link>
      <description>&lt;P&gt;You should check sy-subrc after FETCH. Not after APPEND command.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 15:04:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718881#M33438</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2018-12-03T15:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: problem with FETCH NEXT CURSOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718882#M33439</link>
      <description>&lt;P&gt;I did this but in vain the problem is that sy-subrc is is always = 0, in this case the data will be called again and again&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 17:39:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718882#M33439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-12-03T17:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: problem with FETCH NEXT CURSOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718883#M33440</link>
      <description>&lt;P&gt;The interest of using FETCH is to keep in memory a limited number of lines, not the whole table. So why do you append all the lines to an internal table? (your code is exactly like doing SELECT artkl_id FROM zz_artkl INTO TABLE lt_artk_all).&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 18:35:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718883#M33440</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-12-03T18:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: problem with FETCH NEXT CURSOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718884#M33441</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;jennifer1988&lt;/SPAN&gt; it is just illogical to do it your way (and sometimes dangerous, hopefully APPEND does not alter SY-SUBRC). Instead, write it like this, it's just more logical:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FETCH NEXT CURSOR lv_cursor INTO CORRESPONDING FIELDS OF TABLE lt_artkl_data 
       PACKAGE SIZE 10000.
IF sy-subrc &amp;lt;&amp;gt; 0 . 
CLOSE CURSOR lv_cursor_artkl_id.
EXIT.
ENDIF.
APPEND LINES OF lt_artk_data TO lt_artk_all.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Dec 2018 18:39:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718884#M33441</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-12-03T18:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: problem with FETCH NEXT CURSOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718885#M33442</link>
      <description>&lt;P&gt;In your short dump, you should see the number of lines of the internal table, the memory used, etc. If needed, use the debugger to list the data objects sorted by the amount of memory used.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 18:40:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718885#M33442</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-12-03T18:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: problem with FETCH NEXT CURSOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718886#M33443</link>
      <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;jennifer1988&lt;/SPAN&gt; : if it keep going mean it still fetchable, its very clear in F1 help about that.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 01:31:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718886#M33443</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2018-12-04T01:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: problem with FETCH NEXT CURSOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718887#M33444</link>
      <description>&lt;P&gt;Hi Sandra,&lt;/P&gt;&lt;P&gt;I am using append just to control and stand on  how many records has been called and this appended Table will not be used further...&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 08:38:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718887#M33444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-12-04T08:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: problem with FETCH NEXT CURSOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718888#M33445</link>
      <description>&lt;P&gt;If you run in debug you should be able to solve by yourself.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 09:31:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718888#M33445</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2018-12-04T09:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: problem with FETCH NEXT CURSOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718889#M33446</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;jennifer1988&lt;/SPAN&gt; you ran into a memory problem, so 400.000 lines was too much in your situation, so either you troubleshoot the memory problem which is not related to your ABAP code (cf my other answer), or you reduce the memory consumption and you don't load all the lines of the table (if it's just to count the lines, then just use SELECT COUNT( * )).&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 15:06:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-next-cursor/m-p/718889#M33446</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-12-04T15:06:20Z</dc:date>
    </item>
  </channel>
</rss>

