<?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: BAPI_MATERIAL_SAVEDATA and Rollback in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268086#M1018386</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dirk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So how is the decision? Do you change the program/design or find a workaround?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Teddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Aug 2008 10:25:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-22T10:25:49Z</dc:date>
    <item>
      <title>BAPI_MATERIAL_SAVEDATA and Rollback</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268080#M1018380</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'll use BAPI_MATERIAL_SAVEDATA to create new materials via JCo.&lt;/P&gt;&lt;P&gt;My proceeding :&lt;/P&gt;&lt;P&gt;1. call  BAPI_STDMATERIAL_GETINTNUMBER to get a new number&lt;/P&gt;&lt;P&gt;2. call BAPI_MATERIAL_SAVEDATA to create new material&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;until here it works fine. When I stop my programm in debugger here and execute "mm02" the new material is locked. It seem that the material would be created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. call BAPI_TRANSACTION_ROLLBACK to undo work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after the rollback call the material still exists and the lock is cleared. It's the same behavour like calling BAPI_TRANSACTION_COMMIT.&lt;/P&gt;&lt;P&gt;When I don't use commit or rollback (close connection) the material will still exist too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Isn't it be possible to rollback for BAPI_MATERIAL_SAVEDATA calls? Is the an explicit "BEGIN WORK" to set?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;&lt;P&gt;  Dirk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2008 11:26:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268080#M1018380</guid>
      <dc:creator>dirk_niemeier</dc:creator>
      <dc:date>2008-08-07T11:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_SAVEDATA and Rollback</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268081#M1018381</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;Actually when you execute MM02 and has the material locked, means the material already exists in database. Some thoughts:&lt;/P&gt;&lt;P&gt;1. In debugging mode, sometimes SAP do an automatic COMMIT. So you could try by not running it in debugging mode.&lt;/P&gt;&lt;P&gt;2. COMMIT command is coded at the FM so when a material is ok, it is directly created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Teddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Aug 2008 09:09:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268081#M1018381</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-11T09:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_SAVEDATA and Rollback</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268082#M1018382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Teddy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt; 2. COMMIT command is coded at the FM so when a material is ok, it is directly created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this means, that the BAPI_MATERIAL_SAVEDATA doesn't support a rollback? No rollback when no error? I can't beleave this, because an error rollbacks automatically. Then the rollback function doesn't have any funktion anytime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;&lt;P&gt;  Dirk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2008 14:33:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268082#M1018382</guid>
      <dc:creator>dirk_niemeier</dc:creator>
      <dc:date>2008-08-13T14:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_SAVEDATA and Rollback</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268083#M1018383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dirk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the same function modules in the same sequence. It is working fine for me. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first I used bapi_material_save_data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the message return type is not an error then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;            EXPORTING&lt;/P&gt;&lt;P&gt;              WAIT = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION '`BAPI_TRANSACTION_ROLLBACK'.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is working perfectly fine for me. Check you conditions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2008 14:40:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268083#M1018383</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-13T14:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_SAVEDATA and Rollback</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268084#M1018384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Commit or rollback is done from inside the FM BAPI_MATERIAL_SAVEDATA, infact from MATERIAL_MAINTAIN_DARK which is called from BAPI_MATERIAL_SAVEDATA. That's why if u call BAPI_TRANSACTION_ROLLBACK after th call of BAPI_MATERIAL_SAVEDATA it creates no impact to the database as data is already saved or ignored based on the commit /rollback executed inside the FM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2008 14:48:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268084#M1018384</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-13T14:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_SAVEDATA and Rollback</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268085#M1018385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi NAVEEN KUMAR GUDURI,&lt;/P&gt;&lt;P&gt;you are right when you are only using this small code. But I have to insert a new material in an complex transaction of other activities in my program. There are a view other database actions (non SAP) to do and it is possible that this other action doesn't work. So I have to rollback the complete operation. And this is not possible, because the rollback doesn't work if no error in the small SAP call occures.&lt;/P&gt;&lt;P&gt;BTW I opend an service call on SAP and this is the answer :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;the system behaviour you are experiencing is as designed.&lt;/P&gt;&lt;P&gt;The BAPI_MATERIAL_SAVEDATA can't execute the database changes in the&lt;/P&gt;&lt;P&gt;update task. It's correct, that the BAPI transaction model says there&lt;/P&gt;&lt;P&gt;something different, but the concept of the material master is much&lt;/P&gt;&lt;P&gt;older and we couldn't change this to make it compatible to the BAPI&lt;/P&gt;&lt;P&gt;transaction model. When the BAPI was added to the material master, we&lt;/P&gt;&lt;P&gt;extended the functionality of the ALE IDoc-type MATMAS. And in the ALE&lt;/P&gt;&lt;P&gt;it is not possible to save the database changes in update task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And if you call the BAPI by RFC (like with the Java Connector), then&lt;/P&gt;&lt;P&gt;the system executes always a database commit at the end of the&lt;/P&gt;&lt;P&gt;executed function module. This means, that the database changes of the&lt;/P&gt;&lt;P&gt;BAPI are already fix and can't be removed by calling a ROLLBACK WORK&lt;/P&gt;&lt;P&gt;afterwards (e.g. by calling the function module&lt;/P&gt;&lt;P&gt;BAPI_TRANSACTION_ROLLBACK using the Java Connector).   &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;  Dirk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2008 14:43:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268085#M1018385</guid>
      <dc:creator>dirk_niemeier</dc:creator>
      <dc:date>2008-08-21T14:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_SAVEDATA and Rollback</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268086#M1018386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dirk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So how is the decision? Do you change the program/design or find a workaround?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Teddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2008 10:25:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268086#M1018386</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-22T10:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_SAVEDATA and Rollback</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268087#M1018387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Teddy,&lt;/P&gt;&lt;P&gt;I not sure this time. A other alternative ist to connect directly via JDBC. The MARA and MARC etc. tables are not really complicated. But I don't know what SAP will say when they get notice about that. Do you have an suggestion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;&lt;P&gt;  Dirk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2008 11:48:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268087#M1018387</guid>
      <dc:creator>dirk_niemeier</dc:creator>
      <dc:date>2008-08-22T11:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_SAVEDATA and Rollback</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268088#M1018388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dirk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not suggested to directly go to the table. What I can think of are:&lt;/P&gt;&lt;P&gt;1. Has someone/program that will check the status of the several steps in the current program. If not all are successful, then he/she/it should complete the steps either manually (a person) or automatically (another program).&lt;/P&gt;&lt;P&gt;2. Change the logic in current program to run BAPI_MATERIAL_SAVEDATA at last.&lt;/P&gt;&lt;P&gt;3. Split current program to several programs so after BAPI_MATERIAL_SAVEDATA user could run another program for the next steps. If the next step unsuccessful, user can rectify the issue and re-run the program.&lt;/P&gt;&lt;P&gt;4. In current program, do a complete validation for all the steps so if the program decides to post, there is no error will happen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Above are just a thought that might not be feasible in your case but could give you another alternatives.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Teddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 04:45:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-savedata-and-rollback/m-p/4268088#M1018388</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-25T04:45:48Z</dc:date>
    </item>
  </channel>
</rss>

