<?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: Cannot cumulate lock within update task in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116938#M107725</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;I tried commit work in the FM. It caused update termination in the update task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MF&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jan 2006 13:11:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-01-19T13:11:47Z</dc:date>
    <item>
      <title>Cannot cumulate lock within update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116936#M107723</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 writing a BAPI to update several materials asynchronously.&lt;/P&gt;&lt;P&gt;1. The BAPI will lock those materials for update by ENQUEUE_EMMARAE with scope 2&lt;/P&gt;&lt;P&gt;2. Calls another function module IN UPDATE TASK, which calls BAPI_MATERIAL_SAVEDATA several times to update those materials.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the BAPI_MATERIAL_SAVEDATA fails to accumulate the lock on EMMARAE and rejects the changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BAPI is to return without waiting for the material changes, but block other change attempts in the mean time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a work around, I tried to release the lock in the FM before locking again, but it could not be done by DEQUEUE_ALL nor DEQUEUE_EMMARAE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;MF&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2006 15:28:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116936#M107723</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-18T15:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot cumulate lock within update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116937#M107724</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 lock should automatically be released after commit work, so you couldn't call several times the BAPI BAPI_MATERIAL_SAVEDATA without to call a commit for every call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2006 01:33:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116937#M107724</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-19T01:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot cumulate lock within update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116938#M107725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;I tried commit work in the FM. It caused update termination in the update task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MF&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2006 13:11:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116938#M107725</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-19T13:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot cumulate lock within update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116939#M107726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI M Fung,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Write COMMIT&lt;/P&gt;&lt;P&gt;   and Dequeue for unlocking&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  (in the main program, not in the update FM)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  (this will not give error)&lt;/P&gt;&lt;P&gt;  (commit in update FM is not allowed at run time)&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;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2006 13:46:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116939#M107726</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-19T13:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot cumulate lock within update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116940#M107727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit M,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand the commit to trigger the update FM and then dequeue for the FM to acquire the lock again. There is a small risk it may be lost to another process during the short release-and-lock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there no other way to keep the original lock throughout ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;MF&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2006 14:35:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116940#M107727</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-19T14:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot cumulate lock within update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116941#M107728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Lets take this sequence&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   a) program logic&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;   b) enqueue&lt;/P&gt;&lt;P&gt;      update FM&lt;/P&gt;&lt;P&gt;      Commit Work and Wait&lt;/P&gt;&lt;P&gt;      dequeu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. In above,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   all the 4 statements in B&lt;/P&gt;&lt;P&gt;   are executed immediately in sequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. When update FM is called,&lt;/P&gt;&lt;P&gt;   it does not execute immediate.&lt;/P&gt;&lt;P&gt;   However,since the immediate next&lt;/P&gt;&lt;P&gt;   statment is commit work and WAIT,&lt;/P&gt;&lt;P&gt;   the update FM will execute (immediate now)&lt;/P&gt;&lt;P&gt;   and after completion,&lt;/P&gt;&lt;P&gt;   dequeu will be exectued.&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;4. I think this is the most shortest span&lt;/P&gt;&lt;P&gt;   of time, in which u won't have any problem.&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;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2006 14:43:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116941#M107728</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-19T14:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot cumulate lock within update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116942#M107729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit m,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me see if i am getting this right.&lt;/P&gt;&lt;P&gt;When the update FM executes (in 3), the lock is held by the (1b) enqueue. The FM calls BAPI_MATERIAL_SAVEDATA, which tries to lock again and make the actual changes. Somehow, BAPI_MATERIAL_SAVEDATA fails to cumulate the lock here due to foreign lock. This is within the update FM due to 'commit and wait' before the 'dequeue'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many many thanks,&lt;/P&gt;&lt;P&gt;MF&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2006 15:36:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116942#M107729</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-19T15:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot cumulate lock within update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116943#M107730</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;Your problem is on BAPI_MATERIAL_SAVEDATA, because you have a process in UPDATE TASK where this fm is called severel times, but you do (I understood so) one only commit to run the process in UPDATE TASK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your flow should be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI_MATERIAL_SAVEDATA&lt;/P&gt;&lt;P&gt;commit and wait&lt;/P&gt;&lt;P&gt;BAPI_MATERIAL_SAVEDATA&lt;/P&gt;&lt;P&gt;commit and wait&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this way every lock is released after running BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but you can't do a commit statament in the update process, so I believe it would be better to run the process in update task for only one BAPI  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2006 15:42:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116943#M107730</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-19T15:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot cumulate lock within update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116944#M107731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. BAPI_MATERIAL_SAVEDATA, which tries to lock again and make the actual changes&lt;/P&gt;&lt;P&gt;  If this is so, then i don't think&lt;/P&gt;&lt;P&gt;  we need to explcitly Enqueu/Deuque in our code.&lt;/P&gt;&lt;P&gt;   The FM will automatically take care of it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. FM calls BAPI_MATERIAL_SAVEDATA,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Just after this use commit work and wait !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2006 15:54:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116944#M107731</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-19T15:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot cumulate lock within update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116945#M107732</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;1. The enqueue before BAPI_MATERIAL_SAVEDATA is to ensure the change should not fail due to another change lock in progress.&lt;/P&gt;&lt;P&gt;2. The whole idea is to commit but not wait, while blocking other attempts to the same materials before the update completion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wonder if there is a way to do this with ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, many thanks for the input and discussion.&lt;/P&gt;&lt;P&gt;MF&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2006 16:25:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116945#M107732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-19T16:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot cumulate lock within update task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116946#M107733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your reply.&lt;/P&gt;&lt;P&gt;The whole purpose of the BAPI is to commit but not wait, and coordinates the master changes on several materials at the same time. If I can wait, I would have used your suggestion.&lt;/P&gt;&lt;P&gt;I split the lock and update into 2 tasks to ensure commit but no waiting. Update IN UPDATE TASK to inherit the lock. However, although the update task has ties to the lock, it is not exactly its owner, and could not acquire the lock again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I am stuck here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MF&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2006 16:50:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-cumulate-lock-within-update-task/m-p/1116946#M107733</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-19T16:50:49Z</dc:date>
    </item>
  </channel>
</rss>

