<?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 issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue/m-p/8127196#M1619003</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you leave the scope at '2' the commit work statement will delete the lock, so the second update will be done without the material being locked. Which should work fine technically, you only have the security issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My guess is that you actually &lt;EM&gt;need&lt;/EM&gt; the first update to be complete before you can execute your second step. If that is the case, then you have no other logical option then to wait the 2/3 minutes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Aug 2011 08:33:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-08-17T08:33:45Z</dc:date>
    <item>
      <title>Lock issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue/m-p/8127191#M1618998</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;I am working on a change master material workflow, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first i am trying to lock my Engineering change number and then the material, below the code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'ENQUEUE_ECAENRE' &lt;/P&gt;&lt;P&gt;        EXPORTING &lt;/P&gt;&lt;P&gt;          mode_aenr      = 'E' &lt;/P&gt;&lt;P&gt;          mandt          = sy-mandt &lt;/P&gt;&lt;P&gt;          aennr          = AENNR &lt;/P&gt;&lt;P&gt;          x_aennr        = ' ' &lt;/P&gt;&lt;P&gt;          _scope         = '2' &lt;/P&gt;&lt;P&gt;          _wait          = ' ' &lt;/P&gt;&lt;P&gt;          _collect       = ' ' &lt;/P&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;if sy-sybrc = 0. &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ENQUEUE_EMMARAE' &lt;/P&gt;&lt;P&gt;        EXPORTING &lt;/P&gt;&lt;P&gt;          mode_mara      = 'E' &lt;/P&gt;&lt;P&gt;          mandt          = sy-mandt &lt;/P&gt;&lt;P&gt;          matnr          = lv_material &lt;/P&gt;&lt;P&gt;          x_matnr        = ' ' &lt;/P&gt;&lt;P&gt;          _scope         = '2' &lt;/P&gt;&lt;P&gt;          _wait          = ' ' &lt;/P&gt;&lt;P&gt;          _collect       = ' ' &lt;/P&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-sybrc = 0. &lt;/P&gt;&lt;P&gt;here i am updating my revision level of the material. after the update i am using commit work and wait (to wait till the updates are completed) &lt;/P&gt;&lt;P&gt;endif. &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;once my update is done i am releasing the locks. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DEQUEUE_EMMARAE' &lt;/P&gt;&lt;P&gt;        EXPORTING &lt;/P&gt;&lt;P&gt;          mode_mara = 'E' &lt;/P&gt;&lt;P&gt;          mandt     = sy-mandt &lt;/P&gt;&lt;P&gt;          matnr     = lv_material &lt;/P&gt;&lt;P&gt;          x_matnr   = ' ' &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;      CALL FUNCTION 'DEQUEUE_ECAENRE' &lt;/P&gt;&lt;P&gt;        EXPORTING &lt;/P&gt;&lt;P&gt;          mode_aenr = 'E' &lt;/P&gt;&lt;P&gt;          mandt     = sy-mandt &lt;/P&gt;&lt;P&gt;          aennr     = AENNR &lt;/P&gt;&lt;P&gt;          x_aennr   = ' ' &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;All the above code is executed in one step. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i am trying to lock my material one more time, i.e. in next subsequent step, the lock is getting failed. to resolve this i am current waiting for 2-3 min and executing the same step again , this time the locking is successful. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can any one tell me why is this happening, and why the immediate locking is not successful even after i used commit work and wait.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 07:12:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue/m-p/8127191#M1618998</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-17T07:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Lock issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue/m-p/8127192#M1618999</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;the system might need some time to unlock. Either because updates are done in parallel processes or any other reason. If you need to lock the same material again, then you can build a loop around the lock, something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 300 TIMES.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION &amp;lt;enqueue&amp;gt;.&lt;/P&gt;&lt;P&gt;  IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;  WAIT UP TO 1 SECONDS.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will wait max. five minutes for the locks to be removed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: RobbdB on Aug 17, 2011 9:33 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: RobbdB on Aug 17, 2011 9:33 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 07:33:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue/m-p/8127192#M1618999</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-17T07:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Lock issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue/m-p/8127193#M1619000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As i told that i am currently waiting for 2-3 if lock is not successful, i am actually implementing the same logic as your do loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 07:36:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue/m-p/8127193#M1619000</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-17T07:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Lock issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue/m-p/8127194#M1619001</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;maybe you should change your lock concept: do not unlock the material after the COMMIT WORK if you need to lock it a second time. Set the _SCOPE parameter to '1' and unlock manually after you are done with the material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 08:01:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue/m-p/8127194#M1619001</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-17T08:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Lock issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue/m-p/8127195#M1619002</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;Here i have to tell you one more thing, i haven't tried using scope as 1 but i tried the rest as you said with scope as 2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;step1: i locked it, &lt;/P&gt;&lt;P&gt;step2: i performed my first update &lt;/P&gt;&lt;P&gt;step3: performed my second update (here i cant combine my first updated and second update as i have some preconditions to validate in my workflow) &lt;/P&gt;&lt;P&gt;step4: unlocking &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here, the function module responsible for the second update is actually returning zero, indicating update is successful but the data is not getting updated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 08:14:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue/m-p/8127195#M1619002</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-17T08:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Lock issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue/m-p/8127196#M1619003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you leave the scope at '2' the commit work statement will delete the lock, so the second update will be done without the material being locked. Which should work fine technically, you only have the security issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My guess is that you actually &lt;EM&gt;need&lt;/EM&gt; the first update to be complete before you can execute your second step. If that is the case, then you have no other logical option then to wait the 2/3 minutes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 08:33:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue/m-p/8127196#M1619003</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-17T08:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Lock issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue/m-p/8127197#M1619004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Roy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect the problem might be with enque workprocess, but not sure&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 09:20:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-issue/m-p/8127197#M1619004</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-17T09:20:24Z</dc:date>
    </item>
  </channel>
</rss>

