<?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/7094970#M1507672</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Runtime Errors         DBIF_RSQL_INVALID_CURSOR&lt;/P&gt;&lt;P&gt;Except.                CX_SY_OPEN_SQL_DB&lt;/P&gt;&lt;P&gt;Date and Time          23.07.2010 15:56:03&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------------------------------------" /&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Short text&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Invalid interruption of a database selection.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------------------------------------" /&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;What happened?&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Error in the ABAP Application Program&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;The current ABAP program "ZCE_004" had to be terminated because it has&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;come across a statement that unfortunately cannot be executed.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Unable to perform database selection fully.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------------------------------------" /&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;What can you do?&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;If the error occurs in debugging mode, you should first run&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;the processes to be tested without debugging activated.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;If the error persists outside debugging, you must check&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;the application program more closely.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;No error that requires action&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Note down which actions and inputs caused the error.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;To process the problem further, contact you SAP system&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;administrator.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Using Transaction ST22 for ABAP Dump Analysis, you can look&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;at and manage termination messages, and you can also&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;keep them for a long time.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------------------------------------" /&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Error analysis&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;An exception occurred that is explained in detail below.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;in&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;procedure "PROCESS" "(FORM)", nor was it propagated by a RAISING clause.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Since the caller of the procedure could not have anticipated that the&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;exception would occur, the current program is terminated.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;The reason for the exception is:&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;One of the database selections included a database Commit.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;The selection was then supposed to continue. Before a&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;database commit, however, all outstanding database selections&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;must be concluded.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Possible causes in the application program:&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;While a read process from a database cursor is taking place&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;(within a loop SELECT/LOOP/EXEC SQL or before a FETCH command),&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;one of the following statements is used:&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;- MESSAGE (apart from MESSAGE S...)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;- COMMIT WORK&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;- ROLLBACK WORK&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;- BREAK-POINT&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;- WAIT&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;- CALL FUNCTION ... DESTINATION (synchronous RFC)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;- CALL FUNCTION ... STARTING NEW TASK&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;- RECEIVE RESULTS&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;- CALL DIALOG&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;- CALL SELECTION-SCREEN&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;- CALL TRANSACTION&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;- CALL SCREEN, or any other statement that results in the display of a&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;new screen&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Whenever a program runs in debugging mode, a "COMMIT WORK" can&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;possibly be triggered during database selection. This abnormal&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;termination can also occur in debugging mode even with a correct&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;program.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;A "COMMIT WORK" during debugging may be due to the following reasons:&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1. A program or screen was regenerated during debugging&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;and updated in the database.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2. Each user needs a separate process in debugging mode, but&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;the number of available processes is restricted. If this&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;limit is exceeded, each debugging step then requires a&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;"COMMIT WORK".&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;The error occurs in a statement in which the table "AFRU " is accessed.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Jul 2010 13:41:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-07-23T13:41:14Z</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>

