<?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: locking issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437484#M1411800</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;somewhere I found documentation about WAIT parameter. I remember by default it will wait up to 3 seconds for a foreign lock being released. This is useful if - by chance - the object is locked by another process that does not need much time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I always use the WAIT = 'X' because if the object is not locked it does not cost any time and if it is locked I may not have to repeat the whole process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Nov 2009 03:06:03 GMT</pubDate>
    <dc:creator>Clemenss</dc:creator>
    <dc:date>2009-11-30T03:06:03Z</dc:date>
    <item>
      <title>locking issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437478#M1411794</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;&lt;/P&gt;&lt;P&gt;I use this locking (write lock)  and i want to verify if i do it OK .&lt;/P&gt;&lt;P&gt;what i do is to check if the entry is locked if so try 5 times .&lt;/P&gt;&lt;P&gt;one more thing is that that i dont know how the parameter behavior and _wait  can help me .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DO iv_try_x_times TIMES. "Try to lock object for 5 times before skiping the object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      lv_count = lv_count + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'ENQUEUE_E_D_USR' &lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;      mandt = sy-mandt&lt;/P&gt;&lt;P&gt;      userid = mv_userid&lt;/P&gt;&lt;P&gt;      x_for_user            = iv_is_exact  " If FOR_USER is initial this defines the lock             behavior&lt;/P&gt;&lt;P&gt;      &lt;U&gt;wait                 = iv&lt;/U&gt;is_wait&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      foreign_lock = 1&lt;/P&gt;&lt;P&gt;      system_failure = 2&lt;/P&gt;&lt;P&gt;      OTHERS = 3.&lt;/P&gt;&lt;P&gt;      IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        RETURN.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;      IF lv_count &amp;lt; iv_try_x_times.&lt;/P&gt;&lt;P&gt;        WAIT UP TO 1 SECONDS.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDDO.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Nov 2009 12:53:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437478#M1411794</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-29T12:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: locking issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437479#M1411795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code is fine. are you facing some issue with this??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read this it will give you more clear picture:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/41/7af4c8a79e11d1950f0000e82de14a/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/41/7af4c8a79e11d1950f0000e82de14a/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/Helpdata/EN/af/22ab01dd0b11d1952000a0c929b3c3/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/Helpdata/EN/af/22ab01dd0b11d1952000a0c929b3c3/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Harsh Bhalla on Nov 29, 2009 6:38 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Nov 2009 13:01:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437479#M1411795</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-29T13:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: locking issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437480#M1411796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Harsh ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i read the help but i not sure that i understand the use of &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;x_for_user = iv_is_exact 
_wait = iv_is_wait&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you please explain the need of the parametrs , one example is if i use the counter (in loop) &lt;/P&gt;&lt;P&gt;for what i need the wait ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or what is the use of x_for_user and how it can help me ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Nov 2009 14:42:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437480#M1411796</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-29T14:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: locking issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437481#M1411797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read this to get clarification &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nwpi71/helpdata/en/cf/21eebf446011d189700000e8322d00/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nwpi71/helpdata/en/cf/21eebf446011d189700000e8322d00/content.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Nov 2009 15:03:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437481#M1411797</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-29T15:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: locking issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437482#M1411798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Harsh ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks  but i do some wait logic in the loop do i need to use also the parameter wait ?&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;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Nov 2009 21:21:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437482#M1411798</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-29T21:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: locking issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437483#M1411799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no clear documentation on the _WAIT parameter. However the short description of the data element DDENQWAIT says "Flag indicating whether lock attempt is to be repeated" (Values X and SPACE).&lt;/P&gt;&lt;P&gt;So my suggestion is you don't pass this parameter and leave it to its default value of SPACE and continue with your logic of attempting for a specified number of times before giving up.&lt;/P&gt;&lt;P&gt;The statement WAIT UP TO 1 SECONDS doesn't justify genuine assumption. Try to implement more elegant logic such as reading the database to check some value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Nov 2009 23:00:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437483#M1411799</guid>
      <dc:creator>SureshRa</dc:creator>
      <dc:date>2009-11-29T23:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: locking issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437484#M1411800</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;somewhere I found documentation about WAIT parameter. I remember by default it will wait up to 3 seconds for a foreign lock being released. This is useful if - by chance - the object is locked by another process that does not need much time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I always use the WAIT = 'X' because if the object is not locked it does not cost any time and if it is locked I may not have to repeat the whole process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2009 03:06:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437484#M1411800</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2009-11-30T03:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: locking issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437485#M1411801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Clemens&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a lot &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but do you suggest to use also the logic i did in the loop for 5 times with sytabix and in parallel use the wait .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one more thing is regard the x_for_user how can it help me ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2009 09:20:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437485#M1411801</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-30T09:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: locking issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437486#M1411802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my personal thought is you should always try to gain simplicity. In this case it means: No need for the do-loop. And no need for the x_for_user parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2009 14:30:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-issue/m-p/6437486#M1411802</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2009-11-30T14:30:58Z</dc:date>
    </item>
  </channel>
</rss>

