<?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 locking issue with BAPI_GOODSMVT_CREATE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue-with-bapi-goodsmvt-create/m-p/920362#M58779</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anybody ran across a problem of lock objects (related to materials) not getting released when BAPI_GOODSMVT_CREATE fails?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the sequence of events:&lt;/P&gt;&lt;P&gt;1. I run my function (which calls BAPI_GOODSMVT_CREATE) in SE37 and force an error (i.e. return table contains entries). I do NOT leave SE37.&lt;/P&gt;&lt;P&gt;2. In another session I run the same test again (but with correct data). I get error M3 897 (The plant data of the material 3319 is locked by user USCLXH90). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By looking in SM12 after step 1 is finished, I have noticed that 2 lock entries do not get released. These lock entries subsequently cause the error in step 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock Object: ENQARRAY&lt;/P&gt;&lt;P&gt;Tables: MARC, MBEW&lt;/P&gt;&lt;P&gt;Arguments: material and plant used in my test&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORTANT NOTES: &lt;/P&gt;&lt;P&gt;A. These lock objects do finally get released once I completely exit SE37.&lt;/P&gt;&lt;P&gt;B. These lock objects get released immediately and automatically if step 1 is successful (in other words, it's only when there is an error do the lock objects remain!)&lt;/P&gt;&lt;P&gt;C. I do call BAPI_TRANSACTION_COMMIT. I have also tried using SET UPDATE TASK LOCAL. Neither makes any difference (I think these are irrelevant b/c there are no db updates anyway in step 1 b/c of the error I force).&lt;/P&gt;&lt;P&gt;D. We have seen this specific problem occur when calling the function via RFC from our web front end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I couldn't find any OSS note that describes this problem. Anybody know how to guarantee that all lock objects get released in the case where BAPI_GOODSMVT_CREATE fails?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s. I am a doing a 541 movement type (although I don't think this problem is specific to movement types).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any suggestions or insights anybody might have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Feb 2005 20:24:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-02-11T20:24:38Z</dc:date>
    <item>
      <title>locking issue with BAPI_GOODSMVT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue-with-bapi-goodsmvt-create/m-p/920362#M58779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anybody ran across a problem of lock objects (related to materials) not getting released when BAPI_GOODSMVT_CREATE fails?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the sequence of events:&lt;/P&gt;&lt;P&gt;1. I run my function (which calls BAPI_GOODSMVT_CREATE) in SE37 and force an error (i.e. return table contains entries). I do NOT leave SE37.&lt;/P&gt;&lt;P&gt;2. In another session I run the same test again (but with correct data). I get error M3 897 (The plant data of the material 3319 is locked by user USCLXH90). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By looking in SM12 after step 1 is finished, I have noticed that 2 lock entries do not get released. These lock entries subsequently cause the error in step 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock Object: ENQARRAY&lt;/P&gt;&lt;P&gt;Tables: MARC, MBEW&lt;/P&gt;&lt;P&gt;Arguments: material and plant used in my test&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORTANT NOTES: &lt;/P&gt;&lt;P&gt;A. These lock objects do finally get released once I completely exit SE37.&lt;/P&gt;&lt;P&gt;B. These lock objects get released immediately and automatically if step 1 is successful (in other words, it's only when there is an error do the lock objects remain!)&lt;/P&gt;&lt;P&gt;C. I do call BAPI_TRANSACTION_COMMIT. I have also tried using SET UPDATE TASK LOCAL. Neither makes any difference (I think these are irrelevant b/c there are no db updates anyway in step 1 b/c of the error I force).&lt;/P&gt;&lt;P&gt;D. We have seen this specific problem occur when calling the function via RFC from our web front end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I couldn't find any OSS note that describes this problem. Anybody know how to guarantee that all lock objects get released in the case where BAPI_GOODSMVT_CREATE fails?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s. I am a doing a 541 movement type (although I don't think this problem is specific to movement types).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any suggestions or insights anybody might have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2005 20:24:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue-with-bapi-goodsmvt-create/m-p/920362#M58779</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-11T20:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: locking issue with BAPI_GOODSMVT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue-with-bapi-goodsmvt-create/m-p/920363#M58780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've used this BAPI in many of my programs,  and always after the call, I code.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

    commit work and wait.
    call function 'DEQUEUE_ALL'.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The DEQUEUE_ALL show release any/all locks.&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2005 20:41:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue-with-bapi-goodsmvt-create/m-p/920363#M58780</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-02-11T20:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: locking issue with BAPI_GOODSMVT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue-with-bapi-goodsmvt-create/m-p/920364#M58781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rich... this make work for me, but one question - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know if this function releases all lock objects for the user system wide or only for the current session? My concern is that if it is system wide, then I could be releasing lock objects for other sessions unintentionally. For example, if there are multiple RFC calls in parallel for the same function and same user then I could be destroying lock entries that I shouldn't be! I am hoping that it removes lock entries only for the current session...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lee &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; I've used this BAPI in many of my programs,  and&lt;/P&gt;&lt;P&gt;&amp;gt; always after the call, I code.....&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;gt; 
&amp;gt;     commit work and wait.
&amp;gt;     call function 'DEQUEUE_ALL'.
&amp;gt; 
&amp;gt; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; The DEQUEUE_ALL show release any/all locks.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Regards,&lt;/P&gt;&lt;P&gt;&amp;gt; Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2005 20:54:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue-with-bapi-goodsmvt-create/m-p/920364#M58781</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-11T20:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: locking issue with BAPI_GOODSMVT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue-with-bapi-goodsmvt-create/m-p/920365#M58782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I gotta say that it will release locks for that "session" only, otherwise what's the point in applying locks in the first place, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2005 20:57:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue-with-bapi-goodsmvt-create/m-p/920365#M58782</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-02-11T20:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: locking issue with BAPI_GOODSMVT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue-with-bapi-goodsmvt-create/m-p/920366#M58783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lee,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you set the parameter 'WAIT' to 'X'? This will ensure that all the updates are completed and the locks are released, before the next call of the BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2005 21:08:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue-with-bapi-goodsmvt-create/m-p/920366#M58783</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-11T21:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: locking issue with BAPI_GOODSMVT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue-with-bapi-goodsmvt-create/m-p/920367#M58784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, "session" is probably not the correct word I should have used.... rather, is this function &amp;lt;i&amp;gt;transaction&amp;lt;/i&amp;gt; specific? (because I don't want the all locks for the user in the system released - only those pertaining to the current transaction). Logically, I would assume it's only for the current transaction, but I am just trying to make sure I'm not using some "all encompassing" function that just goes and removes all locks in the system for that user. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;....anyway, OSS note 3013 seems to answer my question &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Lee&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; I gotta say that it will release locks for that&lt;/P&gt;&lt;P&gt;&amp;gt; "session" only, otherwise what's the point in&lt;/P&gt;&lt;P&gt;&amp;gt; applying locks in the first place, right?&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Regards,&lt;/P&gt;&lt;P&gt;&amp;gt; Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2005 21:27:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue-with-bapi-goodsmvt-create/m-p/920367#M58784</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-11T21:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: locking issue with BAPI_GOODSMVT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue-with-bapi-goodsmvt-create/m-p/920368#M58785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srivinas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes ... I had noticed that parameter and made sure that I set it.  Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2005 21:28:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue-with-bapi-goodsmvt-create/m-p/920368#M58785</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-11T21:28:36Z</dc:date>
    </item>
  </channel>
</rss>

