<?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 Objects in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/1197290#M130047</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 created a Ztable named zvlfa1. the fields are mandt,lifnr,name1,region,land,amount. I inserted some data also in to the table.Now in se11 I created a lock object named ezlock. In the primary table I have specified it as zvlfa1 and lock mode as exclusive,not cumulative.&lt;/P&gt;&lt;P&gt;In an se38 program I have the following code.&lt;/P&gt;&lt;P&gt;REPORT  ZLOCK_PROGRAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ENQUEUE_EZLOCK'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   MODE_ZVLFA1          = 'X'&lt;/P&gt;&lt;P&gt;   MANDT                = SY-MANDT&lt;/P&gt;&lt;P&gt;   LIFNR                = '234567'&lt;/P&gt;&lt;P&gt;   X_LIFNR              = ' '&lt;/P&gt;&lt;P&gt;   _SCOPE               = '2'&lt;/P&gt;&lt;P&gt;   _WAIT                = 'X'&lt;/P&gt;&lt;P&gt;   _COLLECT             = ' '&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FOREIGN_LOCK         = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  SYSTEM_FAILURE       = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OTHERS               = 3&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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 ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&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;CALL FUNCTION 'DEQUEUE_EZLOCK'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   MODE_ZVLFA1       = 'X'&lt;/P&gt;&lt;P&gt;   MANDT             = SY-MANDT&lt;/P&gt;&lt;P&gt;   LIFNR             = '234567'&lt;/P&gt;&lt;P&gt;   X_LIFNR           = ' '&lt;/P&gt;&lt;P&gt;   _SCOPE            = '3'&lt;/P&gt;&lt;P&gt;   _SYNCHRON         = ' '&lt;/P&gt;&lt;P&gt;   _COLLECT          = ' '&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;After I execute the program and go to se12 and select the value lifnr = 234567 and say display it gives me a short dump.Probably what could be the error ? Also one more thing when we do data transefr using call transaction or session method we do not lock standard tables then why should we lock when updating using a program ?&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;the short dump says screen not found.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;varun.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: varun sonu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Feb 2006 17:58:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-02-16T17:58:56Z</dc:date>
    <item>
      <title>Lock Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/1197286#M130043</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;Can anyone please answer me these quoestions :&lt;/P&gt;&lt;P&gt;1) Do we ever create lock objects to standard tables?&lt;/P&gt;&lt;P&gt;2) What exactly is the advantage of going to lock objects?&lt;/P&gt;&lt;P&gt;3) While creating lock objects what do we need to specify in the lock parameter tab ?  &lt;/P&gt;&lt;P&gt;4) How do I use enqueue and dequeue functions in the se38 program to lock and unlock ztable.&lt;/P&gt;&lt;P&gt;If posible please forward me a sample program using these FM's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Varun.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2006 17:35:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/1197286#M130043</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-16T17:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/1197287#M130044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Varun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can create lock object for standard tebles also,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pleae go through this sap help .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm"&amp;gt;Lock Objects&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lanka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2006 17:41:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/1197287#M130044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-16T17:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/1197288#M130045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you should always create lock object when updating a table.  This ensures that your data is consistant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sampel where I'm locking the record for finish date and plant, updating, and unlocking the record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


  data: xzcposeqnr type zcposeqnr.
  data: numeric_value(4) type n.

  clear p_seqnr.

* Apply lock to sequence control table
  call function 'ENQUEUE_EZCPOSEQNR'
       exporting
            mode_zcposeqnr = 'E'
            mandt          = sy-mandt
            pedtr          = p_pedtr
            pwwrk          = p_pwwrk
            _wait          = 'X'.

  clear xzcposeqnr.
  select single * from zcposeqnr into xzcposeqnr
                 where pedtr = p_pedtr
                   and pwwrk = p_pwwrk.
  if sy-subrc = 0.
    numeric_value = xzcposeqnr-seqnr + 1.
    xzcposeqnr-seqnr = numeric_value.
    modify zcposeqnr from xzcposeqnr.
  endif.

* Unlock table entry
  call function 'DEQUEUE_EZCPOSEQNR'
       exporting
            mode_zcposeqnr = 'E'
            mandt          = sy-mandt
            pedtr          = p_pedtr
            pwwrk          = p_pwwrk.

&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, 16 Feb 2006 17:50:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/1197288#M130045</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-02-16T17:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/1197289#M130046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The lock paramter tab, is where you defin what the key of the record is that you want to lock.  A lot of times this is also the key of the table inself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my previous example, I mentioned that I am locking on finish date and plant,  these are the fields in my lock parameters tab.&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, 16 Feb 2006 17:52:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/1197289#M130046</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-02-16T17:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/1197290#M130047</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 created a Ztable named zvlfa1. the fields are mandt,lifnr,name1,region,land,amount. I inserted some data also in to the table.Now in se11 I created a lock object named ezlock. In the primary table I have specified it as zvlfa1 and lock mode as exclusive,not cumulative.&lt;/P&gt;&lt;P&gt;In an se38 program I have the following code.&lt;/P&gt;&lt;P&gt;REPORT  ZLOCK_PROGRAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ENQUEUE_EZLOCK'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   MODE_ZVLFA1          = 'X'&lt;/P&gt;&lt;P&gt;   MANDT                = SY-MANDT&lt;/P&gt;&lt;P&gt;   LIFNR                = '234567'&lt;/P&gt;&lt;P&gt;   X_LIFNR              = ' '&lt;/P&gt;&lt;P&gt;   _SCOPE               = '2'&lt;/P&gt;&lt;P&gt;   _WAIT                = 'X'&lt;/P&gt;&lt;P&gt;   _COLLECT             = ' '&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FOREIGN_LOCK         = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  SYSTEM_FAILURE       = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OTHERS               = 3&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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 ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&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;CALL FUNCTION 'DEQUEUE_EZLOCK'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   MODE_ZVLFA1       = 'X'&lt;/P&gt;&lt;P&gt;   MANDT             = SY-MANDT&lt;/P&gt;&lt;P&gt;   LIFNR             = '234567'&lt;/P&gt;&lt;P&gt;   X_LIFNR           = ' '&lt;/P&gt;&lt;P&gt;   _SCOPE            = '3'&lt;/P&gt;&lt;P&gt;   _SYNCHRON         = ' '&lt;/P&gt;&lt;P&gt;   _COLLECT          = ' '&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;After I execute the program and go to se12 and select the value lifnr = 234567 and say display it gives me a short dump.Probably what could be the error ? Also one more thing when we do data transefr using call transaction or session method we do not lock standard tables then why should we lock when updating using a program ?&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;the short dump says screen not found.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;varun.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: varun sonu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2006 17:58:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/1197290#M130047</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-16T17:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/1197291#M130048</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;Forget about my previous query. Say If I lock a record using enqueue FM  before I update that, Is there any way to ckeck that it has been locked ? How do I know That it has been locked ?&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;Varun.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2006 18:11:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/1197291#M130048</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-16T18:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/1197292#M130049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If sy-subrc  = 0 after the call, then you have successfully achieved the lock, if sy-subrc &amp;lt;&amp;gt; 0, then you have not and someone else is probably locking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regard,s&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2006 18:19:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects/m-p/1197292#M130049</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-02-16T18:19:00Z</dc:date>
    </item>
  </channel>
</rss>

