<?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/1855489#M361785</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe this will come automatically if you have the exceptions uncommented and the IF statement after the ENQUEUE function call uncommented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 

.........
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.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Feb 2007 02:37:32 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2007-02-01T02:37:32Z</dc:date>
    <item>
      <title>Lock Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/1855488#M361784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SDN's&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a a lock object for a Z table, so that when the user tries to access the same record from a Z Tcode. &lt;/P&gt;&lt;P&gt;it is getting locked fine, and geting unlocked also ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but what i want to know is how do i know the user name who has locked it?&lt;/P&gt;&lt;P&gt;can i know it from the function modules ENQUEUE or DEQUEUE or is there any other way where i can know the User Name who has locked it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pratyusha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2007 02:30:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/1855488#M361784</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-01T02:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/1855489#M361785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe this will come automatically if you have the exceptions uncommented and the IF statement after the ENQUEUE function call uncommented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 

.........
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.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2007 02:37:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/1855489#M361785</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-02-01T02:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/1855490#M361786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich, Yes it is as what u said. But i gave a msg of my own saying 'Record Locked'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but now when i uncommented it, i dont get any msg, where as i can open the same in 2 diff sessions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check my part of code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Lock the transaction if the same MO is being changed else&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  loop at IT_RFQITEM into IS_RFQITEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call function 'ENQUEUE_EZ_ENQUE_RFQ'&lt;/P&gt;&lt;P&gt;     exporting&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      MODE_ZES_RFQ_ITEM       = 'E'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       MANDT                   = SY-MANDT&lt;/P&gt;&lt;P&gt;       RFQ_NO                  = IS_RFQITEM-RFQ_NO&lt;/P&gt;&lt;P&gt;       SER_NO                  = 1&lt;/P&gt;&lt;P&gt;       RFQ_LN                  = IS_RFQITEM-RFQ_LN&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      X_RFQ_NO                = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      X_SER_NO                = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      X_RFQ_LN                = ' '&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     message E138(ZSM) with 'MO is locked'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    clear : IS_RFQITEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pratyusha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2007 02:43:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/1855490#M361786</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-01T02:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/1855491#M361787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is working fine for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

....
 EXCEPTIONS
   FOREIGN_LOCK         = 1
   SYSTEM_FAILURE       = 2
   OTHERS               = 3
          .
IF sy-subrc &amp;lt;&amp;gt; 0.
  message e001(00) with sy-msgv1 ' is locking record'.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2007 02:52:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/1855491#M361787</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-02-01T02:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/1855492#M361788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rich, its working fine&lt;/P&gt;&lt;P&gt;i did a silly mistake..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Pratyusha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2007 03:12:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-object/m-p/1855492#M361788</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-01T03:12:30Z</dc:date>
    </item>
  </channel>
</rss>

