<?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 concept in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-concept/m-p/3135574#M745022</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi peers,&lt;/P&gt;&lt;P&gt;what does the _scope parameter specify in the enque&amp;lt;xxxx&amp;gt; and dequeue&amp;lt;xxxxx&amp;gt; function modules in locking concept.  what does _scope = '3' mean.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Dec 2007 09:33:03 GMT</pubDate>
    <dc:creator>former_member188594</dc:creator>
    <dc:date>2007-12-06T09:33:03Z</dc:date>
    <item>
      <title>lock concept</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-concept/m-p/3135574#M745022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi peers,&lt;/P&gt;&lt;P&gt;what does the _scope parameter specify in the enque&amp;lt;xxxx&amp;gt; and dequeue&amp;lt;xxxxx&amp;gt; function modules in locking concept.  what does _scope = '3' mean.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 09:33:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-concept/m-p/3135574#M745022</guid>
      <dc:creator>former_member188594</dc:creator>
      <dc:date>2007-12-06T09:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: lock concept</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-concept/m-p/3135575#M745023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi csr,&lt;/P&gt;&lt;P&gt;  im not sure, upto my knowledge this is the range that is for a particular time period it will be locked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 09:39:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-concept/m-p/3135575#M745023</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-06T09:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: lock concept</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-concept/m-p/3135576#M745024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Parameters for Passing Locks to the Update Program&lt;/P&gt;&lt;P&gt;A lock is generally removed at the end of the transaction or when the corresponding DEQUEUE function module is called. However, this is not the case if the transaction has called update routines. In this case, a parameter must check that the lock has been removed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter _SCOPE controls how the lock or lock release is passed to the update program (see The Owner Concept for Locks). You have the following options:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        _SCOPE = 1: Locks or lock releases are not passed to the update program. The lock is removed when the transaction is ended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        _SCOPE = 2: The lock or lock release is passed to the update program. The update program is responsible for removing the lock. The interactive program with which the lock was requested no longer has an influence on the lock behavior. This is the standard setting for the ENQUEUE function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        _SCOPE = 3: The lock or lock release is also passed to the update program. The lock must be removed in both the interactive program and in the update program. This is the standard setting for the DEQUEUE function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Function Modules for Lock Requests &lt;/P&gt;&lt;P&gt;Activating a lock object in the ABAP Dictionary automatically creates function modules for setting (ENQUEUE_&amp;lt;lock object name&amp;gt;) and releasing (DEQUEUE_&amp;lt;lock object name&amp;gt;) locks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The generated function modules are automatically assigned to function groups. You should not change these function modules and their assignment to function groups since the function modules are generated again each time the lock object is activated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Never transport the function groups, which contain the automatically generated function modules. The generated function modules of a lock object could reside in a different function group in the target system. Always transport the lock objects. When a lock object is activated in the target system, the function modules are generated again and correctly assigned to function groups.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters of the Function Modules&lt;/P&gt;&lt;P&gt;Field Names of the Lock Object&lt;/P&gt;&lt;P&gt;The keys to be locked must be passed here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A further parameter X_&amp;lt;field&amp;gt; that defines the lock behavior when the initial value is passed exists for every lock field &amp;lt;field&amp;gt;. If the initial value is assigned to &amp;lt;field&amp;gt; and X_&amp;lt;field&amp;gt;, then a generic lock is initialized with respect to &amp;lt;field&amp;gt;. If &amp;lt;field&amp;gt; is assigned the initial value and X_&amp;lt;field&amp;gt; is defined as X, the lock is set with exactly the initial value of &amp;lt;field&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters for Passing Locks to the Update Program&lt;/P&gt;&lt;P&gt;A lock is generally removed at the end of the transaction or when the corresponding DEQUEUE function module is called. However, this is not the case if the transaction has called update routines. In this case, a parameter must check that the lock has been removed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter _SCOPE controls how the lock or lock release is passed to the update program (see The Owner Concept for Locks). You have the following options:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        _SCOPE = 1: Locks or lock releases are not passed to the update program. The lock is removed when the transaction is ended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        _SCOPE = 2: The lock or lock release is passed to the update program. The update program is responsible for removing the lock. The interactive program with which the lock was requested no longer has an influence on the lock behavior. This is the standard setting for the ENQUEUE function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        _SCOPE = 3: The lock or lock release is also passed to the update program. The lock must be removed in both the interactive program and in the update program. This is the standard setting for the DEQUEUE function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters for Lock Mode&lt;/P&gt;&lt;P&gt;A parameter MODE_&amp;lt;TAB&amp;gt; exists for each base table TAB of the lock object. The lock mode for this base table can be set dynamically with this parameter. The values allowed for this parameter are S (read lock), E (write lock), X (extended write lock), and O (optimistic lock).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The lock mode specified when the lock object for the table is created is the default value for this parameter. This default value can, however, be overridden as required when the function module is called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a lock set with a lock mode is to be removed by calling the DEQUEUE function module, this call must have the same value for the parameter MODE_&amp;lt;TAB&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Controlling Lock Transmission&lt;/P&gt;&lt;P&gt;Parameter _COLLECT controls whether the lock request or lock release should be performed directly or whether it should first be written to the local lock container. This parameter can have the following values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        Initial Value: The lock request or lock release is sent directly to the lock server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        X: The lock request or lock release is placed in the local lock container. The lock requests and lock releases collected in this lock container can then be sent to the lock server at a later time as a group by calling the function module FLUSH_ENQUEUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whenever you have lock mode X (extended write lock), locks should not be written to the local lock container if very many locks refer to the same lock table. In this case, there will be a considerable loss in performance in comparison with direct transmission of locks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Behavior for Lock Conflicts (ENQUEUE only)&lt;/P&gt;&lt;P&gt;The ENQUEUE function module also has the parameter _WAIT. This parameter determines the lock behavior when there is a lock conflict.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have the following options:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        Initial Value: If a lock attempt fails because there is a competing lock, the exception FOREIGN_LOCK is triggered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        X: If a lock attempt fails because there is a competing lock, the lock attempt is repeated after waiting for a certain time. The exception FOREIGN_LOCK is triggered only if a certain time limit has elapsed since the first lock attempt. The waiting time and the time limit are defined by profile parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Controlling Deletion of the Lock Entry (DEQUEUE only)&lt;/P&gt;&lt;P&gt;The DEQUEUE function module also has the parameter _SYNCHRON. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If X is passed, the DEQUEUE function waits until the entry has been removed from the lock table. Otherwise it is deleted asynchronously, that is, if the lock table of the system is read directly after the lock is removed, the entry in the lock table may still exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exceptions of the ENQUEUE Function Module&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        FOREIGN_LOCK&amp;#146;: A competing lock already exists. You can find out the name of the user holding the lock by looking at system variable SY-MSGV1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        SYSTEM_FAILURE: This exception is triggered when the lock server reports that a problem occurred while setting the lock. In this case, the lock could not be set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the exceptions are not processed by the calling program itself, appropriate messages are issued for all exceptions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference Fields for RFC-Enabled Lock Objects&lt;/P&gt;&lt;P&gt;The type of an RFC-enabled function module must be completely defined. The parameters of the generated function module therefore have the following reference fields for RFC-enabled lock objects:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters&lt;/P&gt;&lt;P&gt; Reference fields&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;X_&amp;lt;field name&amp;gt;&lt;/P&gt;&lt;P&gt; DDENQ_LIKE-XPARFLAG&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;_WAIT&lt;/P&gt;&lt;P&gt; DDENQ_LIKE-WAITFLAG&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;_SCOPE&lt;/P&gt;&lt;P&gt; DDENQ_LIKE-SCOPE&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;_SYNCHRON&lt;/P&gt;&lt;P&gt; DDENQ_LIKE-SYNCHRON&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;P&gt;See also:&lt;/P&gt;&lt;P&gt;Example for Lock Objects&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 09:40:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-concept/m-p/3135576#M745024</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-06T09:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: lock concept</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-concept/m-p/3135577#M745025</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;I have a situation where the ENQUEUE is called with _SCOPE = '2', and the lock is passed to the&lt;/P&gt;&lt;P&gt;update requests which runs longer. Meanwhile the application requests a lock on the same object, causing a foreign_lock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the best way to over come this problem. Is it OK to change _SCOPE = '1',&lt;/P&gt;&lt;P&gt;however I am not sure if the locking control can be revoked from the update request to just the&lt;/P&gt;&lt;P&gt;program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anupama&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 05:40:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-concept/m-p/3135577#M745025</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-26T05:40:55Z</dc:date>
    </item>
  </channel>
</rss>

