<?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: Testing of the Lock Object Functionality in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-of-the-lock-object-functionality/m-p/3363930#M807184</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for responding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I feel i got my answer. Just to confirm the same...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets assume that there are some other programs which are updating the same table but No Locking concept have been taken care inside those programs, then as per my understanding, all of those programs can update the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rectify me if i am wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Jan 2008 13:18:51 GMT</pubDate>
    <dc:creator>ashwani_karn</dc:creator>
    <dc:date>2008-01-22T13:18:51Z</dc:date>
    <item>
      <title>Testing of the Lock Object Functionality</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-of-the-lock-object-functionality/m-p/3363928#M807182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a Lock object on a database table. Now i am writing the code like below...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ENQUEUE_/GMC/EZHIM_TEST'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   MODE_ZRAJ_TEST1       = 'X'&lt;/P&gt;&lt;P&gt;   MANDT                 = SY-MANDT&lt;/P&gt;&lt;P&gt;   KUNNR                 = ' '&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  X_KUNNR               = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  _SCOPE                = '2'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  _WAIT                 = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  _COLLECT              = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I put a break point at sy-subrc ne 0. ( return value is 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i tried to create entries in the respective table through SE11 using another id. Its creating..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly lemme know where exactly the problem is....else lemme know whether my testing is in a wrong way...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 12:13:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-of-the-lock-object-functionality/m-p/3363928#M807182</guid>
      <dc:creator>ashwani_karn</dc:creator>
      <dc:date>2008-01-22T12:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Testing of the Lock Object Functionality</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-of-the-lock-object-functionality/m-p/3363929#M807183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whenever you set a lock you just create an entry in the lock table you are not physically locking the table. SE11 does NOT check that lock table. You can see the lock table as an application table and whenever you want to access a database table directly and make sure that you are the only one accessing the table you should try to enqueue the table and only if you can get the lock (create a lock entry in the lock table) you should change the data in that table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's why you should always use standard API's to change data in a standard table instead of directly updating it, because the API's check the locks, if you want to update directly you have to take care of the lock check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User 1 requests a lock through ENQUEUE_/GMC/EZHIM_TEST which is granted. The program now makes updates to that table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If at the same time you run a second program that would like to make changes to that table as well, this WILL BE allowed, unless you check the lock first. To do that just call ENQUEUE_/GMC/EZHIM_TEST again and if the object is already locked from another process you'll get an exception that tells you that you are not supposed to make changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 13:07:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-of-the-lock-object-functionality/m-p/3363929#M807183</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T13:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Testing of the Lock Object Functionality</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-of-the-lock-object-functionality/m-p/3363930#M807184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for responding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I feel i got my answer. Just to confirm the same...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets assume that there are some other programs which are updating the same table but No Locking concept have been taken care inside those programs, then as per my understanding, all of those programs can update the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rectify me if i am wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 13:18:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-of-the-lock-object-functionality/m-p/3363930#M807184</guid>
      <dc:creator>ashwani_karn</dc:creator>
      <dc:date>2008-01-22T13:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Testing of the Lock Object Functionality</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-of-the-lock-object-functionality/m-p/3363931#M807185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Confirmation&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 13:19:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-of-the-lock-object-functionality/m-p/3363931#M807185</guid>
      <dc:creator>ashwani_karn</dc:creator>
      <dc:date>2008-01-22T13:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Testing of the Lock Object Functionality</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-of-the-lock-object-functionality/m-p/3363932#M807186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct, if another program does not check the locks it will be able to update the table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 14:10:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-of-the-lock-object-functionality/m-p/3363932#M807186</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T14:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Testing of the Lock Object Functionality</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-of-the-lock-object-functionality/m-p/3363933#M807187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Michael....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 14:20:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-of-the-lock-object-functionality/m-p/3363933#M807187</guid>
      <dc:creator>ashwani_karn</dc:creator>
      <dc:date>2008-01-22T14:20:31Z</dc:date>
    </item>
  </channel>
</rss>

