<?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_OBJCL_CHANGE Lock errors in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-lock-errors/m-p/11866267#M1959427</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forcing dequeue of locks is &lt;STRONG&gt;always a bad idea&lt;/STRONG&gt; because you cannot know what's going on under the hood.&lt;/P&gt;&lt;P&gt;My suggestion is to put in a DO...ENDO FM ENQUEUE_READ: if no locks found then exit, else wait 1 second.&lt;BR /&gt;Exit anyway after 100 times so you avoid endless loops.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Sep 2016 11:25:31 GMT</pubDate>
    <dc:creator>SimoneMilesi</dc:creator>
    <dc:date>2016-09-13T11:25:31Z</dc:date>
    <item>
      <title>BAPI_OBJCL_CHANGE Lock errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-lock-errors/m-p/11866266#M1959426</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;I am using this BAPI to assign characteristics in side a sales order loop.&lt;/P&gt;&lt;P&gt;it is working for 1st item, but getting lock error for rest all records(sales items/orders).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to remove the lock entries, how can we use any enque / deque function modules.&lt;/P&gt;&lt;P&gt;I tried using DESTINATION NONE, but after that COMMIT is not working so records are not updating.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;chandra.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 11:17:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-lock-errors/m-p/11866266#M1959426</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-09-13T11:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_OBJCL_CHANGE Lock errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-lock-errors/m-p/11866267#M1959427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forcing dequeue of locks is &lt;STRONG&gt;always a bad idea&lt;/STRONG&gt; because you cannot know what's going on under the hood.&lt;/P&gt;&lt;P&gt;My suggestion is to put in a DO...ENDO FM ENQUEUE_READ: if no locks found then exit, else wait 1 second.&lt;BR /&gt;Exit anyway after 100 times so you avoid endless loops.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 11:25:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-lock-errors/m-p/11866267#M1959427</guid>
      <dc:creator>SimoneMilesi</dc:creator>
      <dc:date>2016-09-13T11:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_OBJCL_CHANGE Lock errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-lock-errors/m-p/11866268#M1959428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of using your own wait logic, you can also use ENQUEUE_xxxxx with the mode U or V and the _wait parameter = 'X'. The wait logic progressive increases in duration and does a better job of preventing deadlocks than a static wait of 1 second.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 13:00:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-lock-errors/m-p/11866268#M1959428</guid>
      <dc:creator>raghug</dc:creator>
      <dc:date>2016-09-13T13:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_OBJCL_CHANGE Lock errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-lock-errors/m-p/11866269#M1959429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And today i learned something new, thanks! &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/111/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I always used ENQUEUE_READ since i'm &lt;EM&gt;a bit &lt;/EM&gt;lazy to check every lock object &lt;SPAN __jive_emoticon_name="silly" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/111/images/emoticons/silly.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 14:34:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-lock-errors/m-p/11866269#M1959429</guid>
      <dc:creator>SimoneMilesi</dc:creator>
      <dc:date>2016-09-13T14:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_OBJCL_CHANGE Lock errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-lock-errors/m-p/11866270#M1959430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are welcome. I am lazy too &lt;SPAN __jive_emoticon_name="silly" __jive_macro_name="emoticon" class="jive_macro_emoticon jive_emote jive_macro" src="https://community.sap.com/108/images/emoticons/silly.gif"&gt;&lt;/SPAN&gt;... Here is my argument for laziness - and more reading if you feel like it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use SM12 (same data as ENQUEUE_READ) to figure out which ENQUEUE_xxx function module to use... and if there are multiple, I usually pick the most obvious one. In Chandra Sekar's example I would pick the sales order one, even though there may be locks on the batch. And then...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="p1" style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;CALL FUNCTION &lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;'ENQUEUE_EVVBAKE'&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2" style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; EXPORTING&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p3" style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;mode_vbak&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;'V'&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;" Lock mode for table VBAK&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p3" style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;vbeln&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;l_sales_order&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;" 02th enqueue argument&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2" style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="s2"&gt;_wait&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;SPAN class="s2"&gt;abap_true&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2" style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; EXCEPTIONS&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p4" style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;foreign_lock&lt;SPAN class="s1"&gt;&amp;nbsp;&amp;nbsp; = &lt;/SPAN&gt;&lt;SPAN class="s4"&gt;1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p4" style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;system_failure&lt;SPAN class="s1"&gt; = &lt;/SPAN&gt;&lt;SPAN class="s4"&gt;2&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2" style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; others&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;SPAN class="s4"&gt;3&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I have complete control over the exact sales order too... that way no need to filter the return of ENQUEUE_READ in case the user has another sales order open in a different window, etc.... and no need to implement your own wait logic either.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Another trick that I use... the wait does time out - default is 5 seconds (more about this in a second)... I might check for another possible object next. For instance if I am working with a delivery too, I might check the delivery and sales order in sequence to get me a total wait of 10 seconds.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;A little upfront work finding the correct lock object, but then much less after that.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Now about that wait time... &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;You can change it by changing the system parameter &lt;/SPAN&gt;&lt;EM style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;enque/delay_max&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; in RZ11. And while you are at it, read the documentation on &lt;/SPAN&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;enque/delay_jitter&lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;, it gives you an idea of how it prevents deadlocks. Something I had to do in my old VB &amp;amp; SQL-Server days. Ahh the memories &lt;/SPAN&gt;&lt;SPAN __jive_emoticon_name="mischief" __jive_macro_name="emoticon" class="jive_macro_emoticon jive_emote jive_macro" src="https://community.sap.com/108/images/emoticons/mischief.gif" style="font-size: 13.3333px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 15:53:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-lock-errors/m-p/11866270#M1959430</guid>
      <dc:creator>raghug</dc:creator>
      <dc:date>2016-09-13T15:53:42Z</dc:date>
    </item>
  </channel>
</rss>

