<?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 in Badi in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501146#M1258344</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked the modify statement.&lt;/P&gt;&lt;P&gt;When the statement fails, it is either giving a SY-SUBRC &amp;lt;&amp;gt; 0 or a short dump.&lt;/P&gt;&lt;P&gt;But in my case, the value of a column is updated with twice the value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any alternative ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Apr 2009 06:56:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-21T06:56:54Z</dc:date>
    <item>
      <title>COMMIT WORK in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501138#M1258336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What exactly are the implications or advantages of placing a 'COMMIT WORK' statement in a Badi Implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To be more specific, in one of the implementations of Order_Save Badi, I'm trying to update a custom table. At this point I'm using the 'Commit Work' statement .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any inputs on this regard would be of great help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance,&lt;/P&gt;&lt;P&gt;Kris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 11:05:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501138#M1258336</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-17T11:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501139#M1258337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Commit work will end a LUW. and a new LUW will start fromm there..&lt;/P&gt;&lt;P&gt;ur Save Order is a combination of LUWs..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the commit work statement is executed the custom table will get updated through Update work process. else... U records would not get update in DB..even though You  insert/modify/change a record in table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope i have answered ur question..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sarath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 11:10:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501139#M1258337</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-17T11:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501140#M1258338</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;To give you a very specific answer, the COMMIT WORK statement triggers following reactions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. SAP LUW ends&lt;/P&gt;&lt;P&gt;2. All Buffers are refreshed i.e cleared.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The implication can be that your code may go into dump or the data updated might be missed as in between the process you are clearing all buffer memories.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope its clear,&lt;/P&gt;&lt;P&gt;RJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 11:15:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501140#M1258338</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-17T11:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501141#M1258339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; COMMIT WORK should not be used in BADIs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Commit work in  BADI is dangerous as if you do a commit work in the BADI , it will commit the database changes. But after the BADI execution it finds that some data is not proper and so the transaction is terminated without saving or creating the record. But since the commit work was performed in the BADI, those unnecessary changes will be there in the database even though the transaction has not been saved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do your changes in the BADI without commiting and later on when the transaction is completed, the std code will do a commit work . In that commit work your changes in the BADI will also be committed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Soumya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 11:22:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501141#M1258339</guid>
      <dc:creator>soumya_jose3</dc:creator>
      <dc:date>2009-04-17T11:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501142#M1258340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Soumya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is a helpful info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in my case, the database tables are not updated properly if I remove the COMMIT WOTK statement.&lt;/P&gt;&lt;P&gt;I tried debugging the implementation code where I'm inserting the data into the custom table from an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the internal table, the data was proper. But after the debugger leaves the implementation, I press F8 and find that the custom table has one of the fields updated with twice the expected value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any otherway I can force a commit on to the database or eradicate this malfunctioning ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance,&lt;/P&gt;&lt;P&gt;Kris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2009 06:18:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501142#M1258340</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-20T06:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501143#M1258341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; There might be some bug in the code written in the BADI.&lt;/P&gt;&lt;P&gt; Can you paste the code by which you are updating the custom table here???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Soumya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2009 11:07:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501143#M1258341</guid>
      <dc:creator>soumya_jose3</dc:creator>
      <dc:date>2009-04-20T11:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501144#M1258342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Soumya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the code that I've written within the Order_Save badi implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*********************************************************************************&lt;/P&gt;&lt;P&gt;Select * from ZCUSTOM into table ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read Table ITAB into WA_ITAB with key &lt;/P&gt;&lt;P&gt;WA_ITAB - Delivered_Quantity = WA_ITAB - Delivered_Quantity + Input_Delivered_quantity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modify table ITAB from WA_ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If NOT ITAB[] IS INITIAL.&lt;/P&gt;&lt;P&gt;  MODIFY ZCUSTOM from ITAB.&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;&lt;/P&gt;&lt;P&gt;The delivered quantity was 25 initially.&lt;/P&gt;&lt;P&gt;Input_Delivered_quantity has the value 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked the internal table ITAB contents in the debugger before the last IF statement.&lt;/P&gt;&lt;P&gt;ITAB[2]-Delivered_Quantity has the value 30 as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked the database table after the modify statement. It was not updated.&lt;/P&gt;&lt;P&gt;After the next COMMIT WORK statement, the database table has been updated, but with the value 35 instead of 30.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not always the same. Some times I observe a proper value in the database table, but sometimes double the expected value....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anything that could be done to avoid this issue ?&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;Kris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 06:39:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501144#M1258342</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-21T06:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501145#M1258343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just check if your Read statement or the Modify statement is not failing in some cases.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 06:52:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501145#M1258343</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-21T06:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501146#M1258344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked the modify statement.&lt;/P&gt;&lt;P&gt;When the statement fails, it is either giving a SY-SUBRC &amp;lt;&amp;gt; 0 or a short dump.&lt;/P&gt;&lt;P&gt;But in my case, the value of a column is updated with twice the value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any alternative ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 06:56:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501146#M1258344</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-21T06:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501147#M1258345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I believe  the COMMIT WORK you are referring to is not in the BADI implementation and it is in the std code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since after the modify statement in the BADI implementation, the value is 30, you must check at any other point this table ZCUSTOM is getting updated in  any other BADI implementation methods or in  any other methods of the same implementation. You can check this while debugging.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Soumya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 07:06:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501147#M1258345</guid>
      <dc:creator>soumya_jose3</dc:creator>
      <dc:date>2009-04-21T07:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501148#M1258346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be the same code is executed twice.Did u chk that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if flag NE 'X'.
Select * from ZCUSTOM into table ITAB.

Read Table ITAB into WA_ITAB with key 
WA_ITAB - Delivered_Quantity = WA_ITAB - Delivered_Quantity + Input_Delivered_quantity.

Modify table ITAB from WA_ITAB.

If NOT ITAB[] IS INITIAL.
MODIFY ZCUSTOM from ITAB.
flag = 'X'.
endif.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rhea.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 07:08:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501148#M1258346</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-21T07:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501149#M1258347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Soumya and Rhea,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked if any other implementation/method of this badi is updating the custom table.&lt;/P&gt;&lt;P&gt;But none.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I checked if the code is executed twice.&lt;/P&gt;&lt;P&gt;I placed a break point above the MODIFY statement. If this statement is executed twice, the debugger must stop at the same point for the second time as well, but it didn't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the following update function module so that the function module will be triggered at the next commit work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************************************************************************************&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ZISD_SAVE_CUSTOM_INVENTORY' &lt;STRONG&gt;IN UPDATE TASK&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    IT_INPUT         = ITAB.&lt;/P&gt;&lt;P&gt;*******************************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this time, the function module is not triggered at the COMMIT WORK statement.&lt;/P&gt;&lt;P&gt;Is there anything else that needs to be done for this function module to be triggered at the COMMIT WORK statement ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 12:28:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501149#M1258347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-21T12:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501150#M1258348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Closed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 04:33:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-in-badi/m-p/5501150#M1258348</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-03T04:33:17Z</dc:date>
    </item>
  </channel>
</rss>

