<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760854#M904793</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; Create a lock object for that table via SE11-&amp;gt;Lock Object ...which creates ENQUEUE_EZ_&amp;lt;TABLE&amp;gt; and DEQUEUE_EZ_&amp;lt;TABLE&amp;gt; ... which you can use it in the program before and after updating the table  in order to lock it for data consistency ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 May 2008 09:33:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-02T09:33:46Z</dc:date>
    <item>
      <title>Lock Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760849#M904788</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 created one custom table. Now I want to lock that table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any function module for lock the table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Points will be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 09:29:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760849#M904788</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T09:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760850#M904789</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;LOCK OBJECTS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)Go to se11 transaction.&lt;/P&gt;&lt;P&gt;2)Click on lock object radio button and give a lock object name starting with 'E'.For example 'ESAMPLE'.Click CREATE.&lt;/P&gt;&lt;P&gt;3)In the TABLE tab, you can give the table name for which you require a lock.In the LOCK PARAMETERS tab,you can give the table fields based on which the table should be locked.&lt;/P&gt;&lt;P&gt;4)Call a function module in your program ENQUEUE_lockobjectname to obtain a lock on the required table.In our example the FM will be ENQUEUE_ESAMPLE.&lt;/P&gt;&lt;P&gt;5)To release the lock on the table,call the function module DEQUEUE_lockobjectname.In our example the FM will be DEQUEUE_ESAMPLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP Provide three type of Lock objects. &lt;/P&gt;&lt;P&gt;&amp;#149; Read Lock(Shared Locked) &lt;/P&gt;&lt;P&gt;protects read access to an object. The read lock allows other transactions read access but not write access to &lt;/P&gt;&lt;P&gt;the locked area of the table &lt;/P&gt;&lt;P&gt;&amp;#149; Write Lock(exclusive lock) &lt;/P&gt;&lt;P&gt;protects write access to an object. The write lock allows other transactions neither read nor write access to &lt;/P&gt;&lt;P&gt;the locked area of the table. &lt;/P&gt;&lt;P&gt;&amp;#149; Enhanced write lock (exclusive lock without cumulating) &lt;/P&gt;&lt;P&gt;works like a write lock except that the enhanced write lock also protects from further accesses from the &lt;/P&gt;&lt;P&gt;same transaction. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Technicaly: &lt;/P&gt;&lt;P&gt;When you create a lock object System automatically creat two function module. &lt;/P&gt;&lt;P&gt;1. ENQUEUE_&amp;lt;Lockobject name&amp;gt;. to insert the object in a queue. &lt;/P&gt;&lt;P&gt;2. DEQUEUE_&amp;lt;Lockobject name&amp;gt;. To remove the object is being queued through above FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition to above replys i would like to add some more information about lock objects . I hope it would be useful for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAP R/3 system protects data if multiple users attempt to change it simultaneously. This guarantees data correctness and consistency even when a large number of users are connected to the SAP system. In a SAP environment, for example, only a single developer (session) can change the source code of an ABAP program at a time, and only one user is allowed to view the maintenance screen of a particular customizing table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What makes this all happen is an additional SAP locking mechanism that enables you to synchronize concurrent read or write requests for a particular set of data. The purpose is to prevent writing data that is being read by someone or restricting data from being read that is already in the editing mode. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock objects&lt;/P&gt;&lt;P&gt;Before applying locking in your programs, you must create lock objects for that particular set of data. You can create new lock objects or display (or change) existing ones via the standard ABAP Dictionary (SE11) transaction. Typical examples of lock objects are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E_TABLES&amp;amp;#65533;&amp;amp;#65533;&amp;amp;#65533; Shared Lock Object for Table Views&lt;/P&gt;&lt;P&gt;ESRDIRE&amp;amp;#65533;&amp;amp;#65533;&amp;amp;#65533;&amp;amp;#65533;&amp;amp;#65533;&amp;amp;#65533; Lock Objects for ABAP/4 programs&lt;/P&gt;&lt;P&gt;EPPRELE&amp;amp;#65533;&amp;amp;#65533;&amp;amp;#65533;&amp;amp;#65533;&amp;amp;#65533;&amp;amp;#65533; Lock Object for Employee Number Range&lt;/P&gt;&lt;P&gt;Here, the lock conditions and lock modes are specified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock conditions (defined by lock parameters)&lt;/P&gt;&lt;P&gt;While defining the lock object, you need to specify the field names that constitute the lock condition. The lock conditions depict the table fields you want to prevent from being concurrently accessed, usually key data that uniquely specifies a particular object or table entry. For example, if I wanted to lock the personnel number in a particular client, I would use the fields PERNR and MANDT as my lock parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During formulation of these conditions, an AND condition is implied. For instance, you might want to lock employee 2900 in client 300. Then, the condition would be interpreted as "Lock the table entry where PERNR is equal to 2900 AND MANDT is 300."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock modes&lt;/P&gt;&lt;P&gt;SAP enables you to specify a lock mode that best suits your business requirement. This gives an idea of the intention of the application that employs a particular lock in its code. Let's consider the standard payroll program that locks all the personnel numbers whose payroll results are computed. During execution of this program, no other application is allowed to set a lock for changing the respective employees' data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are three modes of SAP locks:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shared. The shared lock is requested by an application that wants to read a particular set of data. If it succeeds, any other application requesting shared locks (on the same data) is allowed. However, any such write lock requests are denied.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exclusive and cumulative. This mode is also known as a write lock. It's requested by transactions that update the contents of a particular table. The same transaction may request additional write locks. A cumulative counter, initialized to 0, is provided for this purpose. Each time a particular data is locked via a cumulative lock, the counter is incremented by 1. Any external read locks are denied.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exclusive and not cumulative. This mode behaves in a similar fashion to the cumulative lock. The only difference is that cumulative facility is not permissible; a transaction cannot set additional lock entries on data that it has already locked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where do we go from here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two function modules, one for setting locks and the other for releasing them, are automatically generated upon successful activation of the lock object in the ABAP Dictionary. They are of the form ENQUEUE_* and DEQUEUE_*. If we created the lock object E_MYLOCKOBJ, the corresponding locking and unlocking function modules generated would be ENQUEUE_ E_MYLOCKOBJ and DEQUEUE_E_MYLOCKOBJ, respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any SAP transaction that wants to employ the SAP locking facility must call these function modules with appropriate parameters. A pseudocode format of all application programs that employ the SAP locking facility appears below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL relevant ENQUEUE function&lt;/P&gt;&lt;P&gt;MAKE update&lt;/P&gt;&lt;P&gt;CALL relevant DEQUEUE function&lt;/P&gt;&lt;P&gt;A program that sets a lock can only reverse or unlock it. At the end of all transactions, all locks are automatically released.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The identical interfaces of the ENQUEUE and DEQUEUE modules are of primary importance. These include the lock parameters (previously defined in the ABAP Dictionary) that specify the table entry or entries that are to be locked. It is not necessary to specify lock parameters in full at runtime. If we supply only partial parameters, the generic lock is implied.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, while calling the DEQUEUE function in our PERNR example, we could pass "300" in place of parameter MANDT and leave the parameter PERNR blank. In this case, all employee entries in client 300 would be locked regardless of their personnel numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the ENQUEUE function is successful, the value of the return code SY-SUBRC is set to 0. Failure in locking the given entry raises the exception FOREIGN_LOCK. This exception implies that the table entries corresponding to the given parameters have already been locked by another application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A lock table is a centralized table in the main memory of the ENQUEUE server that acts as a directory of all locked objects. You can view the contents of this table by using the standard SAP transaction SM12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whenever a new ENQUEUE function is called by an application, an entry is made in this table. Conversely, a DEQUEUE function clears the corresponding entry. When a different program attempts to lock the same object, SAP refers to this table to find out if it is already in a locked state. If not, it is allowed to proceed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Included fields are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock arguments. This is made from the key data of the lock parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cumulative counter. In the case of the cumulative lock, this shows the number of times locks have been applied.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User name. This is the name of the user who has run the application that has applied the lock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use this table to view the type and arguments of the lock. All lock entries set by a particular transaction are automatically deleted from the table upon the transaction's termination. In case of abrupt termination by the ENQUEUE transaction, you may also manually delete lock entries from this table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Conclusion&lt;/P&gt;&lt;P&gt;Knowledge of the SAP locking mechanism is essential to write even the simplest database update programs. Always follow the golden rule: Try to express your problem in terms of the data fields that are to be locked to formulate the lock condition.&lt;/P&gt;&lt;P&gt;Lock Objects are Created using Tcode SE11.&lt;/P&gt;&lt;P&gt;The Lock object name must be start with EZur name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mainly lock objects are used for locking the transactions, tables --etec.&lt;/P&gt;&lt;P&gt;Multiple users can not updated the same transaction at the same time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whenever u create a lock object using se11. SAP internally &lt;/P&gt;&lt;P&gt;creates a two function modules:&lt;/P&gt;&lt;P&gt;Enqueue_lockobjname ---For Locking purpose,&lt;/P&gt;&lt;P&gt;dequeue_lockobjname---For Unlocking purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U make use of these fms to lock and unlock transctions, tables..etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The example is as follws:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EPORT ZLOCK_UNLOCK&lt;/P&gt;&lt;P&gt;MESSAGE-ID ZBDC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES ZSTUD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA text(8) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL SCREEN 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp; Module USER_COMMAND_0100 INPUT&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&amp;#149; text&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------" /&gt;&lt;P&gt;MODULE USER_COMMAND_0100 INPUT.&lt;/P&gt;&lt;P&gt;CASE SY-UCOMM.&lt;/P&gt;&lt;P&gt;WHEN 'SELECT'.&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM ZSTUD WHERE ROLLNO = ZSTUD-ROLLNO.&lt;/P&gt;&lt;P&gt;MESSAGE i004 WITH 'SY-SUBRC:' sy-subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN 'EXIT'.&lt;/P&gt;&lt;P&gt;LEAVE PROGRAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN 'ENQUEUE'.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ENQUEUE_EZLOCK1'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;MODE_ZSTUD = 'X'&lt;/P&gt;&lt;P&gt;ROLLNO = ZSTUD-ROLLNO&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;&lt;/P&gt;&lt;P&gt;CASE sy-subrc.&lt;/P&gt;&lt;P&gt;WHEN 0.&lt;/P&gt;&lt;P&gt;MESSAGE i004 WITH 'Enqueue successful'(001).&lt;/P&gt;&lt;P&gt;WHEN 1.&lt;/P&gt;&lt;P&gt;text = sy-msgv1.&lt;/P&gt;&lt;P&gt;MESSAGE e004 WITH 'Record already'(002) 'locked by'(003)&lt;/P&gt;&lt;P&gt;text.&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'SM12'.&lt;/P&gt;&lt;P&gt;WHEN 2 OR 3.&lt;/P&gt;&lt;P&gt;MESSAGE e004 WITH 'Error in enqueue!'(004)&lt;/P&gt;&lt;P&gt;'SY-SUBRC:' sy-subrc.&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN 'DEQUEUE'.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DEQUEUE_EZLOCK1'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;MODE_ZSTUD = 'X'&lt;/P&gt;&lt;P&gt;ROLLNO = ZSTUD-ROLLNO&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;OTHERS = 1.&lt;/P&gt;&lt;P&gt;CASE sy-subrc.&lt;/P&gt;&lt;P&gt;WHEN 0.&lt;/P&gt;&lt;P&gt;MESSAGE i004 WITH 'Dequeue successful'(005).&lt;/P&gt;&lt;P&gt;WHEN 1.&lt;/P&gt;&lt;P&gt;MESSAGE e004 WITH 'Error in dequeue!'(006).&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN 'SM12'.&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'SM12'.&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE. " USER_COMMAND_0100 INPUT&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp; Module STATUS_0100 OUTPUT&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&amp;#149; text&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------" /&gt;&lt;P&gt; MODULE STATUS_0100 OUTPUT.&lt;/P&gt;&lt;P&gt;SET PF-STATUS 'BASIC'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE. " STATUS_0100 OUTPUT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 09:30:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760850#M904789</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T09:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760851#M904790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;create a lock object in se11 for your table. Name should start with EZ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way two function modules will be created automatically, one for ENQUEUE and one for DEQUEUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Micky Oestreich on May 2, 2008 11:31 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 09:31:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760851#M904790</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2008-05-02T09:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760852#M904791</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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;testing the locking of tables...&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;CODE&gt;data:
varkey like rstable-varkey.
 
varkey = sy-mandt.
 
* locking the tables............................
call function 'ENQUEUE_E_TABLE'
exporting
* MODE_RSTABLE = 'E'
tabname = 'MARA'
varkey = varkey
* X_TABNAME = ' '
* X_VARKEY = ' '
* _SCOPE = '2'
* _WAIT = ' '
* _COLLECT = 'X'
exceptions
foreign_lock = 1
system_failure = 2
others = 3
.
case sy-subrc.
when 1.
message i184(bctrain) with 'Foreignlock'.
when 2.
message i184(bctrain) with 'system failure'.
when 0.
message i184(bctrain) with 'success'.
when others.
message i184(bctrain) with 'others'.
endcase.
 
* unlocking the table...............
 
call function 'DEQUEUE_E_TABLE'
exporting
* MODE_RSTABLE = 'E'
tabname = 'MARA'
varkey = varkey
* X_TABNAME = ' '
* X_VARKEY = ' '
* _SCOPE = '3'
* _SYNCHRON = ' '
* _COLLECT&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Prakasam Sengottuvel on May 2, 2008 11:32 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 09:31:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760852#M904791</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T09:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760853#M904792</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;U can create a lock for your table by SE11:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here u can create a lock object with the name has to begin with EZ*, after saving it the system will generate the fm to lock and unlock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 09:32:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760853#M904792</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T09:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760854#M904793</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; Create a lock object for that table via SE11-&amp;gt;Lock Object ...which creates ENQUEUE_EZ_&amp;lt;TABLE&amp;gt; and DEQUEUE_EZ_&amp;lt;TABLE&amp;gt; ... which you can use it in the program before and after updating the table  in order to lock it for data consistency ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 09:33:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760854#M904793</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T09:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760855#M904794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jasmine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use FMs ENQUEUE_E_TABLE and DEQUEUE_E_TABLE. Pass table name which you need to lock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To lock the table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ENQUEUE_E_TABLE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;tabname = table_name&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;&lt;/P&gt;&lt;P&gt;Do the required task&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To Unlock the Table:&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DEQUEUE_E_TABLE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;tabname = table_name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here the table_name represents the table that you want to lock&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chitra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 09:39:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760855#M904794</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T09:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760856#M904795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jasmine, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the FM : ENQUEUE_E_TABLE and DEQUEUE_E_TABLE to lock any tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here you need to pass the table name to lock/unlock it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else you can create your own lockobject for the your custom table in SE11. once you create the lock objects SAP will create two FMs one for ENQUEUE and other for DEQUEUE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 09:46:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760856#M904795</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T09:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760857#M904796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 12:40:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-table/m-p/3760857#M904796</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-04-22T12:40:35Z</dc:date>
    </item>
  </channel>
</rss>

