<?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 sequence in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-sequence/m-p/5905245#M1328873</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;for custom tables, you can create lock objects in se11 (in Ides : ESSPFLI  - for spfli table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;once you have created that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in your custom program, click on pattern, in fn module give Enqueue_ESSPFLI and it will get you the pattern&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'ENQUEUE_ESSPFLI'
  EXPORTING
*    MODE_SPFLI           = 'E'
    MANDT                = SY-MANDT
    CARRID               = 'AA'
    CONNID               = '0101'
*    X_CARRID             = ' '
*    X_CONNID             = ' '
*    _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.
 CALL FUNCTION 'DEQUEUE_ESSPFLI'
  EXPORTING
*    MODE_SPFLI       = 'E'
    MANDT                = SY-MANDT
    CARRID               = 'AA'
    CONNID               = '0101' 
*    X_CARRID         = ' '
*    X_CONNID         = ' '
*    _SCOPE           = '3'
*    _SYNCHRON        = ' '
*    _COLLECT         = ' '
           .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We lock with the primary keys (so that only that particular record is locked)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sajid&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Jul 2009 08:45:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-14T08:45:12Z</dc:date>
    <item>
      <title>Lock sequence</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-sequence/m-p/5905243#M1328871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All expert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I read a documment that metioned the sequence of update should be:&lt;/P&gt;&lt;P&gt;1. lock the related object.&lt;/P&gt;&lt;P&gt;2.select out the related data.&lt;/P&gt;&lt;P&gt;3.update the records&lt;/P&gt;&lt;P&gt;4.unlock the objects.&lt;/P&gt;&lt;P&gt;I think it correct to do it as this sequence.But my question is that how can I lock the related object before I select out them out?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shall I lock all the related table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reply and show me some sample code!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2009 08:23:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-sequence/m-p/5905243#M1328871</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-14T08:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Lock sequence</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-sequence/m-p/5905244#M1328872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;To lock an object o have to use a enqueue function.&lt;/P&gt;&lt;P&gt;For standard objects there should be a standard enqueue function module.&lt;/P&gt;&lt;P&gt;For custom objects you should create this with the transaction se11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You never should lock the table!&lt;/P&gt;&lt;P&gt;Please refer to the SAP-Help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2009 08:37:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-sequence/m-p/5905244#M1328872</guid>
      <dc:creator>Peter_Lintner</dc:creator>
      <dc:date>2009-07-14T08:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Lock sequence</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-sequence/m-p/5905245#M1328873</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;for custom tables, you can create lock objects in se11 (in Ides : ESSPFLI  - for spfli table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;once you have created that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in your custom program, click on pattern, in fn module give Enqueue_ESSPFLI and it will get you the pattern&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'ENQUEUE_ESSPFLI'
  EXPORTING
*    MODE_SPFLI           = 'E'
    MANDT                = SY-MANDT
    CARRID               = 'AA'
    CONNID               = '0101'
*    X_CARRID             = ' '
*    X_CONNID             = ' '
*    _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.
 CALL FUNCTION 'DEQUEUE_ESSPFLI'
  EXPORTING
*    MODE_SPFLI       = 'E'
    MANDT                = SY-MANDT
    CARRID               = 'AA'
    CONNID               = '0101' 
*    X_CARRID         = ' '
*    X_CONNID         = ' '
*    _SCOPE           = '3'
*    _SYNCHRON        = ' '
*    _COLLECT         = ' '
           .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We lock with the primary keys (so that only that particular record is locked)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sajid&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2009 08:45:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-sequence/m-p/5905245#M1328873</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-14T08:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Lock sequence</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-sequence/m-p/5905246#M1328874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can understand totally what your want to explain. The problem is that, before select how can you know the lock key's value?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you lock it after selection, it maybe already changed by other users just when you are selecting!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2009 08:51:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-sequence/m-p/5905246#M1328874</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-14T08:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Lock sequence</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-sequence/m-p/5905247#M1328875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Edward,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table shuld not be locked instead&lt;/P&gt;&lt;P&gt;U should lock the record of the table .That can be done by using ENQUEUE_******* Function Module.&lt;/P&gt;&lt;P&gt;U need to pass the combination of primary keys for that particular record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While locking the record if its locked by another user an exception will be triggered called foreign lock with which ur not able to lock it.&lt;/P&gt;&lt;P&gt;After doing so, chk it in tcode SM12 whether ur lock is successful or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sequence which u mentioned for locking is fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chk this thread .U will get clear idea.&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="111722"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chk this documentation too&lt;/P&gt;&lt;P&gt;Link:[Lock Objects|http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lakshman.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2009 09:02:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-sequence/m-p/5905247#M1328875</guid>
      <dc:creator>former_member209217</dc:creator>
      <dc:date>2009-07-14T09:02:27Z</dc:date>
    </item>
  </channel>
</rss>

