<?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: Fetch Next Cursor Short Dumps in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-next-cursor-short-dumps/m-p/4440749#M1053583</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's going on in "ouput_to_text_file"? Whatever it is that loses the cursor, maybe it can be replaced with something that does not lose it. e.g. COMMIT WORK can be replaced by a call to function DB_COMMIT. Subject to your analysis.&lt;/P&gt;&lt;P&gt;Another approach would be to SELECT UP TO x ROWS, remember the last primary key (EBELN + EBELP) and continue reading from that key onwards in each loop.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Sep 2008 14:48:40 GMT</pubDate>
    <dc:creator>ThomasZloch</dc:creator>
    <dc:date>2008-09-18T14:48:40Z</dc:date>
    <item>
      <title>Fetch Next Cursor Short Dumps</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-next-cursor-short-dumps/m-p/4440748#M1053582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;   I have the following code which short dumps after losing its cursor position.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;OPEN CURSOR WITH HOLD dbcur FOR
      select * from ekpo where bukrs in s_bukrs2.

      do.
          FETCH NEXT CURSOR dbcur INTO table iekpo package size pkgsize.

          if sy-subrc &amp;lt;&amp;gt; 0.
             close cursor dbcur.
             exit.
          else.
              perform ouput_to_text_file.
              refresh: iekpo.
           endif.
      enddo.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have millions of records to be extracted and  simple select to an internal table causes memory problems.  Thus I need to extract a chunk of records write them to a text file, then get the next chunk.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2008 14:43:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-next-cursor-short-dumps/m-p/4440748#M1053582</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-18T14:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch Next Cursor Short Dumps</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-next-cursor-short-dumps/m-p/4440749#M1053583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's going on in "ouput_to_text_file"? Whatever it is that loses the cursor, maybe it can be replaced with something that does not lose it. e.g. COMMIT WORK can be replaced by a call to function DB_COMMIT. Subject to your analysis.&lt;/P&gt;&lt;P&gt;Another approach would be to SELECT UP TO x ROWS, remember the last primary key (EBELN + EBELP) and continue reading from that key onwards in each loop.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2008 14:48:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-next-cursor-short-dumps/m-p/4440749#M1053583</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-09-18T14:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch Next Cursor Short Dumps</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-next-cursor-short-dumps/m-p/4440750#M1053584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Thomas,&lt;/P&gt;&lt;P&gt;     In the output to text file form I am using GUI Download to export data to a text file (or if in the background using dataset and transfer to write to the text file).  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your suggestion for reading up to x rows, how would that work exactly?  Do you have an example you can share, specifically keeping track of what you've already selected and selecting the next records?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2008 14:58:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-next-cursor-short-dumps/m-p/4440750#M1053584</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-18T14:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch Next Cursor Short Dumps</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-next-cursor-short-dumps/m-p/4440751#M1053585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GUI Download probably causes problem, writing to a dataset on app server might not cause the problem, maybe you want to try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding the select, here is some pseudo code outlining what I mean:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
clear wa_ekpo.
do.
  select * from ekpo into table lt_ekpo up to 10,000 rows 
      where ebeln &amp;gt; wa_ekpo-ebeln or ( ebeln = wa_ekpo-ebeln and ebelp &amp;gt; wa_ekpo-ebelp )
      order by primary key.
  if sy-subrc ne 0.
    exit.
  endif.
  download lt_ekpo (appending to existing file)
  l_lines = lines( lt_ekpo ).
  read table lt_ekpo into wa_ekpo index l_lines.
enddo.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will run for a while, but should not dump out &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2008 15:31:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-next-cursor-short-dumps/m-p/4440751#M1053585</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-09-18T15:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch Next Cursor Short Dumps</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-next-cursor-short-dumps/m-p/4440752#M1053586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That looks like it does the trick.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;Points have been awarded!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2008 15:47:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-next-cursor-short-dumps/m-p/4440752#M1053586</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-18T15:47:02Z</dc:date>
    </item>
  </channel>
</rss>

