<?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 Data Before Bapi in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791918#M1122330</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Step1) Lock record using FM or BAPI&lt;/P&gt;&lt;P&gt;Step2) Update the record&lt;/P&gt;&lt;P&gt;Step3) Unlock the record using FM or BAPI&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Dec 2008 11:57:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-03T11:57:19Z</dc:date>
    <item>
      <title>Lock Data Before Bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791914#M1122326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello to All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm facing the following problem :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I Have developed a z application that updates data via bapis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the user selects the appropriate data, i lock the data in order to prevent changes in the meanwhile from other users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the user saves the data i first unlock the objects and the call the bapis. As you understand, this technique has a flaw : If the bapi call is somehow delayed ( Because the system is compiling ) there is a gap between the unlock of the objects and the relock from within the bapi so probably an other user can edit the object and then the bapi will not be executed since it will not be able to lock the object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the question is : Is there a way to pass/transfer the lock to the bapi ? In theory, the lock owner is the key to success something like this but, i can't figure it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question more clearly is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Material aaa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lock material aaa from within the z application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call bapi to change material aaa without unlocking the material.&lt;/P&gt;&lt;P&gt;"Transfer" the lock to the bapi somehow by using the lock owner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any ideas ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 11:19:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791914#M1122326</guid>
      <dc:creator>laurent_fournier2</dc:creator>
      <dc:date>2008-12-03T11:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Data Before Bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791915#M1122327</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;To the best of my knowledge you can use IN UPDATE TASK and pass the value 2 or 3 to the scope then this will be farwarded to the Function module also&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For further info please go through the KEY word documentation of IN UPDATE TASK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Ramchander Rao.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 11:25:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791915#M1122327</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T11:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Data Before Bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791916#M1122328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In update task is not an option since the bapi is not an update function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 11:26:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791916#M1122328</guid>
      <dc:creator>laurent_fournier2</dc:creator>
      <dc:date>2008-12-03T11:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Data Before Bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791917#M1122329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tried also "keeping logical unit of work" when calling the bapi.. No luck !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 11:37:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791917#M1122329</guid>
      <dc:creator>laurent_fournier2</dc:creator>
      <dc:date>2008-12-03T11:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Data Before Bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791918#M1122330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Step1) Lock record using FM or BAPI&lt;/P&gt;&lt;P&gt;Step2) Update the record&lt;/P&gt;&lt;P&gt;Step3) Unlock the record using FM or BAPI&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 11:57:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791918#M1122330</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T11:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Data Before Bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791919#M1122331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess that you haven't understand my question..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Lock objects via Enqueue FM&lt;/P&gt;&lt;P&gt;2) Call bapi to change objects WITHOUT Unlocking &lt;/P&gt;&lt;P&gt;3) Unlock objects via Dequeue FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem : Bapi says that data is locked by mysefl !!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 12:02:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791919#M1122331</guid>
      <dc:creator>laurent_fournier2</dc:creator>
      <dc:date>2008-12-03T12:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Data Before Bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791920#M1122332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Laurent Fournier &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you solved this problem? could you please share with me how u solved...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;jai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 01:34:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791920#M1122332</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-17T01:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Data Before Bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791921#M1122333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Laurent,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand your requirement, but i have a question which might help you take a different approach, the steps in your program are,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Lock objects via Enqueue FM&lt;/P&gt;&lt;P&gt;Now in step 1) when you try to lock the material "AAA", let's say it is locked by another user. What do you do?...you throw a message is locked by so and so user right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So why don't you start from step (2) directly, in-case the material is locked, the BAPI would return the details in the "RETURNS" parameter, if it is not locked you can proceed with your changes.&lt;/P&gt;&lt;P&gt;2) Call bapi to change objects WITHOUT Unlocking &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Unlock objects via Dequeue FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 06:43:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791921#M1122333</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-17T06:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Data Before Bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791922#M1122334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Chen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Logic Is : &lt;/P&gt;&lt;P&gt;1) start a report and enter a material number.&lt;/P&gt;&lt;P&gt;2) lock material&lt;/P&gt;&lt;P&gt;3) display data for this material.&lt;/P&gt;&lt;P&gt;4)edit displayed data for material ( this can take time from the end user )&lt;/P&gt;&lt;P&gt;5)unlock material&lt;/P&gt;&lt;P&gt;6) execute bapi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, as you understand, your proposal cannot work here since, if i let the bapi to check and lock,&lt;/P&gt;&lt;P&gt;the user will edit the material and probably in the end he will not be able to update the material since it will be locked from another user.&lt;/P&gt;&lt;P&gt;Also, the displayed data may have changed without a lock from within the z application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Dec 2010 14:00:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-data-before-bapi/m-p/4791922#M1122334</guid>
      <dc:creator>laurent_fournier2</dc:creator>
      <dc:date>2010-12-23T14:00:25Z</dc:date>
    </item>
  </channel>
</rss>

