<?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 MM BAPI Commit - Lock Issues in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/mm-bapi-commit-lock-issues/m-p/3650948#M879324</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am updating Material Master and I am getting locking issues intermittently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which is better of the 2 processes below or any new ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROCESS 1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at Material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_MATERIAL_SAVEDATA (Material BAPI)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_OBJCL_CHANGE (Classifications BAPI)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_TRANSACTION_COMMIT (WAIT = 'X')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_MATINSPCTRL_SAVEREPLICA (Inspection Control BAPI --- This BAPI saves to the database)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BDC for Classifications View (If not all required information is passed to BAPI_OBJCL_CHANGE, then we need this BDC.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROCESS 2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at Material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_MATERIAL_SAVEDATA (Material BAPI)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_TRANSACTION_COMMIT (WAIT = 'X')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_OBJCL_CHANGE (Classifications BAPI)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_TRANSACTION_COMMIT (WAIT = 'X')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_MATINSPCTRL_SAVEREPLICA (Inspection Control --- This BAPI saves to the database)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BDC for Classifications View (If not all required information is passed to BAPI_OBJCL_CHANGE, then we need this BDC.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;P&gt;Riyaz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 20 Apr 2008 09:52:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-20T09:52:52Z</dc:date>
    <item>
      <title>MM BAPI Commit - Lock Issues</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mm-bapi-commit-lock-issues/m-p/3650948#M879324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am updating Material Master and I am getting locking issues intermittently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which is better of the 2 processes below or any new ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROCESS 1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at Material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_MATERIAL_SAVEDATA (Material BAPI)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_OBJCL_CHANGE (Classifications BAPI)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_TRANSACTION_COMMIT (WAIT = 'X')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_MATINSPCTRL_SAVEREPLICA (Inspection Control BAPI --- This BAPI saves to the database)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BDC for Classifications View (If not all required information is passed to BAPI_OBJCL_CHANGE, then we need this BDC.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROCESS 2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at Material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_MATERIAL_SAVEDATA (Material BAPI)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_TRANSACTION_COMMIT (WAIT = 'X')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_OBJCL_CHANGE (Classifications BAPI)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_TRANSACTION_COMMIT (WAIT = 'X')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_MATINSPCTRL_SAVEREPLICA (Inspection Control --- This BAPI saves to the database)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BDC for Classifications View (If not all required information is passed to BAPI_OBJCL_CHANGE, then we need this BDC.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;P&gt;Riyaz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Apr 2008 09:52:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mm-bapi-commit-lock-issues/m-p/3650948#M879324</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-20T09:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: MM BAPI Commit - Lock Issues</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mm-bapi-commit-lock-issues/m-p/3650949#M879325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Riyaz,&lt;/P&gt;&lt;P&gt;Obviuosly second one will be the best and safe way to go ahead. Once u do the commit then all the database locks will be released. So there will be no interdependency. Also If the data from the second BAPI should be updated only if the first BAPI is success the u can put the checks like below.(Bolded)&lt;/P&gt;&lt;P&gt;*Here read with A if there are no errors and read with X if there *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;are no Aborts.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at Material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_MATERIAL_SAVEDATA (Material BAPI)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;READ TABLE i_return WITH KEY type = E, A ,X.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CHECK NOT sy-subrc IS INITIAL.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;...BAPI_TRANSACTION_COMMIT (WAIT = 'X')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_OBJCL_CHANGE (Classifications BAPI)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;READ TABLE i_return WITH KEY type = E, A ,X.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CHECK NOT sy-subrc IS INITIAL.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_TRANSACTION_COMMIT (WAIT = 'X')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BAPI_MATINSPCTRL_SAVEREPLICA (Inspection Control --- This BAPI saves to the database)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;READ TABLE i_return WITH KEY type = E, A ,X.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CHECK NOT sy-subrc IS INITIAL.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BAPI_TRANSACTION_COMMIT (WAIT = 'X')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...BDC for Classifications View (If not all required information is passed to BAPI_OBJCL_CHANGE, then we need this BDC.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But here also there is a problem. Suppose ur first BAPI is success and second bapi fails then once u do the commit of first BAPI then u can't revert those changes(Because of second BAPI failed). So it solely depends on the requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this cleared ur doubts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vinod Kumar Vemuru on Apr 20, 2008 4:13 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Apr 2008 10:40:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mm-bapi-commit-lock-issues/m-p/3650949#M879325</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-04-20T10:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: MM BAPI Commit - Lock Issues</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mm-bapi-commit-lock-issues/m-p/3650950#M879326</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;Look at sm12 what object are locked.&lt;/P&gt;&lt;P&gt;Insert in you code checks for locks:&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Do x times.&lt;/P&gt;&lt;P&gt;CALL FONCTION 'ENQUEUE.... (find lock object in se11)&lt;/P&gt;&lt;P&gt;IF sy-subrc ne 0. " locked&lt;/P&gt;&lt;P&gt;WAIT XX seconds.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;CALL FONCTION 'DEQUEUE....&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Varishtah.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Apr 2008 15:20:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mm-bapi-commit-lock-issues/m-p/3650950#M879326</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-20T15:20:45Z</dc:date>
    </item>
  </channel>
</rss>

