<?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: Lock Table questions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483815#M1255308</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have it correct for my scenario.  I will control the number generation by creating a FM that creates the number.  In this FM I will ATTEMPT to ENQUE the table.  If there is already a lock then I won't be able to do this.  So, I wait around until I can.  In your example I have no idea how that would work unless you can lock a specific PO.  I have seen it done with Projects but never with POs.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I searched and found the following.  Now I didn't test it but it looks to me like it will lock a PO:  ENQUEUE_EMEKKOS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would try locking with that and then unlocking with DEQUEUE_EMEKKOS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Davis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 25 Apr 2009 23:41:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-25T23:41:06Z</dc:date>
    <item>
      <title>Lock Table questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483802#M1255295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to lock a ztable.  I did a search and see that you can use ENQUEUE_E_TABLE/DEQUEUE_E_TABLE to lock/unlock a table.  I have also created lock objects for the table.  If I run ENQUEUE_E_TABLE for my ztable I get a sy-subrc = 0 and I see the entry in SM12.  However, I am unsure how I can check to see if a lock exists.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I have a table which contains a report number (unique system wide, think of a PO number).  I need to lock this table so that I can find the largest number and create the next number.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I call ENQUEUE_E_TABLE it creates the lock on the table.  However, when I call it a second time I don't get an error returned.  Is this because the lock is specific to my user?  Therefore I would need to use two users to see an error returned on the second ENQUEUE_E_TABLE call?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Davis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 12:12:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483802#M1255295</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T12:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483803#M1255296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Davis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have created a table lock for the Z-table(say EZTABLE) then why are you using ENQUEUE_E_TABLE/DEQUEUE_E_TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you create a lock object then 2 FMs are generated: ENQUEUE_EZTABLE, DEQUEUE_EZTABLE. You should be using them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 12:16:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483803#M1255296</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-04-23T12:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483804#M1255297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Susha.  I did not realize that FMs were created.  I heard that they were but I was unable to find them.  Now that you confirmed this I found the FMs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I created a new user and tried to insert a new record into the ztable.  This worked even though there was a lock on the table.  I was under the impression that a table couldn't be modified while a lock was on it.  I tried it with an 'S' lock as well as an 'E' lock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Davis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 12:26:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483804#M1255297</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T12:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483805#M1255298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Davis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please share your code, it will be easier to analyse? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 12:45:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483805#M1255298</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-04-23T12:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483806#M1255299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Davis - you have to remember that SAP locks are logical, not physical. This means that you can modify records that are "locked". The way you check the lock is by trying to lock it again. If it is already locked, then the ENQUEUE function will return a non-zero sy-subrc. In that case, you must have logic that does not perform the update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 13:33:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483806#M1255299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T13:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483807#M1255300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey see this wiki&lt;/P&gt;&lt;P&gt;&lt;A href="https://wiki.sdn.sap.com/wiki/display/Snippets/locking" target="test_blank"&gt;https://wiki.sdn.sap.com/wiki/display/Snippets/locking&lt;/A&gt;&lt;EM&gt;and&lt;/EM&gt;unlocking+tables&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 13:48:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483807#M1255300</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T13:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483808#M1255301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was a good learning for me as well. Thanks Rob !!! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 14:15:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483808#M1255301</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-04-23T14:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483809#M1255302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Suhas - glad it helped someone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 14:21:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483809#M1255302</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T14:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483810#M1255303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for that post, Rob!  I was under the impression that it would actually lock (physically) the table.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Davis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 14:37:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483810#M1255303</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T14:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483811#M1255304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas Saha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, am also having the same impression as Davis does(physical locking).&lt;/P&gt;&lt;P&gt;Could you pls. explain with an example,  about the Rob explanation, as below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;you have to remember that SAP locks are logical, not physical. This means that you can modify records that are "locked". The way you check the lock is by trying to lock it again. If it is already locked, then the ENQUEUE function will return a non-zero sy-subrc. In that case, you must have logic that does not perform the update&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanq&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 18:57:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483811#M1255304</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T18:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483812#M1255305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Davis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, am also having the same impression as u does(physical locking).&lt;/P&gt;&lt;P&gt;Could you pls. explain with an example, about the Rob explanation, as below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;you have to remember that SAP locks are logical, not physical. This means that you can modify records that are "locked". The way you check the lock is by trying to lock it again. If it is already locked, then the ENQUEUE function will return a non-zero sy-subrc. In that case, you must have logic that does not perform the update.&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 19:23:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483812#M1255305</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T19:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483813#M1255306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose your mother doesn't want you to run with scissors. She decides that the best way to make sure you don't is to lock the scissors away in a cabinet. This is a physical lock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But suppose your mother simply tells you "Don't run with scissors" and leaves the rest to you. This is a logical lock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, you ask yourself "What did my mother say? Oh yeah 'Don't run with scissors'". This is querying the lock, and if you're smart, you don't run with scissors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you don't ask what your mother said, you may run into trouble.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2009 21:17:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483813#M1255306</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-24T21:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483814#M1255307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanq for your time. But, honestly I did not understood your example. Sorry to say that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The poster want to create a new serial # record(say, # 10) to the immediately next to already existing record(say, # 9) in the table, so, in this process,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- called FM of ENQUE of his Z tbale&lt;/P&gt;&lt;P&gt;here he is generating a new immediate next # and using it in creating the record into Z table&lt;/P&gt;&lt;P&gt;- called FM of DEQUE of his Z table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or say another scenario,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;am working with purchase order # 12345678, so, i do not want work with this same 12345678 PO by any other user in the system.......so, i will code like below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- called FM of ENQUE of EKKO tbale to LOCK&lt;/P&gt;&lt;P&gt;I do my work with that PO # 12345678, then&lt;/P&gt;&lt;P&gt;- called FM of DEQUE of his EKKO table to RELEASE / DELOCK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(currently am on bench, so, I dont hv SAP access, so, am unable to work around!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so, Is my approach is correct? if not, Wht is the correct approach?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanq&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Apr 2009 22:07:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483814#M1255307</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-25T22:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483815#M1255308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have it correct for my scenario.  I will control the number generation by creating a FM that creates the number.  In this FM I will ATTEMPT to ENQUE the table.  If there is already a lock then I won't be able to do this.  So, I wait around until I can.  In your example I have no idea how that would work unless you can lock a specific PO.  I have seen it done with Projects but never with POs.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I searched and found the following.  Now I didn't test it but it looks to me like it will lock a PO:  ENQUEUE_EMEKKOS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would try locking with that and then unlocking with DEQUEUE_EMEKKOS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Davis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Apr 2009 23:41:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483815#M1255308</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-25T23:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483816#M1255309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you Davis, after posting my resonse as above, i spoke to my freind and he clarified me that, as u said its correct that, with the mentioned FMs(ENQUE_EMAKKO), we can LOCK the specified PO, then we can work and then can de-lock it.&lt;/P&gt;&lt;P&gt;thanq&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: SAP ABAPer on Apr 26, 2009 2:17 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Apr 2009 00:11:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table-questions/m-p/5483816#M1255309</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-26T00:11:55Z</dc:date>
    </item>
  </channel>
</rss>

