<?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 objects?? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3131853#M744020</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;Lock object concept&lt;/P&gt;&lt;P&gt;Lock modes&lt;/P&gt;&lt;P&gt;Creating a lock object (example)&lt;/P&gt;&lt;P&gt;Lock object sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP data dictionary provides you with a locking mechanism to synchronize simultaneous data access by different users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock objects are created in SE11.&lt;/P&gt;&lt;P&gt;Customer lock objects must begin with EY or EZ .&lt;/P&gt;&lt;P&gt;Three possible lock modes exist for lock objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock Mode&lt;/P&gt;&lt;P&gt;Lock mode E: This sets a lock for changing data for single user. This lock can be accumulated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock mode X: This mode is used like mode E for changing data. The only technical difference from mode E is that the respective lock does not allow accumulation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock mode S: This mode ensures that data displayed in your program cannot be changed by other users during the entire display time. Here you do not want to change the data yourself (allows read only access for data).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating Lock object&lt;/P&gt;&lt;P&gt;SE11&lt;/P&gt;&lt;P&gt;1)Enter lock object name beginning with EY or EZ&lt;/P&gt;&lt;P&gt;and hit create.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)Enter table names containing data records that should be locked and the lock mode.&lt;/P&gt;&lt;P&gt;Enter short text /tbale/lockmode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) The primary keys of the specified tables are automatically selected as lock parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It automatically selects the primary key for the selected table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To set a lock in the application program&lt;/P&gt;&lt;P&gt;call a function module ENQUEUE_&amp;lt;LOCK_OBJECT&amp;gt;.&lt;/P&gt;&lt;P&gt;For our example, it would be ENQUEUE_EZMARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To release the lock in the application program&lt;/P&gt;&lt;P&gt;call a function module DEQUEUE_&amp;lt;LOCK_OBJECT&amp;gt;.&lt;/P&gt;&lt;P&gt;For our example, it would be DEQUEUE_EZMARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer the code executed by user (say abap1) for&lt;/P&gt;&lt;P&gt;matnr = &amp;#146;000000000000000012&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock Objects are used to synchronize access to the same data by more than one user. Function modules that can be used in application programs are generated from the definition of a lock object in the ABAP Dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The R/3 System synchronizes simultaneous access of several users to the same data records with a lock mechanism. When interactive transactions are programmed, locks are set and released by calling function modules .These function modules are automatically generated from the definition of lock objects in the ABAP Dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structure of a Lock Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The tables in which data records should be locked with a lock request are defined in a lock object together with their key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When tables are selected, one table (the primary table) is first selected. Further tables (secondary tables) can also be added using foreign key relationships.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock Arguments&lt;/P&gt;&lt;P&gt;The lock argument of a table in the lock object consists of the key fields of the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The lock argument fields of a lock object are used as input parameters in the function modules for setting and removing locks generated from the lock object definition. When these function modules are called, the table rows to be locked or&lt;/P&gt;&lt;P&gt;unlocked are specified by defining certain values in these fields.These values can also be generic. The lock argument fields therefore define which subset of the table rows should be locked&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Data Dictionary/ Lock Objects&lt;/P&gt;&lt;P&gt;The simplest case of a lock object consists of exactly one table and the lock argument of the table is the primary key of this table. Several tables can also be included in a lock object. A lock request therefore can lock an entire logical&lt;/P&gt;&lt;P&gt;object, and not only a record of a table. Such a logical object can be for example a document comprising an entry in a header table and N entries in a positiontable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock Mode&lt;/P&gt;&lt;P&gt;The lock mode controls whether several users can access data records at the same time. The lock mode can be assigned separately for each table in the lock object. When the lock is set, the corresponding lock entry is stored in the&lt;/P&gt;&lt;P&gt;lock table of the system for each table. Access by more than one user can be synchronized in the&lt;/P&gt;&lt;P&gt;following ways:&lt;/P&gt;&lt;P&gt;Exclusive lock: The locked data can only be displayed or&lt;/P&gt;&lt;P&gt;edited by a single user. A request for another exclusive lock&lt;/P&gt;&lt;P&gt;or for a&lt;/P&gt;&lt;P&gt;shared lock is rejected.&lt;/P&gt;&lt;P&gt;Shared lock: More than one user can access the locked data&lt;/P&gt;&lt;P&gt;at the same time in display mode. A request for another&lt;/P&gt;&lt;P&gt;shared lock is accepted, even if it comes from another user. An exclusive lock&lt;/P&gt;&lt;P&gt;is rejected. Exclusive but not cumulative: Exclusive locks can be requested&lt;/P&gt;&lt;P&gt;several times from the same transaction and are processed&lt;/P&gt;&lt;P&gt;successively. In contrast, exclusive but not cumulative locks&lt;/P&gt;&lt;P&gt;can be called only once from the same transaction. All other&lt;/P&gt;&lt;P&gt;lock requests are rejected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Select object type Lock object in the initial screen of the ABAP Dictionary, enter an object name and choose Create. The name of a lock object should begin with an E (Enqueue).The maintenance screen for lock objects is displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Enter an explanatory short text in the field Short text. You can then use the short text to find the lock object at a later time, for example with the R/3 Repository Information System. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Enter the name of the primary table of the lock object. All other tables in the lock object must be linked with the primary table using foreign keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Select the lock mode of the primary table in the field below it The lock mode is used as the default value for the corresponding parameters of the function modules generated from the lock object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) Choose Add if you want to lock records in more than one&lt;/P&gt;&lt;P&gt;table with the lock object. A list of all the tables linked with the primary table using valid foreign keys is displayed. Select the appropriate table. The lock&lt;/P&gt;&lt;P&gt;mode of the primary table is copied as lock mode. You can change this setting as required, for example you can assign the lock mode separately for each table.&lt;/P&gt;&lt;P&gt;Similarly, you can add a table linked with the secondary table just added with foreign keys. To do this, place the cursor on the name of the secondary table and choose Add.&lt;/P&gt;&lt;P&gt;If no lock mode is assigned to a table, no lock is set for the&lt;/P&gt;&lt;P&gt;entries in this table when the generated function modules are&lt;/P&gt;&lt;P&gt;called. You should not assign a lock mode if a secondary table&lt;/P&gt;&lt;P&gt;was only used to define a path between the primary table and&lt;/P&gt;&lt;P&gt;another secondary table with foreign keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6) Save your entries.&lt;/P&gt;&lt;P&gt;A dialog box appears in which you have to assign the lock&lt;/P&gt;&lt;P&gt;object a development class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7) You can define whether the function modules generated from&lt;/P&gt;&lt;P&gt;the lock object should be RFC-enabled on the Attributes tab&lt;/P&gt;&lt;P&gt;page. If you set the Allow RFC flag, the generated function&lt;/P&gt;&lt;P&gt;modules can be called from within another system with Remote&lt;/P&gt;&lt;P&gt;Function Call. If you permit Remote Function Calls for an&lt;/P&gt;&lt;P&gt;existing lock object, you must ensure that the generated&lt;/P&gt;&lt;P&gt;function modules are called from within an ABAP program with&lt;/P&gt;&lt;P&gt;parameters appropriate for the type. You should therefore check&lt;/P&gt;&lt;P&gt;all programs that use the associated function modules before&lt;/P&gt;&lt;P&gt;activating the lock object with the new option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; Choose Activate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if u sefull&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Dec 2007 07:54:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-06T07:54:09Z</dc:date>
    <item>
      <title>Lock objects??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3131850#M744017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is lock objects ?? Can anyone give me explanation..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 07:35:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3131850#M744017</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-06T07:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: Lock objects??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3131851#M744018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check this..&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="2720485"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 07:39:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3131851#M744018</guid>
      <dc:creator>former_member188829</dc:creator>
      <dc:date>2007-12-06T07:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Lock objects??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3131852#M744019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;Lock objects&amp;lt;/b&amp;gt; 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;You have to use these function module in your program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Maha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 07:49:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3131852#M744019</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-06T07:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Lock objects??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3131853#M744020</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;Lock object concept&lt;/P&gt;&lt;P&gt;Lock modes&lt;/P&gt;&lt;P&gt;Creating a lock object (example)&lt;/P&gt;&lt;P&gt;Lock object sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP data dictionary provides you with a locking mechanism to synchronize simultaneous data access by different users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock objects are created in SE11.&lt;/P&gt;&lt;P&gt;Customer lock objects must begin with EY or EZ .&lt;/P&gt;&lt;P&gt;Three possible lock modes exist for lock objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock Mode&lt;/P&gt;&lt;P&gt;Lock mode E: This sets a lock for changing data for single user. This lock can be accumulated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock mode X: This mode is used like mode E for changing data. The only technical difference from mode E is that the respective lock does not allow accumulation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock mode S: This mode ensures that data displayed in your program cannot be changed by other users during the entire display time. Here you do not want to change the data yourself (allows read only access for data).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating Lock object&lt;/P&gt;&lt;P&gt;SE11&lt;/P&gt;&lt;P&gt;1)Enter lock object name beginning with EY or EZ&lt;/P&gt;&lt;P&gt;and hit create.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)Enter table names containing data records that should be locked and the lock mode.&lt;/P&gt;&lt;P&gt;Enter short text /tbale/lockmode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) The primary keys of the specified tables are automatically selected as lock parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It automatically selects the primary key for the selected table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To set a lock in the application program&lt;/P&gt;&lt;P&gt;call a function module ENQUEUE_&amp;lt;LOCK_OBJECT&amp;gt;.&lt;/P&gt;&lt;P&gt;For our example, it would be ENQUEUE_EZMARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To release the lock in the application program&lt;/P&gt;&lt;P&gt;call a function module DEQUEUE_&amp;lt;LOCK_OBJECT&amp;gt;.&lt;/P&gt;&lt;P&gt;For our example, it would be DEQUEUE_EZMARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer the code executed by user (say abap1) for&lt;/P&gt;&lt;P&gt;matnr = &amp;#146;000000000000000012&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock Objects are used to synchronize access to the same data by more than one user. Function modules that can be used in application programs are generated from the definition of a lock object in the ABAP Dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The R/3 System synchronizes simultaneous access of several users to the same data records with a lock mechanism. When interactive transactions are programmed, locks are set and released by calling function modules .These function modules are automatically generated from the definition of lock objects in the ABAP Dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structure of a Lock Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The tables in which data records should be locked with a lock request are defined in a lock object together with their key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When tables are selected, one table (the primary table) is first selected. Further tables (secondary tables) can also be added using foreign key relationships.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock Arguments&lt;/P&gt;&lt;P&gt;The lock argument of a table in the lock object consists of the key fields of the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The lock argument fields of a lock object are used as input parameters in the function modules for setting and removing locks generated from the lock object definition. When these function modules are called, the table rows to be locked or&lt;/P&gt;&lt;P&gt;unlocked are specified by defining certain values in these fields.These values can also be generic. The lock argument fields therefore define which subset of the table rows should be locked&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Data Dictionary/ Lock Objects&lt;/P&gt;&lt;P&gt;The simplest case of a lock object consists of exactly one table and the lock argument of the table is the primary key of this table. Several tables can also be included in a lock object. A lock request therefore can lock an entire logical&lt;/P&gt;&lt;P&gt;object, and not only a record of a table. Such a logical object can be for example a document comprising an entry in a header table and N entries in a positiontable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lock Mode&lt;/P&gt;&lt;P&gt;The lock mode controls whether several users can access data records at the same time. The lock mode can be assigned separately for each table in the lock object. When the lock is set, the corresponding lock entry is stored in the&lt;/P&gt;&lt;P&gt;lock table of the system for each table. Access by more than one user can be synchronized in the&lt;/P&gt;&lt;P&gt;following ways:&lt;/P&gt;&lt;P&gt;Exclusive lock: The locked data can only be displayed or&lt;/P&gt;&lt;P&gt;edited by a single user. A request for another exclusive lock&lt;/P&gt;&lt;P&gt;or for a&lt;/P&gt;&lt;P&gt;shared lock is rejected.&lt;/P&gt;&lt;P&gt;Shared lock: More than one user can access the locked data&lt;/P&gt;&lt;P&gt;at the same time in display mode. A request for another&lt;/P&gt;&lt;P&gt;shared lock is accepted, even if it comes from another user. An exclusive lock&lt;/P&gt;&lt;P&gt;is rejected. Exclusive but not cumulative: Exclusive locks can be requested&lt;/P&gt;&lt;P&gt;several times from the same transaction and are processed&lt;/P&gt;&lt;P&gt;successively. In contrast, exclusive but not cumulative locks&lt;/P&gt;&lt;P&gt;can be called only once from the same transaction. All other&lt;/P&gt;&lt;P&gt;lock requests are rejected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Select object type Lock object in the initial screen of the ABAP Dictionary, enter an object name and choose Create. The name of a lock object should begin with an E (Enqueue).The maintenance screen for lock objects is displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Enter an explanatory short text in the field Short text. You can then use the short text to find the lock object at a later time, for example with the R/3 Repository Information System. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Enter the name of the primary table of the lock object. All other tables in the lock object must be linked with the primary table using foreign keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Select the lock mode of the primary table in the field below it The lock mode is used as the default value for the corresponding parameters of the function modules generated from the lock object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) Choose Add if you want to lock records in more than one&lt;/P&gt;&lt;P&gt;table with the lock object. A list of all the tables linked with the primary table using valid foreign keys is displayed. Select the appropriate table. The lock&lt;/P&gt;&lt;P&gt;mode of the primary table is copied as lock mode. You can change this setting as required, for example you can assign the lock mode separately for each table.&lt;/P&gt;&lt;P&gt;Similarly, you can add a table linked with the secondary table just added with foreign keys. To do this, place the cursor on the name of the secondary table and choose Add.&lt;/P&gt;&lt;P&gt;If no lock mode is assigned to a table, no lock is set for the&lt;/P&gt;&lt;P&gt;entries in this table when the generated function modules are&lt;/P&gt;&lt;P&gt;called. You should not assign a lock mode if a secondary table&lt;/P&gt;&lt;P&gt;was only used to define a path between the primary table and&lt;/P&gt;&lt;P&gt;another secondary table with foreign keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6) Save your entries.&lt;/P&gt;&lt;P&gt;A dialog box appears in which you have to assign the lock&lt;/P&gt;&lt;P&gt;object a development class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7) You can define whether the function modules generated from&lt;/P&gt;&lt;P&gt;the lock object should be RFC-enabled on the Attributes tab&lt;/P&gt;&lt;P&gt;page. If you set the Allow RFC flag, the generated function&lt;/P&gt;&lt;P&gt;modules can be called from within another system with Remote&lt;/P&gt;&lt;P&gt;Function Call. If you permit Remote Function Calls for an&lt;/P&gt;&lt;P&gt;existing lock object, you must ensure that the generated&lt;/P&gt;&lt;P&gt;function modules are called from within an ABAP program with&lt;/P&gt;&lt;P&gt;parameters appropriate for the type. You should therefore check&lt;/P&gt;&lt;P&gt;all programs that use the associated function modules before&lt;/P&gt;&lt;P&gt;activating the lock object with the new option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; Choose Activate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if u sefull&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 07:54:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3131853#M744020</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-06T07:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Lock objects??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3131854#M744021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A repository object defined in the ABAP Dictionary that serves as the basis for SAP locks. Linked database tables to which a common lock is to be applied are specified in a lock object using foreign key relationships. When a lock object is created, two lock function modules are automatically generated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Special function module for setting and removing SAP locks. To create a lock object, a function module with the prefix ENQUEUE_ is created to set the lock and a function module with the prefix DEQUEUE_ is created to remove the lock. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A lock object is a virtual link of several SAP tables which is used to synchronize simultaneous access by two users to the same set of data ( SAP lock concept).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Locks are requested and released in the programming of online transactions by calling certain function modules which are automatically generated from the definition of the lock objects. These lock objects must be explicitly created in the ABAP Dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To set locks, you must perform the following steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. You must define a lock object in the ABAP Dictionary. The name of the lock object should begin with E.&lt;/P&gt;&lt;P&gt;2. The function modules for requesting and releasing locks which are created automatically when the lock object is activated must be linked to the programming of the relevant online transactions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go to SE11&lt;/P&gt;&lt;P&gt;select Lock object&lt;/P&gt;&lt;P&gt;Give name it shoud start with E-&amp;gt; Create&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give Description -&amp;gt; give Primary Table name on which you want to set Lock&lt;/P&gt;&lt;P&gt;Select Mode of Lock- (Already Describe above)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use same lock name in ur module pool programing&lt;/P&gt;&lt;P&gt;in PBO &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call function ENQUEUE_Lockobject name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and before leave projram relese lock by calling function DEQUEUE_ Lockobject name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;betwwen this two FM you do your DB operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hetal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2007 07:22:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3131854#M744021</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-07T07:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Lock objects??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3131855#M744022</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;You have to use these function module in your program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will give a basic idea.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2007 07:32:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3131855#M744022</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-07T07:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Lock objects??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3131856#M744023</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;In SAP Locking Mechanism is used to restrict simultaneous updation of the same data. This is made possible with the help of Lock Objects. A list of key fields of a table are used for the same thus forming Lock Argument. This can also contain fields of more than one table, through Foreign Key relation. They are used in Function Modules when they are programmed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are different types of locks.&lt;/P&gt;&lt;P&gt;1. Shared lock&lt;/P&gt;&lt;P&gt;2. Exclusive lock&lt;/P&gt;&lt;P&gt;3. Exclusive but not cumulative lock&lt;/P&gt;&lt;P&gt;4. Optimistic lock&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;For further information you can refer to the links given below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/7b/f9813712f7434be10000009b38f8cf/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/7b/f9813712f7434be10000009b38f8cf/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!!!&lt;/P&gt;&lt;P&gt;Rajesh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S: Kindly Award points if found useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2007 13:06:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3131856#M744023</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-07T13:06:06Z</dc:date>
    </item>
  </channel>
</rss>

