<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/8352689#M1640231</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;What is the table that you will be updating with the details. If you are using a custom table, then please go for a lock object. If any update happens for that table, it automatically throws the error message. It does not require any validation. If it is an standard table, please check if there is an lock object already existing. If so, then make use of that. Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Senthil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Nov 2011 08:46:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-11-16T08:46:39Z</dc:date>
    <item>
      <title>Lock Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/8352687#M1640229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have athe following requirement kindly help me to solve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If 2 users are trying to use the same milestone at the same time in different Sale order and when the user 1 has saved the particular milestone and when the 2nd user tries to save it , i should pop up an error that the milestone is already used. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is i dont know where to get the milestone number as it will not be updated in any table before the SO is saved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should pop up the error before i save the particular SO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could any one provide me a solution on how to get the milestone number or any solution is there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 07:28:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/8352687#M1640229</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-16T07:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/8352688#M1640230</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;You can create a custom table called ZCHECK_LOCK with three fields 'MILESTONE_NO', 'LOCKED' and 'USER', where MILESTONE_NO would be of type of the milestone number you are using, 'LOCKED' would be of type CHAR1 and USER would be of type SY_UNAME. &lt;/P&gt;&lt;P&gt;Now say you are user 1 and you have entered the transaction and using a milestone number, then in the corresponding PAI of the screen where the milestone number is being used, make a select on the table ZCHECK_LOCK with the milestone number that you are using. If sy-subrc is 4, then insert a record in this table where MILESTONE_NO is the milestone number you are using and LOCKED = 'X', user name would be your ID. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now another user say user2 enters the transaction. He enters the same milestone number that you are using. As soon as he enters, the PAI event is triggered, where a select is being made on table ZCHECK_LOCK. The sy-subrc returned is 0 which means that someone is already using this number. So a message would be popped up stating that 'Milestone number 'XXXXXX' is locked under user 'YYYY'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you save the sales order or come out of it, then you need to delete the entry from ZCHECK_LOCK, as you job is done and the number is free to be used by another user. So now after you have left the transaction, if user 2 again tries entering the number, he would get sy-subrc 4, and a record would be created under his ID. He would be able to use it and thereby block teh number for others.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 07:54:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/8352688#M1640230</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-16T07:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/8352689#M1640231</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;What is the table that you will be updating with the details. If you are using a custom table, then please go for a lock object. If any update happens for that table, it automatically throws the error message. It does not require any validation. If it is an standard table, please check if there is an lock object already existing. If so, then make use of that. Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Senthil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 08:46:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/8352689#M1640231</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-16T08:46:39Z</dc:date>
    </item>
  </channel>
</rss>

