<?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 Object Implementation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-implementation/m-p/11892315#M1961573</link>
    <description>&lt;P&gt;You very urgently need to &lt;A href="https://help.sap.com/saphelp_nwpi71/helpdata/en/47/daeac909dd3020e10000000a42189d/frameset.htm" target="_blank"&gt;read about how the locking concept works&lt;/A&gt;. It &lt;STRONG&gt;does not&lt;/STRONG&gt; prevent changes to the database. It does not work the way you think it does. &lt;/P&gt;</description>
    <pubDate>Mon, 29 Apr 2019 15:20:33 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2019-04-29T15:20:33Z</dc:date>
    <item>
      <title>Lock Object Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-implementation/m-p/11892313#M1961571</link>
      <description>&lt;P&gt;Hi Experts, &lt;/P&gt;
  &lt;P&gt;I need urgently to implement &lt;STRONG&gt;Lock object &lt;/STRONG&gt;to avoid changing of Customer ID ( customized Feld from customized DB) from different users and programs ... &lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;So to achieve this I have processed as follow: &lt;/STRONG&gt;&lt;/P&gt;
  &lt;OL&gt; 
   &lt;LI&gt;created lock object in se11&lt;/LI&gt; 
   &lt;LI&gt;gave the required Feld &lt;/LI&gt; 
   &lt;LI&gt;Call the lock function in the first Program. &lt;/LI&gt; 
  &lt;/OL&gt; 
  &lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'ENQUEUE_ZTABLE '     EXPORTING
      mode_Ztable = 'E'
      mandt               = sy-mandt
      Customer ID        = lv_Customer_ID 
*     X_Customer ID        = ' '
*     _SCOPE              = '2'
*     _WAIT               = ' '
*     _COLLECT            = ' '
    EXCEPTIONS
      foreign_lock        = 1
      system_failure      = 2
      OTHERS              = 3. &lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;4- The object has shown in T.cde SM12.&lt;/P&gt;
  &lt;P&gt;5- at the same time in the second program I have called the data depend on the locked customer_ID :&lt;/P&gt;
  &lt;UL&gt; 
   &lt;LI&gt;so calling is working &lt;/LI&gt; 
   &lt;LI&gt;now updating the data&lt;/LI&gt; 
  &lt;/UL&gt; 
  &lt;PRE&gt;&lt;CODE&gt; 
update Ztable set Ztable~Customer_ID = new_customer_id
                   where Customer_ID = lv_Customer_ID 
                                                                        &lt;/CODE&gt;&lt;/PRE&gt;
  &lt;UL&gt; 
   &lt;LI&gt; unfortunately, the record was successfully updated...&lt;/LI&gt; 
  &lt;/UL&gt;
  &lt;P&gt;so why is not blocked and nothing sopped the process to say that this customer_id is already blocked by another user.&lt;/P&gt;
  &lt;P&gt; Even by deleting it will be deleted ...&lt;/P&gt;
  &lt;P&gt;your advice to achieve my requirement will be highly appreciated..&lt;/P&gt;
  &lt;P&gt;Best Regards&lt;/P&gt;
  &lt;P&gt;Khaled&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2019 14:21:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-implementation/m-p/11892313#M1961571</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-04-29T14:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-implementation/m-p/11892314#M1961572</link>
      <description>&lt;P&gt;Try changing the &lt;A href="https://help.sap.com/doc/saphelp_nwpi71/7.1/en-US/47/daadf638793c85e10000000a42189c/content.htm?no_cache=true"&gt;scope&lt;/A&gt; and &lt;A href="https://help.sap.com/doc/saphelp_nwpi71/7.1/en-US/47/daeac909dd3020e10000000a42189d/content.htm?no_cache=true"&gt;mode&lt;/A&gt; in your call.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2019 15:16:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-implementation/m-p/11892314#M1961572</guid>
      <dc:creator>raghug</dc:creator>
      <dc:date>2019-04-29T15:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-implementation/m-p/11892315#M1961573</link>
      <description>&lt;P&gt;You very urgently need to &lt;A href="https://help.sap.com/saphelp_nwpi71/helpdata/en/47/daeac909dd3020e10000000a42189d/frameset.htm" target="_blank"&gt;read about how the locking concept works&lt;/A&gt;. It &lt;STRONG&gt;does not&lt;/STRONG&gt; prevent changes to the database. It does not work the way you think it does. &lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2019 15:20:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-implementation/m-p/11892315#M1961573</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2019-04-29T15:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-implementation/m-p/11892316#M1961574</link>
      <description>&lt;P&gt;Hi Matthew,&lt;/P&gt;&lt;P&gt;Thanks, it seems the Locking object will not serve my requirement directly, I used  this call Function  in the first/second Programs as well &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'ENQUEUE_READ'
* EXPORTING

*   GCLIENT                     = SY-MANDT

*   GNAME                       = ' '

*   GARG                        = ' '

*   GUNAME                      = SY-UNAME

*   LOCAL                       = ' '

*   FAST                        = ' '

*   GARGNOWC                    = ' '

* IMPORTING

*   NUMBER                      =

*   SUBRC                       =

  TABLES

    enq                         =  lt_seqg3

* EXCEPTIONS

*   COMMUNICATION_FAILURE       = 1

*   SYSTEM_FAILURE              = 2

*   OTHERS                      = 3

          .

IF sy-subrc &amp;lt;&amp;gt; 0.



ENDIF.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;then I will check the output table (&lt;STRONG&gt;lt_seqg3&lt;/STRONG&gt;&lt;STRONG&gt;) &lt;/STRONG&gt;first if she has any locked object which I need to call or delete then error msg. will be raised...&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;--- is there any better way to achieve this------&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;-  Could  you pls provide an example or a Link for implementation of Lock objects....&lt;/P&gt;&lt;P&gt;Best Regards.&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 10:59:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-implementation/m-p/11892316#M1961574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-05-01T10:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-implementation/m-p/11892317#M1961575</link>
      <description>&lt;P&gt;Hi Raghu,&lt;/P&gt;&lt;P&gt;Thanks for your comment,&lt;/P&gt;&lt;P&gt; Could  you pls provide an example or a Link for implementation of Lock objects&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 10:59:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-implementation/m-p/11892317#M1961575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-05-01T10:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-implementation/m-p/11892318#M1961576</link>
      <description>&lt;P&gt;Hello Khaled Al Sharbaji, &lt;/P&gt;&lt;P&gt;at first you have to create a lock object to prevent another user to change your table when you change it. It prevent more than one to change the field at same time. &lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/saphelp_nw70/7.0.31/en-US/a2/3547360f2ea61fe10000009b38f839/content.htm?no_cache=true" target="_blank"&gt;Create lock object &lt;/A&gt;&lt;/P&gt;&lt;P&gt;Or if you want to lock the table you can use CALL FUNCTION 'ENQUEUE_E_TABLE'&lt;/P&gt;&lt;P&gt;&lt;A href="https://wiki.scn.sap.com/wiki/display/Snippets/locking+and+unlocking+tables" target="_blank"&gt;Lock &amp;amp; unlock table&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Ebrahim&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 11:18:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-implementation/m-p/11892318#M1961576</guid>
      <dc:creator>former_member184158</dc:creator>
      <dc:date>2019-05-01T11:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-implementation/m-p/11892319#M1961577</link>
      <description>&lt;A href="https://answers.sap.com/users/768232/khaled1988.html"&gt;Khaled Al Sharbaji&lt;/A&gt; You have done almost everything ; you might use ENQUEUE_READ to check if there's a lock, but you may also do the same check by calling ENQUEUE_ZTABLE with MODE_ZTABLE = &lt;STRONG&gt;'V'&lt;/STRONG&gt; (cf &lt;A href="https://help.sap.com/saphelp_nw74/helpdata/en/56/2639d058ea4843ab4ada04b466951b/frameset.htm"&gt;"check" lock modes&lt;/A&gt;), that checks if one Exclusive lock is set, without setting the lock.</description>
      <pubDate>Wed, 01 May 2019 14:04:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object-implementation/m-p/11892319#M1961577</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-05-01T14:04:11Z</dc:date>
    </item>
  </channel>
</rss>

