<?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 Lock Object Creation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746740#M901464</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;Is it possible to create lock objects at runtime? if not, how do I lock tables at runtime when the table name is specified in the selection screen by the user?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tyken&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Apr 2008 07:29:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-30T07:29:19Z</dc:date>
    <item>
      <title>Lock Object Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746740#M901464</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;Is it possible to create lock objects at runtime? if not, how do I lock tables at runtime when the table name is specified in the selection screen by the user?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tyken&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Apr 2008 07:29:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746740#M901464</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-30T07:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746741#M901465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;I hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Vibha &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Apr 2008 07:34:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746741#M901465</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-30T07:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746742#M901466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;create a lock object for that table via SE11-&amp;gt;Lock object ... and call function module ENQUEUE_EZ_&amp;lt;TABLE&amp;gt; for locking and DEQUEUE_EZ_&amp;lt;TABLE&amp;gt; for unlocking the table ...&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>Wed, 30 Apr 2008 07:36:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746742#M901466</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-30T07:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746743#M901467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi tyken,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;Steps to create lock objects :&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;&lt;/P&gt;&lt;P&gt;The example is as follws:&lt;/P&gt;&lt;P&gt;&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; &lt;/P&gt;&lt;P&gt;text &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; &lt;/P&gt;&lt;P&gt;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;P&gt;&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>Wed, 30 Apr 2008 07:37:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746743#M901467</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-30T07:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746744#M901468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But you can only use these FM's if youve already created a lock object for a specific table in se11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what if the user inputs, say  ZZZTABLE1 in the selection screen, how do I lock this table if there is no lock object defined for it?&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, 30 Apr 2008 07:37:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746744#M901468</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-30T07:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746745#M901469</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 used to lock the database table while making the modifications on the database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can create your own lock objects using SE11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you create lock objects on any table system will create two function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.ENQUEUE....&lt;/P&gt;&lt;P&gt;2.DEQUEUE.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first one is used to lock the table&lt;/P&gt;&lt;P&gt;second one used to removing lock on the table.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------" /&gt;&lt;P&gt;lock Table&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; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------" /&gt;&lt;P&gt;Unlock 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;check this link :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_40b/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_40b/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_SCOPE = 1: The lock is not sent to the update program.&lt;/P&gt;&lt;P&gt; The lock is removed when the transaction is ended. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_SCOPE = 2: The lock is sent to the update program. &lt;/P&gt;&lt;P&gt;The update program is responsible for removing the lock. &lt;/P&gt;&lt;P&gt;The dialog program which requested the lock no longer has an influence on the lock behavior. &lt;/P&gt;&lt;P&gt;This is the standard setting for the ENQUEUE function module. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_SCOPE = 3: The lock is also sent to the update program. &lt;/P&gt;&lt;P&gt;The lock must be removed in both the dialog program and by the update program.&lt;/P&gt;&lt;P&gt; This is the standard setting for the ENQUEUE function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anversha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Apr 2008 07:37:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746745#M901469</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2008-04-30T07:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746746#M901470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My main question is, how do I define a lock object dynamically inside my program? Because I only get the table name from the user, and I dont want to maintain lock objects for all customized tables in the data dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tyken&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Apr 2008 07:40:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746746#M901470</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-30T07:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746747#M901471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tyken,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try the following:&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 in the table name you can pass the table name that you are getting in the selection screen. This is a dynamic 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>Wed, 30 Apr 2008 07:49:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-creation/m-p/3746747#M901471</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-30T07:49:49Z</dc:date>
    </item>
  </channel>
</rss>

