<?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 object is not working automatically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-is-not-working-automatically/m-p/7974429#M1604113</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;i have a problem , A table is updated by a program which is used by multiple user . I have used lock function module 'ENQUEUE_E_TABLE ' and 'DEQUEUE_E_TABLE' for that . when updation section occurs first user which come first go through it and for rest users amessage cones &lt;STRONG&gt;'table is locked by XYZ use&lt;/STRONG&gt;r' . When first completes the updation resr users is not updating automatically they stand at that position where message comes. How to solve this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avadhesh Chandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Jun 2011 05:20:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-06-08T05:20:06Z</dc:date>
    <item>
      <title>lock object is not working automatically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-is-not-working-automatically/m-p/7974429#M1604113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;i have a problem , A table is updated by a program which is used by multiple user . I have used lock function module 'ENQUEUE_E_TABLE ' and 'DEQUEUE_E_TABLE' for that . when updation section occurs first user which come first go through it and for rest users amessage cones &lt;STRONG&gt;'table is locked by XYZ use&lt;/STRONG&gt;r' . When first completes the updation resr users is not updating automatically they stand at that position where message comes. How to solve this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avadhesh Chandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2011 05:20:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-is-not-working-automatically/m-p/7974429#M1604113</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-08T05:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: lock object is not working automatically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-is-not-working-automatically/m-p/7974430#M1604114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Avadesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You just need to add the Enqueue FM on the table in a &lt;STRONG&gt;do/while loop&lt;/STRONG&gt; with an exit condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do.&lt;/P&gt;&lt;P&gt; call fm "enqueue"&lt;/P&gt;&lt;P&gt;if sy-subrc NE 0.&lt;/P&gt;&lt;P&gt; attempt = attemp + 1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if attempt GT 10.&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: The above is just a pseudo code to give you an idea, in the actual implementation the attempts could be changed to wait upto X seconds etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2011 05:28:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-is-not-working-automatically/m-p/7974430#M1604114</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-08T05:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: lock object is not working automatically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-is-not-working-automatically/m-p/7974431#M1604115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change the code and Lock the table in Share Mode not on the Exclusive Mode. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pass 'S' in the Mode. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want only exclusive mode , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then try the infinite loop with condition that sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for eg .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while ( sy-subrc &amp;lt;&amp;gt; 0). &lt;/P&gt;&lt;P&gt;enque FM&lt;/P&gt;&lt;P&gt;your code. &lt;/P&gt;&lt;P&gt;end while.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2011 11:44:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-is-not-working-automatically/m-p/7974431#M1604115</guid>
      <dc:creator>himanshu_gupta2</dc:creator>
      <dc:date>2011-06-09T11:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: lock object is not working automatically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-is-not-working-automatically/m-p/7974432#M1604116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We can lock the table before updating the entries. Two types of locks are there. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. To lock the entire table. Here when the table is locked by one program, another program will not be able to modify it.&lt;/P&gt;&lt;P&gt;2. To lock the particular record only. Here when the record is locked by one program, the other program can modify records other than the one locked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For option 1&lt;/P&gt;&lt;P&gt;Use the FM ENQUEUE_E_TABLEE to lock the table and FM DEQUEUE_E_TABLEE to unlock table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For option 2&lt;/P&gt;&lt;P&gt;Go to SE11. There enter the name of your lock object and create it. Next screen you have to mention which field you want to lock. &lt;/P&gt;&lt;P&gt;For more info. on LOCK OBJECTS go to&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to lock the entire table, then use the FM said in option 1 in DO-ENDDO loop.  &lt;/P&gt;&lt;P&gt;Run the loop till it gets successful (sy-subrc = 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DO.
*Call the FM.
 IF sy-subrc = 0.
    EXIT.
ENDIF.
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to just try some number of times rather than keep on looping then can use for eg: DO 100 TIMES.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2011 12:06:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-is-not-working-automatically/m-p/7974432#M1604116</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-09T12:06:40Z</dc:date>
    </item>
  </channel>
</rss>

