<?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: OPEN CURSOR..FETCH NEXT CURSOR - dump in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094980#M1507682</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG&gt;Former Member&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The short dump occurs if you have use "COMMIT WORK", or "COMMIT WORK AND WAIT" (in short if you introduce any type of COMMIT) in your program. Please remove the statment and it will get removed. Also, One point to be noted that, when you use OPEN CURSOR, the DB COMMIT automatically happens at the Data base level, so no need to write COMMIT WORK.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Dec 2014 13:52:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-12-15T13:52:36Z</dc:date>
    <item>
      <title>OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094949#M1507651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;A dump(CX_SY_OPEN_SQL_DB) is occured when i run  the code below .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think cursor is closed or lost because of BAPI_ALM_ORDER_GET_DETAIL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I  use OPEN CURSOR and FETCH NEXT CURSOR statements&lt;/P&gt;&lt;P&gt;because I use similar code below in a function which is called by RSA3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If package size is 100, dump is occured at second fetching .&lt;/P&gt;&lt;P&gt;If package size is much less than 100,&lt;/P&gt;&lt;P&gt;for example  2,3,4 or 5,&lt;/P&gt;&lt;P&gt;dump is occured after several fetching .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any suggestion is appreciated .&lt;/P&gt;&lt;P&gt;Thanks .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : s_cursor TYPE cursor .&lt;/P&gt;&lt;P&gt;DATA : lt_afru TYPE TABLE OF afru WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA : ls_header        TYPE bapi_alm_order_header_e.&lt;/P&gt;&lt;P&gt;DATA : ls_srvdata       TYPE bapi_alm_order_srvdat_e.&lt;/P&gt;&lt;P&gt;DATA : ls_reforder_item TYPE bapi_reforder_item.&lt;/P&gt;&lt;P&gt;DATA : lt_opr TYPE TABLE OF  bapi_alm_order_operation_e.&lt;/P&gt;&lt;P&gt;DATA : lt_ret TYPE TABLE OF bapiret2 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  OPEN CURSOR WITH HOLD s_cursor FOR&lt;/P&gt;&lt;P&gt;  SELECT * FROM afru .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    REFRESH lt_afru .&lt;/P&gt;&lt;P&gt;    FETCH NEXT CURSOR s_cursor&lt;/P&gt;&lt;P&gt;      INTO TABLE lt_afru&lt;/P&gt;&lt;P&gt;       PACKAGE SIZE  100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT lt_afru .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          number           = lt_afru-aufnr&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          es_header        = ls_header&lt;/P&gt;&lt;P&gt;          es_srvdata       = ls_srvdata&lt;/P&gt;&lt;P&gt;          es_reforder_item = ls_reforder_item&lt;/P&gt;&lt;P&gt;        TABLES&lt;/P&gt;&lt;P&gt;          et_operations    = lt_opr&lt;/P&gt;&lt;P&gt;          return           = lt_ret.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jul 2010 12:54:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094949#M1507651</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-22T12:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094950#M1507652</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;Why are you using native SQL? Use simply the OPEN SQL SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM afru INTO TABLE lt_afru...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR if you have to use the Native SQL...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT the whole data, and only after selection, start the processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH lt_afru .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DO.
FETCH NEXT CURSOR s_cursor
INTO ls_afru.
APPEND ls_afru TO tl_afru.
ENDDO.

LOOP AT lt_afru .

CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'
EXPORTING
number = lt_afru-aufnr
IMPORTING
es_header = ls_header
es_srvdata = ls_srvdata
es_reforder_item = ls_reforder_item
TABLES
et_operations = lt_opr
return = lt_ret.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tamá&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jul 2010 13:01:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094950#M1507652</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-22T13:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094951#M1507653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't get all data because a similar code is written in a function which will be used for BW transportation.&lt;/P&gt;&lt;P&gt;I test the function with using RSA3 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i need to get the data at smaller sizes. &lt;/P&gt;&lt;P&gt;This provide us not to have any memory problem and &lt;/P&gt;&lt;P&gt;Transported data  stay in small sizes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jul 2010 13:24:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094951#M1507653</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-22T13:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094952#M1507654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try replacing the DO...ENDDO statements with SELECT ... ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: lv_count TYPE i.
SELECT * FROM afru INTO ls_afru.
APPEND ls_afru TO lt_afru.
ADD 1 TO lv_count.
IF lv_count &amp;gt;= 100.
* call BAPI here
CLEAR lv_count.
REFRESH: lt_afru.
ENDIF.
ENDSELECT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you think? Just for testing purposes...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tamás&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Tamás Nyisztor on Jul 22, 2010 3:43 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jul 2010 13:42:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094952#M1507654</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-22T13:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094953#M1507655</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;Maybe i should write the problem more clearer .&lt;/P&gt;&lt;P&gt;The code i write above is just an example focused on cursor lost problem .&lt;/P&gt;&lt;P&gt; It shows the cursor is lost when BAPI_ALM_ORDER_GET_DETAIL is used between DO and ENDDO .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So why i need OPEN CURSOR--FETCH NEXT CURSOR instead of SELECT..ENDSELECT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function which will be used for BW tranportation is called much more than once .&lt;/P&gt;&lt;P&gt;When it is called first , a similar code below is run&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      OPEN CURSOR WITH HOLD s_cursor FOR&lt;/P&gt;&lt;P&gt;      SELECT * FROM afru .&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When it is called second time, this time fetch code is run in the same function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    FETCH NEXT CURSOR s_cursor&lt;/P&gt;&lt;P&gt;      INTO TABLE lt_afru&lt;/P&gt;&lt;P&gt;               PACKAGE SIZE s_s_if-maxsize.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you may know, RSA3 calls the function again and again until all data is get .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we have no DO..ENDDO in our function, because it is called more than once &lt;/P&gt;&lt;P&gt;and everytime it is called fetching is done .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT..ENDSELECT cant work here. Because we need a cursor to get the data.&lt;/P&gt;&lt;P&gt;In every time function is called, we always get the same data if we use SELECT..ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ceyhun Ergün on Jul 22, 2010 4:01 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ceyhun Ergün on Jul 22, 2010 4:01 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jul 2010 13:57:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094953#M1507655</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-22T13:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094954#M1507656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM afru .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is this a example or the actual code where you get the dump ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT..ENDSELECT cant work here. Because we need a cursor to get the data.&lt;/P&gt;&lt;P&gt;In every time function is called, we always get the same data if we use SELECT..ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use the &lt;STRONG&gt;package size&lt;/STRONG&gt; directly in query if required.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jul 2010 15:09:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094954#M1507656</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-07-22T15:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094955#M1507657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I try to tell my problem more clearer. This schema shows how zfunction is called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RSA3&lt;/P&gt;&lt;P&gt;   I--&lt;DEL&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;HR originaltext="---" /&gt;&amp;gt; 1st call zfunction   -&amp;gt; open cursor--&lt;P&gt;&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;&amp;gt; ok&lt;/P&gt;&lt;P&gt;                                                                                I&lt;/P&gt;&lt;P&gt;   I&amp;lt;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------------" /&gt;&lt;P&gt;I&lt;/P&gt;&lt;P&gt;   I&lt;/P&gt;&lt;P&gt;   I--&lt;DEL&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;HR originaltext="---" /&gt;&amp;gt; 2nd call zfunction -&amp;gt; fetch next cursor--&amp;gt; ok&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                                                                I&lt;/P&gt;&lt;P&gt;   I&amp;lt;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------------" /&gt;&lt;P&gt;I&lt;/P&gt;&lt;P&gt;   I&lt;/P&gt;&lt;P&gt;   I--&lt;DEL&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;HR originaltext="---" /&gt;&amp;gt; 3nd call zfunction -&amp;gt; fetch next cursor--&amp;gt; dump occured!&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DUMP is occured on the line of  FETCH NEXT CURSOR .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code i wrote in the first message, it simply simulates the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is select..endselect works for this situation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;zfunction code algorithm :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF IsFunctionCalledFirst = true.&lt;/P&gt;&lt;P&gt;    OPEN CURSOR...&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;    FETCH NEXT CURSOR ... INTO TABLE itab.&lt;/P&gt;&lt;P&gt;    LOOP AT itab.&lt;/P&gt;&lt;P&gt;         CALL BAPI .&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 06:20:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094955#M1507657</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-23T06:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094956#M1507658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you can just use the package size with a conventional select into table statement to achieve your goal. Basically the code is between a SELECT and ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would look something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM afru &lt;/P&gt;&lt;P&gt;into table lt_afru&lt;/P&gt;&lt;P&gt;package size 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT lt_afru .&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;number = lt_afru-aufnr&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;es_header = ls_header&lt;/P&gt;&lt;P&gt;es_srvdata = ls_srvdata&lt;/P&gt;&lt;P&gt;es_reforder_item = ls_reforder_item&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;et_operations = lt_opr&lt;/P&gt;&lt;P&gt;return = lt_ret.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 06:33:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094956#M1507658</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2010-07-23T06:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094957#M1507659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change the declaration to static&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STATICS : s_cursor TYPE cursor .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 07:02:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094957#M1507659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-23T07:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094958#M1507660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for reply,&lt;/P&gt;&lt;P&gt;I change declaration to statics. But still dump is occured .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 07:51:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094958#M1507660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-23T07:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094959#M1507661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please let me know the dump details and the values of each variable before dump using debugger.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nikhil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 08:19:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094959#M1507661</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-23T08:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094960#M1507662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope your cursor is not getting closed before the second fetch &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 08:51:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094960#M1507662</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-07-23T08:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094961#M1507663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you dont need to close the cursor every time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cursor should open in the first call and should close in the last call to this FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to check whether cursor value is clearing in between or not?&lt;/P&gt;&lt;P&gt;Whether cursor is closing in between?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check it in debugger and see the cursor values in each call. After fetching all the records, check if it coming out correctly or not.&lt;/P&gt;&lt;P&gt;Also check cursor is closing after the select query is not fetching any data.&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;Nikhil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 08:59:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094961#M1507663</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-23T08:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094962#M1507664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, i don't close cursor before second fetch:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    FETCH NEXT CURSOR s_cursor&lt;/P&gt;&lt;P&gt;      INTO TABLE lt_afru&lt;/P&gt;&lt;P&gt;       PACKAGE SIZE  100.&lt;/P&gt;&lt;P&gt;    if sy-subrc &amp;lt;&amp;gt; 0 .&lt;/P&gt;&lt;P&gt;        CLOSE CURSOR s_cursor.&lt;/P&gt;&lt;P&gt;        exit .&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sorry that , i forgot to write this part of code in my first message:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think BAPI is closed the cursor:)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 10:54:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094962#M1507664</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-23T10:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094963#M1507665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Code should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc NE 0 .&lt;/P&gt;&lt;P&gt;CLOSE CURSOR s_cursor.&lt;/P&gt;&lt;P&gt;exit .&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Nikhil V Kumar on Jul 23, 2010 4:49 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 11:05:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094963#M1507665</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-23T11:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094964#M1507666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think BAPI is closed the cursor:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are using &lt;STRONG&gt;with hold&lt;/STRONG&gt; , so the cursor will not be closed due to commit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 11:09:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094964#M1507666</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-07-23T11:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094965#M1507667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nikhil V Kumar ,&lt;/P&gt;&lt;P&gt;it's exactly how you wrote.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i use "NE" now .&lt;/P&gt;&lt;P&gt;I think tags are invisible in this forum:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keshav.T ,&lt;/P&gt;&lt;P&gt;i know it must work , unfortunately it doesnt work.&lt;/P&gt;&lt;P&gt;I think BAPI close the cursor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code below is the final code:)&lt;/P&gt;&lt;P&gt;When you run this code, a dump is occured.&lt;/P&gt;&lt;P&gt;If you would like to see,&lt;/P&gt;&lt;P&gt;just run the code below .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZCE_004.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PERFORM process .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  PROCESS&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM PROCESS .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  STATICS : s_cursor TYPE cursor .&lt;/P&gt;&lt;P&gt;  DATA : lt_afru TYPE TABLE OF afru WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;  DATA : ls_header        TYPE bapi_alm_order_header_e.&lt;/P&gt;&lt;P&gt;  DATA : ls_srvdata       TYPE bapi_alm_order_srvdat_e.&lt;/P&gt;&lt;P&gt;  DATA : ls_reforder_item TYPE bapi_reforder_item.&lt;/P&gt;&lt;P&gt;  DATA : lt_opr TYPE TABLE OF  bapi_alm_order_operation_e.&lt;/P&gt;&lt;P&gt;  DATA : lt_ret TYPE TABLE OF bapiret2 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  OPEN CURSOR WITH HOLD s_cursor FOR&lt;/P&gt;&lt;P&gt;  SELECT * FROM afru .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    REFRESH lt_afru .&lt;/P&gt;&lt;P&gt;    FETCH NEXT CURSOR s_cursor&lt;/P&gt;&lt;P&gt;      INTO TABLE lt_afru&lt;/P&gt;&lt;P&gt;       PACKAGE SIZE  100.&lt;/P&gt;&lt;P&gt;    if sy-subrc NE 0 .&lt;/P&gt;&lt;P&gt;        CLOSE CURSOR s_cursor.&lt;/P&gt;&lt;P&gt;        exit .&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT lt_afru .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          number           = lt_afru-aufnr&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          es_header        = ls_header&lt;/P&gt;&lt;P&gt;          es_srvdata       = ls_srvdata&lt;/P&gt;&lt;P&gt;          es_reforder_item = ls_reforder_item&lt;/P&gt;&lt;P&gt;        TABLES&lt;/P&gt;&lt;P&gt;          et_operations    = lt_opr&lt;/P&gt;&lt;P&gt;          return           = lt_ret.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " PROCESS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ceyhun Ergün on Jul 23, 2010 1:28 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 11:26:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094965#M1507667</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-23T11:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094966#M1507668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; You are using &lt;STRONG&gt;with hold&lt;/STRONG&gt; , so the cursor will not be closed due to commit.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not exactly correct. SAP documentation says: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;If the addition WITH HOLD is specified, the database cursor is not closed by a database commit executed using Native SQL. The addition does not have an influence, however, on implicit database commits or on any rollbacks which always close the database cursor. &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source: [http://help.sap.com/abapdocu_70/en/ABAPOPEN_CURSOR.htm]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 11:52:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094966#M1507668</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-07-23T11:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094967#M1507669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I executed here. I dont have any data in the table AFRU. But I added in the internal table by debugging. I didnt get any dump here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
START-OF-SELECTION .


  PERFORM process .


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  PROCESS
*&amp;amp;---------------------------------------------------------------------*
FORM PROCESS .

  STATICS : s_cursor TYPE cursor .
  DATA : lt_afru TYPE TABLE OF afru WITH HEADER LINE.
  DATA : ls_header        TYPE bapi_alm_order_header_e.
  DATA : ls_srvdata       TYPE bapi_alm_order_srvdat_e.
*  DATA : ls_reforder_item TYPE bapi_reforder_item.
  DATA : lt_opr TYPE TABLE OF  bapi_alm_order_operation_e.
  DATA : lt_ret TYPE TABLE OF bapiret2 WITH HEADER LINE.

  OPEN CURSOR WITH HOLD s_cursor FOR
  SELECT * FROM afru .

  DO.
    REFRESH lt_afru .
    FETCH NEXT CURSOR s_cursor
      INTO TABLE lt_afru
       PACKAGE SIZE  1.
    if sy-subrc NE 0 .
      CLOSE CURSOR s_cursor.
      exit .
    endif.

    LOOP AT lt_afru .

      CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'
        EXPORTING
          number           = lt_afru-aufnr
        IMPORTING
          es_header        = ls_header
          es_srvdata       = ls_srvdata
*          es_reforder_item = ls_reforder_item
        TABLES
          et_operations    = lt_opr
          return           = lt_ret.
    ENDLOOP.
  ENDDO.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 12:27:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094967#M1507669</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-23T12:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN CURSOR..FETCH NEXT CURSOR - dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094968#M1507670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all , thank you very very much for your reply and help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As i said before, if package size is 100, the dump occured at the second fetch,&lt;/P&gt;&lt;P&gt;if package size is much less than 100, the dump occured after several fetch&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I add a counter into my code,&lt;/P&gt;&lt;P&gt;I see this strange result :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Package Size/  fetch number dump occured &lt;/P&gt;&lt;P&gt;1 /                        17 &lt;/P&gt;&lt;P&gt;2  /                        9&lt;/P&gt;&lt;P&gt;3  /                        7&lt;/P&gt;&lt;P&gt;4  /                        5&lt;/P&gt;&lt;P&gt;5  /                        5&lt;/P&gt;&lt;P&gt;6  /                        4&lt;/P&gt;&lt;P&gt;7   /                       4&lt;/P&gt;&lt;P&gt;8   /                       3&lt;/P&gt;&lt;P&gt;9   /                       3&lt;/P&gt;&lt;P&gt;10  /                      3&lt;/P&gt;&lt;P&gt;15  /                      3&lt;/P&gt;&lt;P&gt;30   /                     2&lt;/P&gt;&lt;P&gt;100  /                    2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested this several times. And the result is always same.&lt;/P&gt;&lt;P&gt;The number of records in itab affects when the dump wil be occured  .&lt;/P&gt;&lt;P&gt;strange.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ceyhun Ergün on Jul 23, 2010 3:07 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 13:07:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-fetch-next-cursor-dump/m-p/7094968#M1507670</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-23T13:07:43Z</dc:date>
    </item>
  </channel>
</rss>

