<?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: Commit work inside Open cursor : Please help in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-inside-open-cursor-please-help/m-p/6910252#M1482758</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;      I'm using open cursor for performance purpose as I'be to pull a large no. of records. Inside the do -enddo, &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;OPEN CURSOR will not help performance. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Apr 2010 13:27:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-28T13:27:34Z</dc:date>
    <item>
      <title>Commit work inside Open cursor : Please help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-inside-open-cursor-please-help/m-p/6910250#M1482756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;     I'm using open cursor for performance purpose as I'be to pull a large no. of records. Inside the do -enddo, I've to update a Ztable. So, after using the insert statement, I put " commit work" but it started giving dump because it resets the cursor.  To avoid that I used the function module "DB_commit" but it's not updating the records in Ztable. code is like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN CURSOR WITH HOLD lv_bsak_dbcur1 FOR&lt;/P&gt;&lt;P&gt;           SELECT bukrs augbl auggj kostl prctr gsber aufnr&lt;/P&gt;&lt;P&gt;                  lifnr umskz augdt gjahr belnr buzei budat bldat cpudt&lt;/P&gt;&lt;P&gt;                  waers bschl shkzg mwskz dmbtr wrbtr sgtxt saknr&lt;/P&gt;&lt;P&gt;                  zfbdt zterm zbd3t zlsch hbkid rebzg rebzj rebzz  fistl&lt;/P&gt;&lt;P&gt;                  geber  bstat FROM bsak&lt;/P&gt;&lt;P&gt;             WHERE gjahr IN r_gjahr&lt;/P&gt;&lt;P&gt;             ORDER BY bukrs augbl auggj kostl prctr gsber aufnr.&lt;/P&gt;&lt;P&gt;      DO.&lt;/P&gt;&lt;P&gt;        REFRESH it_bsak.&lt;/P&gt;&lt;P&gt;        FETCH NEXT CURSOR lv_bsak_dbcur1&lt;/P&gt;&lt;P&gt;        APPENDING CORRESPONDING FIELDS OF TABLE it_bsak&lt;/P&gt;&lt;P&gt;        PACKAGE SIZE iv_fetch_batch_size.&lt;/P&gt;&lt;P&gt;        IF NOT sy-subrc IS INITIAL.&lt;/P&gt;&lt;P&gt;          CLOSE CURSOR lv_bsak_dbcur1.&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;        IF NOT it_bsak IS INITIAL.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;some process to form fina table&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;insert ztable from table it_final.&lt;/P&gt;&lt;P&gt;if sy-subrc is initial.&lt;/P&gt;&lt;P&gt;call function "DB_commit".&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if I'll use "commit work", it'll give dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise as what to do so that Dump can be avoided &amp;amp; records cab updated as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks:&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 11:30:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-inside-open-cursor-please-help/m-p/6910250#M1482756</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-28T11:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work inside Open cursor : Please help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-inside-open-cursor-please-help/m-p/6910251#M1482757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You you have realized a COMMIT WORK before the CLOSE CURSOR closes the DB cursor, so you cannot use it in one shot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you not commit the db changes outside the DO ... FETCH ... ENDDO block ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 11:54:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-inside-open-cursor-please-help/m-p/6910251#M1482757</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-04-28T11:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work inside Open cursor : Please help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-inside-open-cursor-please-help/m-p/6910252#M1482758</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;      I'm using open cursor for performance purpose as I'be to pull a large no. of records. Inside the do -enddo, &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;OPEN CURSOR will not help performance. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 13:27:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-inside-open-cursor-please-help/m-p/6910252#M1482758</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-28T13:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work inside Open cursor : Please help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-inside-open-cursor-please-help/m-p/6910253#M1482759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are rith with the DB commit and the COMMIT WORK. The db commit can be used with the OPEN CURSOR ... WITH HOLD. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;gt; but it's not updating the records in Ztable.&lt;/P&gt;&lt;P&gt;You did you check that? In parallel to the running process, then you have to check how your database handles commits reads.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add a counter for the packages for testing:&lt;/P&gt;&lt;P&gt;+ Test whether it works at all with COMMIT WORK after the first package&lt;/P&gt;&lt;P&gt;+ Change to 2 packages and DB_COMMIT and check after it is finished whether the INSERTs are there.&lt;/P&gt;&lt;P&gt;+ Process all packages&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 13:32:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-inside-open-cursor-please-help/m-p/6910253#M1482759</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-28T13:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work inside Open cursor : Please help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-inside-open-cursor-please-help/m-p/6910254#M1482760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Rob&lt;/P&gt;&lt;P&gt;sorry, he is absolutely right. Large amounts of data should be processed in packages (50.000) and the resulting changes should be db_commited to get ride of the redo etc. block of the database. This has performance impacts. It is also better if problems occurs, which can require a repeat of the execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 13:36:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-inside-open-cursor-please-help/m-p/6910254#M1482760</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-28T13:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work inside Open cursor : Please help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-inside-open-cursor-please-help/m-p/6910255#M1482761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;lr_db_connection&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;) = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;cl_sql_connection&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;get_connection&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;cl_sadl_dbcon&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;=&amp;gt;g&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;et_default_dbcon&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;( ) ).&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;open cursor &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;lv_cursor &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;for select &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;* &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;from &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;p_table&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;).&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;fetch next cursor &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;lv_cursor &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;into table &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;lt;dyn_tab&amp;gt; package &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;size &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;p_commit&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;if &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;sy&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;subrc &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;eq &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;insert &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;p_table&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;from table &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;lt;dyn_tab&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lr_db_connection&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;commit&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;( ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;close cursor &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;lv_cursor&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;exit&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;endif&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;enddo&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 10pt; font-family: arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2016 11:33:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-inside-open-cursor-please-help/m-p/6910255#M1482761</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-09-09T11:33:15Z</dc:date>
    </item>
  </channel>
</rss>

