<?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: Row level locking of a table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/row-level-locking-of-a-table/m-p/5948955#M1335836</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To lock the table at row level while inserting,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create a lock object using SE11 for that perticular table.&lt;/P&gt;&lt;P&gt;2. Include field names in Lock parameters. &lt;/P&gt;&lt;P&gt;    It will generate two FMs one for locking and another for unlocking.&lt;/P&gt;&lt;P&gt;3. Call the lock FM before updating the table and pass that row key value(For fields which taken in lock parameters for creating lock objects) to the exporting parameters.&lt;/P&gt;&lt;P&gt;4. Perform updation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;P Bansal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jul 2009 05:20:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-15T05:20:04Z</dc:date>
    <item>
      <title>Row level locking of a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/row-level-locking-of-a-table/m-p/5948953#M1335834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I lock the table at row level if I would use the Insert command to update the table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2009 03:05:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/row-level-locking-of-a-table/m-p/5948953#M1335834</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-15T03:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Row level locking of a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/row-level-locking-of-a-table/m-p/5948954#M1335835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. You can lock. Use generated Enqueue functioon module by passing all key field values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2009 04:08:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/row-level-locking-of-a-table/m-p/5948954#M1335835</guid>
      <dc:creator>sivasatyaprasad_yerra</dc:creator>
      <dc:date>2009-07-15T04:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Row level locking of a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/row-level-locking-of-a-table/m-p/5948955#M1335836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To lock the table at row level while inserting,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create a lock object using SE11 for that perticular table.&lt;/P&gt;&lt;P&gt;2. Include field names in Lock parameters. &lt;/P&gt;&lt;P&gt;    It will generate two FMs one for locking and another for unlocking.&lt;/P&gt;&lt;P&gt;3. Call the lock FM before updating the table and pass that row key value(For fields which taken in lock parameters for creating lock objects) to the exporting parameters.&lt;/P&gt;&lt;P&gt;4. Perform updation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;P Bansal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2009 05:20:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/row-level-locking-of-a-table/m-p/5948955#M1335836</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-15T05:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Row level locking of a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/row-level-locking-of-a-table/m-p/5948956#M1335837</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;[&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="7546964"&gt;&lt;/A&gt;]&lt;/P&gt;&lt;P&gt;&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="7827284"&gt;&lt;/A&gt;]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2009 06:00:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/row-level-locking-of-a-table/m-p/5948956#M1335837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-15T06:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Row level locking of a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/row-level-locking-of-a-table/m-p/5948957#M1335838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;create a lock object in se11 and give the table in the lock object.&lt;/P&gt;&lt;P&gt;write a program using the function modules enqueue for locking and dqueue parameters to unlock based on the logic you want by passing the key fields of the table to the function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;**********************************************************************************************&lt;/P&gt;&lt;P&gt; &lt;U&gt;Creating Lock Objects&lt;/U&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Procedure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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). &lt;/P&gt;&lt;P&gt;The maintenance screen for lock objects is displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enter an explanatory short text in the field Short text. &lt;/P&gt;&lt;P&gt;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;Enter the name of the primary table of the lock object. &lt;/P&gt;&lt;P&gt;All other tables in the lock object must be linked with the primary table using foreign keys. There are also some restrictions on the valid foreign key relationships.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select the lock mode of the primary table in the field below it. &lt;/P&gt;&lt;P&gt;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;Choose Add if you want to lock records in more than one table with the lock object. &lt;/P&gt;&lt;P&gt;A list of all the tables linked with the primary table using valid foreign keys is displayed. Select the appropriate table. The lock 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;&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If no lock mode is assigned to a table, no lock is set for the entries in this table when the generated function modules are called. You should not assign a lock mode if a secondary table was only used to define a path between the primary table and another secondary table with foreign keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save your entries. &lt;/P&gt;&lt;P&gt;A dialog box appears in which you have to assign the lock object a development class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can (optionally) exclude lock parameters (see lock objects) from the function module generation on the Lock parameter tab page. This makes sense for example if you always want to lock a parameter generically. &lt;/P&gt;&lt;P&gt;To do this, simply deselect the Weight flag for the parameter. The parameter is not taken into consideration in the generated function modules. This parameter is then always locked generically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The name of a lock parameter is usually the name of the corresponding table field. If two fields with the same name are used as lock parameters in the lock object from different tables, you must choose a new name for one of the fields in field Lock parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can define whether the function modules generated from the lock object should be RFC-enabled on the Attributes tab page. &lt;/P&gt;&lt;P&gt;If you set the Allow RFC flag, the generated function modules can be called from within another system with Remote Function Call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you permit Remote Function Calls for an existing lock object, you must ensure that the generated function modules are called from within an ABAP program with parameters appropriate for the type. You should therefore check all programs that use the associated function modules before activating the lock object with the new option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Choose .&lt;/P&gt;&lt;P&gt;Result&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you activate the lock object, the two function modules 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;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2009 06:59:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/row-level-locking-of-a-table/m-p/5948957#M1335838</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-15T06:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Row level locking of a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/row-level-locking-of-a-table/m-p/5948958#M1335839</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;i have a table zy222 with key fields EBELN, EBELP AND XBLNR and i have created a lock in SE11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i need to lock a particular record alone means, i need to give the above mentioned keyfields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'ENQUEUE_EZY222'
 EXPORTING
   MODE_ZY222           = 'E'
   MANDT                = SY-MANDT
   EBELN                = '10402402002'
   EBELP                = '10'
   XBLNR                = '123456'
*   X_EBELN              = ' '
*   X_EBELP              = ' '
*   X_XBLNR              = ' '
*   _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;&lt;/P&gt;&lt;P&gt;when i need my whole zy222 table to be locked means&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'ENQUEUE_EZY222'
 EXPORTING
   MODE_ZY222           = 'E'
   MANDT                = SY-MANDT
 EXCEPTIONS
   FOREIGN_LOCK         = 1
   SYSTEM_FAILURE       = 2
   OTHERS               = 3          .

IF sy-subrc =1.
* give error message
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;similarly for removing the lock&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'DEQUEUE_EZY222'
 EXPORTING
   MODE_ZY222       = 'E'
   MANDT            = SY-MANDT
   EBELN            = '10402402002'
   EBELP            = '10'
   XBLNR            = '123456'
*   X_EBELN          = ' '
*   X_EBELP          = ' '
*   X_XBLNR          = ' '
*   _SCOPE           = '3'
*   _SYNCHRON        = ' '
*   _COLLECT         = ' '
          .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for all records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'DEQUEUE_EZY222'
 EXPORTING
   MODE_ZY222       = 'E'
   MANDT            = SY-MANDT          .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sakthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2009 08:31:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/row-level-locking-of-a-table/m-p/5948958#M1335839</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-15T08:31:34Z</dc:date>
    </item>
  </channel>
</rss>

