<?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 cursor statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-cursor-statement/m-p/7727500#M1580663</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using Withhold will not make sure that the cursor will not get closed because of commits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP Doc says&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&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;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to check the part written in your parallel processing logic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Brad said please donot dump your old threads like this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 Apr 2011 06:30:39 GMT</pubDate>
    <dc:creator>kesavadas_thekkillath</dc:creator>
    <dc:date>2011-04-02T06:30:39Z</dc:date>
    <item>
      <title>Problem with fetch cursor statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-cursor-statement/m-p/7727496#M1580659</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;I am using FETCH CURSOR statement to fetch the data from a database table with package size. For the fetched records I am doing parallel processing using parallel processing frame work in banking system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here the problem is for the first iteration it works fine but when it comes to FETCH NEXT CURSOR in the second iteration , programs gets dumping by saying that 'CURSOR already closed'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not closing the cursor in the program but some how it got closed some where in the standard function module which I used for parallel processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used WITHHOLD also along with FETCH CURSOR but no use. Please let me know how to avoid the cursor to get close.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT l_tab_product IS INITIAL.&lt;/P&gt;&lt;P&gt;    OPEN CURSOR WITH HOLD lv_cursor FOR&lt;/P&gt;&lt;P&gt;     SELECT contract_int prodint cn_currency mig_grp&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          INTO TABLE gt_cont&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            FROM bca_contract&lt;/P&gt;&lt;P&gt;            FOR ALL ENTRIES IN l_tab_product&lt;/P&gt;&lt;P&gt;            WHERE prodint = l_tab_product-prodint&lt;/P&gt;&lt;P&gt;            AND   mig_grp IN s_migrp.&lt;/P&gt;&lt;P&gt;    DO.&lt;/P&gt;&lt;P&gt;      FETCH NEXT CURSOR lv_cursor&lt;/P&gt;&lt;P&gt;                        INTO TABLE gt_cont&lt;/P&gt;&lt;P&gt;                             PACKAGE SIZE lv_size.&lt;/P&gt;&lt;P&gt;      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        CLOSE CURSOR lv_cursor.&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;parallel processing logic&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 17:33:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-cursor-statement/m-p/7727496#M1580659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-01T17:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with fetch cursor statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-cursor-statement/m-p/7727497#M1580660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are closing the CURSOR.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc 0.&lt;/P&gt;&lt;P&gt;CLOSE CURSOR lv_cursor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 17:52:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-cursor-statement/m-p/7727497#M1580660</guid>
      <dc:creator>Sandeep_Panghal</dc:creator>
      <dc:date>2011-04-01T17:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with fetch cursor statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-cursor-statement/m-p/7727498#M1580661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry that is typo.&lt;/P&gt;&lt;P&gt;I am not closing it.&lt;/P&gt;&lt;P&gt; If sy-subrc NE 0&lt;/P&gt;&lt;P&gt;CLOSE CURSOR lv_cursor.&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used above code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 17:59:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-cursor-statement/m-p/7727498#M1580661</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-01T17:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with fetch cursor statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-cursor-statement/m-p/7727499#M1580662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please stop flooding our forum with all of your posts.  You don't need to put useless comments in 3 year old posts when you close them.  Is this some sort of April Fool's activity?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 19:04:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-cursor-statement/m-p/7727499#M1580662</guid>
      <dc:creator>brad_bohn</dc:creator>
      <dc:date>2011-04-01T19:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with fetch cursor statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-cursor-statement/m-p/7727500#M1580663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using Withhold will not make sure that the cursor will not get closed because of commits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP Doc says&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&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;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to check the part written in your parallel processing logic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Brad said please donot dump your old threads like this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Apr 2011 06:30:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-cursor-statement/m-p/7727500#M1580663</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-04-02T06:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with fetch cursor statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-cursor-statement/m-p/7727501#M1580664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What Brad said. This gives me a chance though to delete some of these threads altogether.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the future, please leave the comment box emtpy when closing old threads, unless you want to reveal your own breakthrough solution to the initial problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Apr 2011 19:27:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-fetch-cursor-statement/m-p/7727501#M1580664</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2011-04-02T19:27:23Z</dc:date>
    </item>
  </channel>
</rss>

