<?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/3705513#M892212</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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_nw04/helpdata/en/cf/21eef3446011d189700000e8322d00/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eef3446011d189700000e8322d00/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do reward if helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Apr 2008 08:32:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-17T08:32:36Z</dc:date>
    <item>
      <title>Lock objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3705511#M892210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;wat are lock object? how to create it?&lt;/P&gt;&lt;P&gt;and how to use it ? can any one plz explain in step wise &lt;/P&gt;&lt;P&gt;plz..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 08:28:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3705511#M892210</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T08:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Lock objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3705512#M892211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read Lock(Shared Locked)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&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;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Write Lock(exclusive lock)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&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;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Enhanced write lock (exclusive lock without cumulating)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&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;P&gt;&lt;/P&gt;&lt;P&gt;Here is a Link with good example&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="3685728"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look the following Links for additionl info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/c2/2d7037ecc92a7ee10000009b38f8cf/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/c2/2d7037ecc92a7ee10000009b38f8cf/content.htm&lt;/A&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;A href="http://articles.techrepublic.com.com/5100-6329_11-5066352.html" target="test_blank"&gt;http://articles.techrepublic.com.com/5100-6329_11-5066352.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this Helps&lt;/P&gt;&lt;P&gt;Please reward points.. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 08:32:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3705512#M892211</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T08:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Lock objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3705513#M892212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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_nw04/helpdata/en/cf/21eef3446011d189700000e8322d00/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eef3446011d189700000e8322d00/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do reward if helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 08:32:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3705513#M892212</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T08:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Lock objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3705514#M892213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;PRE&gt;&lt;CODE&gt;EPORT ZLOCK_UNLOCK
MESSAGE-ID ZBDC.
 
TABLES ZSTUD.
 
DATA text(8) TYPE c.
 
CALL SCREEN 100.
 
&amp;amp;---------------------------------------------------------------------
*&amp;amp; Module USER_COMMAND_0100 INPUT
&amp;amp;---------------------------------------------------------------------
 
text 
----------------------------------------------------------------------
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'SELECT'.
SELECT SINGLE * FROM ZSTUD WHERE ROLLNO = ZSTUD-ROLLNO.
MESSAGE i004 WITH 'SY-SUBRC:' sy-subrc.
 
WHEN 'EXIT'.
LEAVE PROGRAM.
 
WHEN 'ENQUEUE'.
CALL FUNCTION 'ENQUEUE_EZLOCK1'
EXPORTING
MODE_ZSTUD = 'X'
ROLLNO = ZSTUD-ROLLNO
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3.
 
CASE sy-subrc.
WHEN 0.
MESSAGE i004 WITH 'Enqueue successful'(001).
WHEN 1.
text = sy-msgv1.
MESSAGE e004 WITH 'Record already'(002) 'locked by'(003)
text.
CALL TRANSACTION 'SM12'.
WHEN 2 OR 3.
MESSAGE e004 WITH 'Error in enqueue!'(004)
'SY-SUBRC:' sy-subrc.
ENDCASE.
 
WHEN 'DEQUEUE'.
CALL FUNCTION 'DEQUEUE_EZLOCK1'
EXPORTING
MODE_ZSTUD = 'X'
ROLLNO = ZSTUD-ROLLNO
EXCEPTIONS
OTHERS = 1.
CASE sy-subrc.
WHEN 0.
MESSAGE i004 WITH 'Dequeue successful'(005).
WHEN 1.
MESSAGE e004 WITH 'Error in dequeue!'(006).
ENDCASE.
 
WHEN 'SM12'.
CALL TRANSACTION 'SM12'.
ENDCASE.
 
ENDMODULE. " USER_COMMAND_0100 INPUT
&amp;amp;---------------------------------------------------------------------
*&amp;amp; Module STATUS_0100 OUTPUT
&amp;amp;---------------------------------------------------------------------
 
text 
----------------------------------------------------------------------
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'BASIC'.
 
ENDMODULE. " STATUS_0100 OUTPUT&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;Reward Points if useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 08:34:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3705514#M892213</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T08:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Lock objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3705515#M892214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Lock objects are use in SAP to avoid the inconsistency 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;&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;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=115258&amp;amp;messageID=2656474" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=115258&amp;amp;messageID=2656474&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do the following steps..&lt;/P&gt;&lt;P&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;Thanks,&lt;/P&gt;&lt;P&gt;Anon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 08:45:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/3705515#M892214</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T08:45:31Z</dc:date>
    </item>
  </channel>
</rss>

