<?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: regarding lock objects in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-lock-objects/m-p/2457869#M551204</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAP Lock Objects&lt;/P&gt;&lt;P&gt;SFLIGHT&lt;/P&gt;&lt;P&gt;SFLIGHT&lt;/P&gt;&lt;P&gt;SFLIGHT&lt;/P&gt;&lt;P&gt;SFLIGHT&lt;/P&gt;&lt;P&gt;Name&lt;/P&gt;&lt;P&gt;Primary table&lt;/P&gt;&lt;P&gt;Secondary tables&lt;/P&gt;&lt;P&gt;Table Field name Lock argument&lt;/P&gt;&lt;P&gt;Table Mode&lt;/P&gt;&lt;P&gt;MANDT&lt;/P&gt;&lt;P&gt;CARRID&lt;/P&gt;&lt;P&gt;CONNID&lt;/P&gt;&lt;P&gt;FLDATE&lt;/P&gt;&lt;P&gt;MANDT&lt;/P&gt;&lt;P&gt;CARRID&lt;/P&gt;&lt;P&gt;CONNID&lt;/P&gt;&lt;P&gt;FLDATE&lt;/P&gt;&lt;P&gt;SFLIGHT&lt;/P&gt;&lt;P&gt;ESFLIGHT&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;ABAP&lt;/P&gt;&lt;P&gt;Diiccttiioonnaarryy&lt;/P&gt;&lt;P&gt;SFLIGHT&lt;/P&gt;&lt;P&gt;. . .&lt;/P&gt;&lt;P&gt;Lock arguments&lt;/P&gt;&lt;P&gt;Lock mode&lt;/P&gt;&lt;P&gt;E Write lock&lt;/P&gt;&lt;P&gt;S Read lock&lt;/P&gt;&lt;P&gt;X Extended write lock&lt;/P&gt;&lt;P&gt;Lock modules are created for lock objects and not tables.&lt;/P&gt;&lt;P&gt;Lock objects are maintained in the dictionary. Customer lock objects must begin&lt;/P&gt;&lt;P&gt;with "EY" or "EZ".&lt;/P&gt;&lt;P&gt;A lock object is a logical object composed of a list of tables that are linked by&lt;/P&gt;&lt;P&gt;foreign key relationships. Lock modules are generated for these objects and&lt;/P&gt;&lt;P&gt;enable common lock entries to be set for all tables contained in the lock object.&lt;/P&gt;&lt;P&gt;This allows combinations of table entries to be locked.&lt;/P&gt;&lt;P&gt;Example: A lock object that contains the tables SFLIGHT and SBOOK enables a&lt;/P&gt;&lt;P&gt;flight with its bookings to be locked.&lt;/P&gt;&lt;P&gt;The list of tables for a lock object consists of a primary table. Further table&lt;/P&gt;&lt;P&gt;entries are referred to as secondary tables. Only tables with foreign key&lt;/P&gt;&lt;P&gt;relationships to the primary table can be used as secondary tables.&lt;/P&gt;&lt;P&gt;With lock objects, you can assign different names for the parameters that describe&lt;/P&gt;&lt;P&gt;the fields of the lock arguments for the lock modules. The names of the table fields&lt;/P&gt;&lt;P&gt;(key fields of the tables) are proposed by the system.&lt;/P&gt;&lt;P&gt;You can specify the lock mode (a write lock 'E' or 'X' or a read lock 'S') for each&lt;/P&gt;&lt;P&gt;table. These function as default values for the lock modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generating Lock Modules&lt;/P&gt;&lt;P&gt;DEQUEUE_ESFLIGHT&lt;/P&gt;&lt;P&gt;Activate&lt;/P&gt;&lt;P&gt;Lock oobbjjeecctt&lt;/P&gt;&lt;P&gt;ESFLIGHT&lt;/P&gt;&lt;P&gt;Function module&lt;/P&gt;&lt;P&gt;ENQUEUE_ESFLIGHT&lt;/P&gt;&lt;P&gt;Function module&lt;/P&gt;&lt;P&gt;Set lock Release lock&lt;/P&gt;&lt;P&gt;Generraatteedd&lt;/P&gt;&lt;P&gt;automattiiccaallllyy&lt;/P&gt;&lt;P&gt;DEQUEUE_After you have assigned tables and default lock modes, lock objects must be&lt;/P&gt;&lt;P&gt;generated.&lt;/P&gt;&lt;P&gt;When you activate a lock object, the system generates an ENQUEUE and a&lt;/P&gt;&lt;P&gt;DEQUEUE function module.&lt;/P&gt;&lt;P&gt;??These have the names ENQUEUE_&amp;lt;object_name&amp;gt; and DEQUEUE_&amp;lt;object_name&amp;gt;&lt;/P&gt;&lt;P&gt;respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Overview: Using Locks: Time Sequence&lt;/P&gt;&lt;P&gt;UUssiinngg lloocckkss:: ttiimmee s seeqquueennccee&lt;/P&gt;&lt;P&gt;LLoocckk oobbjjeeccttss&lt;/P&gt;&lt;P&gt;SSeettttiinngg aanndd rreelleeaassiinngg lloocckkss&lt;/P&gt;&lt;P&gt;OOvveerrvviieeww&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading Current Data&lt;/P&gt;&lt;P&gt;User 1&lt;/P&gt;&lt;P&gt;lock&lt;/P&gt;&lt;P&gt;read change User 2&lt;/P&gt;&lt;P&gt;unlock&lt;/P&gt;&lt;P&gt;read change&lt;/P&gt;&lt;P&gt;SAP LUW 1&lt;/P&gt;&lt;P&gt;SAP LUW 2&lt;/P&gt;&lt;P&gt;unlock&lt;/P&gt;&lt;P&gt;lock&lt;/P&gt;&lt;P&gt;Lock 1 Lock 2&lt;/P&gt;&lt;P&gt;Lock durations&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2 3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2 3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;Time&lt;/P&gt;&lt;P&gt;If you want to ensure that you are reading current data in your program (with the&lt;/P&gt;&lt;P&gt;intention of changing and returning this to the database), you should use the&lt;/P&gt;&lt;P&gt;following procedure in your program for lock requests and database accesses:&lt;/P&gt;&lt;P&gt;1. Lock the data that you want to edit.&lt;/P&gt;&lt;P&gt;2. Read the current data from the database.&lt;/P&gt;&lt;P&gt;3. Process (change) the data in your program and write this to the database.&lt;/P&gt;&lt;P&gt;4. Release the locks that you set at the beginning.&lt;/P&gt;&lt;P&gt;This procedure ensures that your changes run fully with lock protection and that&lt;/P&gt;&lt;P&gt;you only read data, which has been changed consistently by other programs (with&lt;/P&gt;&lt;P&gt;the restriction that these are also using the SAP lock concept and following the&lt;/P&gt;&lt;P&gt;procedure described).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Risk of Inconsistent Data as a Result of Using Locks&lt;/P&gt;&lt;P&gt;Incorrectly&lt;/P&gt;&lt;P&gt;User 1&lt;/P&gt;&lt;P&gt;lock&lt;/P&gt;&lt;P&gt;read change User 2&lt;/P&gt;&lt;P&gt;unlock&lt;/P&gt;&lt;P&gt;read change&lt;/P&gt;&lt;P&gt;unlock&lt;/P&gt;&lt;P&gt;SAP LUW 1&lt;/P&gt;&lt;P&gt;SAP LUW 2&lt;/P&gt;&lt;P&gt;lock&lt;/P&gt;&lt;P&gt;Lock 1 Lock 2&lt;/P&gt;&lt;P&gt;Lock durations&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2 3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;Time&lt;/P&gt;&lt;P&gt;If you change the order of the four steps to Read -&amp;gt; Lock -&amp;gt; Change -&amp;gt; Unlock,&lt;/P&gt;&lt;P&gt;you run the risk that the data read by your program will not be up to date. Your&lt;/P&gt;&lt;P&gt;program can read data before another user's program writes changes to the&lt;/P&gt;&lt;P&gt;database. This means that a user of your program will make decisions for entries&lt;/P&gt;&lt;P&gt;that are not based on up-to-date data from the database. For this reason, you&lt;/P&gt;&lt;P&gt;should always follow the recommended procedure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using a Lock Container&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP&lt;/P&gt;&lt;P&gt;program&lt;/P&gt;&lt;P&gt;Lock module 1&lt;/P&gt;&lt;P&gt;Lock table&lt;/P&gt;&lt;P&gt;Lock module 2&lt;/P&gt;&lt;P&gt;Lock module n&lt;/P&gt;&lt;P&gt;FLUSH_ENQUEUE&lt;/P&gt;&lt;P&gt;Time&lt;/P&gt;&lt;P&gt;Container&lt;/P&gt;&lt;P&gt;Lock 1&lt;/P&gt;&lt;P&gt;Lock 2&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Lock n&lt;/P&gt;&lt;P&gt;Orders:&lt;/P&gt;&lt;P&gt;Collect locks&lt;/P&gt;&lt;P&gt;Requesting a lock from a program is a communication step with lock&lt;/P&gt;&lt;P&gt;administration. The communication step requires a certain time interval. If your&lt;/P&gt;&lt;P&gt;program sets locks for several objects, this interval occurs more than once.&lt;/P&gt;&lt;P&gt;By using so-called local lock containers , you can reduce these communication&lt;/P&gt;&lt;P&gt;intervals with lock administration. To do so, collect the required lock requests of&lt;/P&gt;&lt;P&gt;your program and send them together to lock administration.&lt;/P&gt;&lt;P&gt;The locks (delayed execution) can be collected when the lock modules are called.&lt;/P&gt;&lt;P&gt;For this purpose, qualify the IMPORT parameter_collect with 'X'. The data&lt;/P&gt;&lt;P&gt;transferred via the lock module interface is then registered in a list (lock&lt;/P&gt;&lt;P&gt;container) as a lock request that needs to be executed.&lt;/P&gt;&lt;P&gt;The lock container can be terminated using the FLUSH_ENQUEUE function module&lt;/P&gt;&lt;P&gt;and sent to lock administration.&lt;/P&gt;&lt;P&gt;??When the lock orders of a lock container can be executed, the lock container is&lt;/P&gt;&lt;P&gt;deleted.&lt;/P&gt;&lt;P&gt;If one of the locks in a container cannot be set, the function module&lt;/P&gt;&lt;P&gt;FLUSH_ENQUEUE triggers the exception FOREIGN_LOCK. In this case, none of the&lt;/P&gt;&lt;P&gt;registered lock requests is executed. The registered locks remain in the lock&lt;/P&gt;&lt;P&gt;container.&lt;/P&gt;&lt;P&gt;You can delete the contents of an existing lock container with the function module&lt;/P&gt;&lt;P&gt;RESET_ENQUEUE.&lt;/P&gt;&lt;P&gt;The specified function modules have release status internally-released.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jul 2007 09:00:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-04T09:00:51Z</dc:date>
    <item>
      <title>regarding lock objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-lock-objects/m-p/2457866#M551201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;        why lock objects? how can we work on that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 08:53:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-lock-objects/m-p/2457866#M551201</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T08:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: regarding lock objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-lock-objects/m-p/2457867#M551202</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 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;- 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;&lt;/P&gt;&lt;P&gt;- 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;&lt;/P&gt;&lt;P&gt;- 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;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;- 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;&lt;/P&gt;&lt;P&gt;- 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;&lt;/P&gt;&lt;P&gt;- 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;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;GO TO SE11&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select the radio button "Lock object"..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give the name starts with EZ or EY..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example: EYTEST&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Press Create button..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give the short description..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example: Lock object for table ZTABLE..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the tables tab..Give the table name..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example: ZTABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save and generate..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your lock object is now created..You can see the LOCK MODULES..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the menu ..GOTO -&amp;gt; LOCK MODULES..There you can see the ENQUEUE and DEQUEUE function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock objects: &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm" target="test_blank"&gt;http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Match Code Objects:&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://searchsap.techtarget.com/tip/0,289483,sid21_gci553386,00.html" target="test_blank"&gt;http://searchsap.techtarget.com/tip/0,289483,sid21_gci553386,00.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See this link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm" target="test_blank"&gt;http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 08:56:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-lock-objects/m-p/2457867#M551202</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T08:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: regarding lock objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-lock-objects/m-p/2457868#M551203</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;ock objects are used to synchronize access to the same data by more than one program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;General information about the lock mechanism.&lt;/P&gt;&lt;P&gt;You can synchronize access by several programs to the same data with a logical lock mechanism. This lock mechanism fulfills two main functions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A program can tell other programs which data records it is just reading or changing.&lt;/P&gt;&lt;P&gt;A program can prevent itself from reading data that is just being changed by another program.&lt;/P&gt;&lt;P&gt;When accessing data records, the records just being edited by other programs can be identified by the entry in the lock table. Such an entry for the lock must define a number of fully specified key fields, that is either a value is passed for the key field or this field is locked generically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To set locks, a lock object must be defined in the ABAP Dictionary. When this lock object is activated, two function modules (see Function Modules for Lock Requests) are generated with the names ENQUEUE_ are generated from its definition to set and release locks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find information about the activation flow in the activation log, which you can display with Utilities ® Activation log. If errors occurred during activation, the activation log is displayed immediately.&lt;/P&gt;&lt;P&gt;Thanks,reward If Helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 08:56:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-lock-objects/m-p/2457868#M551203</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T08:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: regarding lock objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-lock-objects/m-p/2457869#M551204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAP Lock Objects&lt;/P&gt;&lt;P&gt;SFLIGHT&lt;/P&gt;&lt;P&gt;SFLIGHT&lt;/P&gt;&lt;P&gt;SFLIGHT&lt;/P&gt;&lt;P&gt;SFLIGHT&lt;/P&gt;&lt;P&gt;Name&lt;/P&gt;&lt;P&gt;Primary table&lt;/P&gt;&lt;P&gt;Secondary tables&lt;/P&gt;&lt;P&gt;Table Field name Lock argument&lt;/P&gt;&lt;P&gt;Table Mode&lt;/P&gt;&lt;P&gt;MANDT&lt;/P&gt;&lt;P&gt;CARRID&lt;/P&gt;&lt;P&gt;CONNID&lt;/P&gt;&lt;P&gt;FLDATE&lt;/P&gt;&lt;P&gt;MANDT&lt;/P&gt;&lt;P&gt;CARRID&lt;/P&gt;&lt;P&gt;CONNID&lt;/P&gt;&lt;P&gt;FLDATE&lt;/P&gt;&lt;P&gt;SFLIGHT&lt;/P&gt;&lt;P&gt;ESFLIGHT&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;ABAP&lt;/P&gt;&lt;P&gt;Diiccttiioonnaarryy&lt;/P&gt;&lt;P&gt;SFLIGHT&lt;/P&gt;&lt;P&gt;. . .&lt;/P&gt;&lt;P&gt;Lock arguments&lt;/P&gt;&lt;P&gt;Lock mode&lt;/P&gt;&lt;P&gt;E Write lock&lt;/P&gt;&lt;P&gt;S Read lock&lt;/P&gt;&lt;P&gt;X Extended write lock&lt;/P&gt;&lt;P&gt;Lock modules are created for lock objects and not tables.&lt;/P&gt;&lt;P&gt;Lock objects are maintained in the dictionary. Customer lock objects must begin&lt;/P&gt;&lt;P&gt;with "EY" or "EZ".&lt;/P&gt;&lt;P&gt;A lock object is a logical object composed of a list of tables that are linked by&lt;/P&gt;&lt;P&gt;foreign key relationships. Lock modules are generated for these objects and&lt;/P&gt;&lt;P&gt;enable common lock entries to be set for all tables contained in the lock object.&lt;/P&gt;&lt;P&gt;This allows combinations of table entries to be locked.&lt;/P&gt;&lt;P&gt;Example: A lock object that contains the tables SFLIGHT and SBOOK enables a&lt;/P&gt;&lt;P&gt;flight with its bookings to be locked.&lt;/P&gt;&lt;P&gt;The list of tables for a lock object consists of a primary table. Further table&lt;/P&gt;&lt;P&gt;entries are referred to as secondary tables. Only tables with foreign key&lt;/P&gt;&lt;P&gt;relationships to the primary table can be used as secondary tables.&lt;/P&gt;&lt;P&gt;With lock objects, you can assign different names for the parameters that describe&lt;/P&gt;&lt;P&gt;the fields of the lock arguments for the lock modules. The names of the table fields&lt;/P&gt;&lt;P&gt;(key fields of the tables) are proposed by the system.&lt;/P&gt;&lt;P&gt;You can specify the lock mode (a write lock 'E' or 'X' or a read lock 'S') for each&lt;/P&gt;&lt;P&gt;table. These function as default values for the lock modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generating Lock Modules&lt;/P&gt;&lt;P&gt;DEQUEUE_ESFLIGHT&lt;/P&gt;&lt;P&gt;Activate&lt;/P&gt;&lt;P&gt;Lock oobbjjeecctt&lt;/P&gt;&lt;P&gt;ESFLIGHT&lt;/P&gt;&lt;P&gt;Function module&lt;/P&gt;&lt;P&gt;ENQUEUE_ESFLIGHT&lt;/P&gt;&lt;P&gt;Function module&lt;/P&gt;&lt;P&gt;Set lock Release lock&lt;/P&gt;&lt;P&gt;Generraatteedd&lt;/P&gt;&lt;P&gt;automattiiccaallllyy&lt;/P&gt;&lt;P&gt;DEQUEUE_After you have assigned tables and default lock modes, lock objects must be&lt;/P&gt;&lt;P&gt;generated.&lt;/P&gt;&lt;P&gt;When you activate a lock object, the system generates an ENQUEUE and a&lt;/P&gt;&lt;P&gt;DEQUEUE function module.&lt;/P&gt;&lt;P&gt;??These have the names ENQUEUE_&amp;lt;object_name&amp;gt; and DEQUEUE_&amp;lt;object_name&amp;gt;&lt;/P&gt;&lt;P&gt;respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Overview: Using Locks: Time Sequence&lt;/P&gt;&lt;P&gt;UUssiinngg lloocckkss:: ttiimmee s seeqquueennccee&lt;/P&gt;&lt;P&gt;LLoocckk oobbjjeeccttss&lt;/P&gt;&lt;P&gt;SSeettttiinngg aanndd rreelleeaassiinngg lloocckkss&lt;/P&gt;&lt;P&gt;OOvveerrvviieeww&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading Current Data&lt;/P&gt;&lt;P&gt;User 1&lt;/P&gt;&lt;P&gt;lock&lt;/P&gt;&lt;P&gt;read change User 2&lt;/P&gt;&lt;P&gt;unlock&lt;/P&gt;&lt;P&gt;read change&lt;/P&gt;&lt;P&gt;SAP LUW 1&lt;/P&gt;&lt;P&gt;SAP LUW 2&lt;/P&gt;&lt;P&gt;unlock&lt;/P&gt;&lt;P&gt;lock&lt;/P&gt;&lt;P&gt;Lock 1 Lock 2&lt;/P&gt;&lt;P&gt;Lock durations&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2 3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2 3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;Time&lt;/P&gt;&lt;P&gt;If you want to ensure that you are reading current data in your program (with the&lt;/P&gt;&lt;P&gt;intention of changing and returning this to the database), you should use the&lt;/P&gt;&lt;P&gt;following procedure in your program for lock requests and database accesses:&lt;/P&gt;&lt;P&gt;1. Lock the data that you want to edit.&lt;/P&gt;&lt;P&gt;2. Read the current data from the database.&lt;/P&gt;&lt;P&gt;3. Process (change) the data in your program and write this to the database.&lt;/P&gt;&lt;P&gt;4. Release the locks that you set at the beginning.&lt;/P&gt;&lt;P&gt;This procedure ensures that your changes run fully with lock protection and that&lt;/P&gt;&lt;P&gt;you only read data, which has been changed consistently by other programs (with&lt;/P&gt;&lt;P&gt;the restriction that these are also using the SAP lock concept and following the&lt;/P&gt;&lt;P&gt;procedure described).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Risk of Inconsistent Data as a Result of Using Locks&lt;/P&gt;&lt;P&gt;Incorrectly&lt;/P&gt;&lt;P&gt;User 1&lt;/P&gt;&lt;P&gt;lock&lt;/P&gt;&lt;P&gt;read change User 2&lt;/P&gt;&lt;P&gt;unlock&lt;/P&gt;&lt;P&gt;read change&lt;/P&gt;&lt;P&gt;unlock&lt;/P&gt;&lt;P&gt;SAP LUW 1&lt;/P&gt;&lt;P&gt;SAP LUW 2&lt;/P&gt;&lt;P&gt;lock&lt;/P&gt;&lt;P&gt;Lock 1 Lock 2&lt;/P&gt;&lt;P&gt;Lock durations&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2 3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;Time&lt;/P&gt;&lt;P&gt;If you change the order of the four steps to Read -&amp;gt; Lock -&amp;gt; Change -&amp;gt; Unlock,&lt;/P&gt;&lt;P&gt;you run the risk that the data read by your program will not be up to date. Your&lt;/P&gt;&lt;P&gt;program can read data before another user's program writes changes to the&lt;/P&gt;&lt;P&gt;database. This means that a user of your program will make decisions for entries&lt;/P&gt;&lt;P&gt;that are not based on up-to-date data from the database. For this reason, you&lt;/P&gt;&lt;P&gt;should always follow the recommended procedure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using a Lock Container&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP&lt;/P&gt;&lt;P&gt;program&lt;/P&gt;&lt;P&gt;Lock module 1&lt;/P&gt;&lt;P&gt;Lock table&lt;/P&gt;&lt;P&gt;Lock module 2&lt;/P&gt;&lt;P&gt;Lock module n&lt;/P&gt;&lt;P&gt;FLUSH_ENQUEUE&lt;/P&gt;&lt;P&gt;Time&lt;/P&gt;&lt;P&gt;Container&lt;/P&gt;&lt;P&gt;Lock 1&lt;/P&gt;&lt;P&gt;Lock 2&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Lock n&lt;/P&gt;&lt;P&gt;Orders:&lt;/P&gt;&lt;P&gt;Collect locks&lt;/P&gt;&lt;P&gt;Requesting a lock from a program is a communication step with lock&lt;/P&gt;&lt;P&gt;administration. The communication step requires a certain time interval. If your&lt;/P&gt;&lt;P&gt;program sets locks for several objects, this interval occurs more than once.&lt;/P&gt;&lt;P&gt;By using so-called local lock containers , you can reduce these communication&lt;/P&gt;&lt;P&gt;intervals with lock administration. To do so, collect the required lock requests of&lt;/P&gt;&lt;P&gt;your program and send them together to lock administration.&lt;/P&gt;&lt;P&gt;The locks (delayed execution) can be collected when the lock modules are called.&lt;/P&gt;&lt;P&gt;For this purpose, qualify the IMPORT parameter_collect with 'X'. The data&lt;/P&gt;&lt;P&gt;transferred via the lock module interface is then registered in a list (lock&lt;/P&gt;&lt;P&gt;container) as a lock request that needs to be executed.&lt;/P&gt;&lt;P&gt;The lock container can be terminated using the FLUSH_ENQUEUE function module&lt;/P&gt;&lt;P&gt;and sent to lock administration.&lt;/P&gt;&lt;P&gt;??When the lock orders of a lock container can be executed, the lock container is&lt;/P&gt;&lt;P&gt;deleted.&lt;/P&gt;&lt;P&gt;If one of the locks in a container cannot be set, the function module&lt;/P&gt;&lt;P&gt;FLUSH_ENQUEUE triggers the exception FOREIGN_LOCK. In this case, none of the&lt;/P&gt;&lt;P&gt;registered lock requests is executed. The registered locks remain in the lock&lt;/P&gt;&lt;P&gt;container.&lt;/P&gt;&lt;P&gt;You can delete the contents of an existing lock container with the function module&lt;/P&gt;&lt;P&gt;RESET_ENQUEUE.&lt;/P&gt;&lt;P&gt;The specified function modules have release status internally-released.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 09:00:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-lock-objects/m-p/2457869#M551204</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T09:00:51Z</dc:date>
    </item>
  </channel>
</rss>

