<?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 lock issue: program with multi-BAPIs  run by multiple users in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue-program-with-multi-bapis-run-by-multiple-users/m-p/2704300#M626442</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;We have 3 programs and each programs call more than 1 BAPIs ( BAPI_GOODSMVT_CREATE) to do good movement of an equipement. But we got a LOCK probelm when multiple users running the programs at the same time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inside the programs. we do...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st bapi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. set update task local.&lt;/P&gt;&lt;P&gt;2. BAPI_GOODSMVT_CREATE&lt;/P&gt;&lt;P&gt;3. 'BAPI_TRANSACTION_COMMIT with WAIT = 'X' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2nd Bapi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4 set update task local.&lt;/P&gt;&lt;P&gt;5. BAPI_GOODSMVT_CREATE&lt;/P&gt;&lt;P&gt;6. 'BAPI_TRANSACTION_COMMIT with WAIT = 'X' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3rd bapi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4th Bapi&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When we have multiple users running those programs at the same time (with the same material  but different serial number) , we got an error said that 'The plant data of the material XXXX is locked by user YYYY'. The program got interupt in the half way of processing, eg.  1st and 2nd BAPI are done and got Lock error at the 3rd bapi. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to lock the program at the beginning using ENQUEUE. But seems like all locks are removed inside 'BAPI_TRANSACTION_COMMIT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way we can prevent it??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Louise&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Aug 2007 02:53:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-29T02:53:41Z</dc:date>
    <item>
      <title>lock issue: program with multi-BAPIs  run by multiple users</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue-program-with-multi-bapis-run-by-multiple-users/m-p/2704300#M626442</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;We have 3 programs and each programs call more than 1 BAPIs ( BAPI_GOODSMVT_CREATE) to do good movement of an equipement. But we got a LOCK probelm when multiple users running the programs at the same time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inside the programs. we do...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st bapi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. set update task local.&lt;/P&gt;&lt;P&gt;2. BAPI_GOODSMVT_CREATE&lt;/P&gt;&lt;P&gt;3. 'BAPI_TRANSACTION_COMMIT with WAIT = 'X' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2nd Bapi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4 set update task local.&lt;/P&gt;&lt;P&gt;5. BAPI_GOODSMVT_CREATE&lt;/P&gt;&lt;P&gt;6. 'BAPI_TRANSACTION_COMMIT with WAIT = 'X' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3rd bapi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4th Bapi&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When we have multiple users running those programs at the same time (with the same material  but different serial number) , we got an error said that 'The plant data of the material XXXX is locked by user YYYY'. The program got interupt in the half way of processing, eg.  1st and 2nd BAPI are done and got Lock error at the 3rd bapi. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to lock the program at the beginning using ENQUEUE. But seems like all locks are removed inside 'BAPI_TRANSACTION_COMMIT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way we can prevent it??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Louise&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 02:53:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue-program-with-multi-bapis-run-by-multiple-users/m-p/2704300#M626442</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T02:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: lock issue: program with multi-BAPIs  run by multiple users</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue-program-with-multi-bapis-run-by-multiple-users/m-p/2704301#M626443</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;Welcome to SDN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I find COMMIT work clears table level locks . We have applied a round way soluion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have created a custom table whenever programs runs with Multiple &lt;U&gt;Dependent&lt;/U&gt; BAPI's we updated the custom table before calling 1st BAPI and clear after the last BAPI call, so at time only single users can go execute the programs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i am not 100% agree with this solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 03:05:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue-program-with-multi-bapis-run-by-multiple-users/m-p/2704301#M626443</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-08-29T03:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: lock issue: program with multi-BAPIs  run by multiple users</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue-program-with-multi-bapis-run-by-multiple-users/m-p/2704302#M626444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; Louise,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the data you are updating in the second or third call of the BAPI dependent on the ones before that ? If not,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why dont you try this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call : BAPI_GOODSMVT_CREATE (1)&lt;/P&gt;&lt;P&gt;Call BAPI_GOODSMVT_CREATE (2)&lt;/P&gt;&lt;P&gt;Call BAPI_GOODSMVT_CREATE (3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then Commit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Going by your solution, the lock should now work as you have only one commit at the end of the program  .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 03:24:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue-program-with-multi-bapis-run-by-multiple-users/m-p/2704302#M626444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T03:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: lock issue: program with multi-BAPIs  run by multiple users</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue-program-with-multi-bapis-run-by-multiple-users/m-p/2704303#M626445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately the BAPIs are dependent on the ones before that and we need to call commit after each bapi. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Louise&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 12:19:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue-program-with-multi-bapis-run-by-multiple-users/m-p/2704303#M626445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T12:19:30Z</dc:date>
    </item>
  </channel>
</rss>

