<?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 mechanism for a table in functional module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-mechanism-for-a-table-in-functional-module/m-p/923914#M59480</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use SE11 to create a Lock Object.  When you create the lock object, you specify which table it is for, and then in the Lock Parameter tab, you specify the key fields for the lock.  Two function modules will be created when you activate the lock object.  You can find the function modules by displaying your lock object, and then go to meny path Goto / Lock modules.  One FM will start with ENQUEUE.  Use this FM to lock the data.  The other FM starts with DEQUEUE.  Use this FM to unlock the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Apr 2005 16:50:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-04-14T16:50:13Z</dc:date>
    <item>
      <title>Locking mechanism for a table in functional module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-mechanism-for-a-table-in-functional-module/m-p/923913#M59479</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;I have a function module which updates custom table, here while going to update i would like to lock the table and after completion of updation I have to unlock the data, have you got my point ...  can anybody tell me the procedure of locking mechanism... needed detailed code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2005 16:43:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-mechanism-for-a-table-in-functional-module/m-p/923913#M59479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-14T16:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Locking mechanism for a table in functional module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-mechanism-for-a-table-in-functional-module/m-p/923914#M59480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use SE11 to create a Lock Object.  When you create the lock object, you specify which table it is for, and then in the Lock Parameter tab, you specify the key fields for the lock.  Two function modules will be created when you activate the lock object.  You can find the function modules by displaying your lock object, and then go to meny path Goto / Lock modules.  One FM will start with ENQUEUE.  Use this FM to lock the data.  The other FM starts with DEQUEUE.  Use this FM to unlock the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2005 16:50:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-mechanism-for-a-table-in-functional-module/m-p/923914#M59480</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-14T16:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Locking mechanism for a table in functional module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-mechanism-for-a-table-in-functional-module/m-p/923915#M59481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to create a lock object for your table via SE11.&lt;/P&gt;&lt;P&gt;The name of the lock object should be your table name with an "E" in front.  After creating your lock object, there will be two function modules generated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENQUEUE_&amp;lt;Lock Object Name&amp;gt;&lt;/P&gt;&lt;P&gt;DEQUEUE_&amp;lt;Lock Object Name&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You use these function modules in your program to get locks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a code sample of a custom lock object over a custom table named ZPT_DET, with one key field REQNO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;call function 'ENQUEUE_EZPT_DET'
 EXPORTING
*   MODE_ZPT_DET         = 'E'
   MANDT                = SY-MANDT
   REQNO                = P_REQNO
*   X_REQNO              = ' '
*   _SCOPE               = '2'
*   _WAIT                = ' '
*   _COLLECT             = ' '
 EXCEPTIONS
   FOREIGN_LOCK         = 1
   SYSTEM_FAILURE       = 2
   OTHERS               = 3
          .
if sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&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>Thu, 14 Apr 2005 16:55:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-mechanism-for-a-table-in-functional-module/m-p/923915#M59481</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-04-14T16:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Locking mechanism for a table in functional module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-mechanism-for-a-table-in-functional-module/m-p/923916#M59482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you my friends Bryan and Rich, your help is appreciatable.... i've solved it &lt;/P&gt;&lt;P&gt;Once again thanks for your nice cooperation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2005 11:15:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-mechanism-for-a-table-in-functional-module/m-p/923916#M59482</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-15T11:15:43Z</dc:date>
    </item>
  </channel>
</rss>

