<?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: Delivery Document Lock Issue in Z Program using BAPI(s) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282192#M1633937</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These documents are seperate objects but are interlinked. i.e I can see in the Document Flow for Service Order, which is the Service Notification and Outbound Delivery for the Material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, If I'm in change mode in the Outbound Delivery, I cannot go into the change mode of the Service Order. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, we are using BAPI_TRANSACTION_COMMIT after each BAPI in the Program. We have used the Wait Statement in all BAPIs for the Service Notification. These BAPI(s) are before the IW32 BDC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am copying code from one of the commit BAPI(s)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;                EXPORTING&lt;/P&gt;&lt;P&gt;                  wait = c_x.&lt;/P&gt;&lt;P&gt;              WAIT UP TO 1 SECONDS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed in the Outbound Delivery BAPI(s) (two of them) don't have the wait in the BAPI_TRANSACTION_COMMIT. Hence I though if we add this, could this resolve the issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Service Order gets updated last through BDC for IW32 after all the BAPI(s) are executed for Outbound Delivery and Service Notification.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand WAIT would increase processing time, that is why I am posting this to know if we have some other solution available for such a lock issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Oct 2011 05:18:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-10-19T05:18:03Z</dc:date>
    <item>
      <title>Delivery Document Lock Issue in Z Program using BAPI(s)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282187#M1633932</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 a functional consultant posting this in ABAP forum. We have developed a Z-Program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User enters the Service Order no. in this program and executes it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program then updates the following linked documents in the following sequence using BAPI(s)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Outbound Delivery&lt;/P&gt;&lt;P&gt;Service Notification&lt;/P&gt;&lt;P&gt;Service Order (This is done using BDC of IW32)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It sometimes happens that once the Program reaches the iw32 bdc, it gives error "Delivery XXXXXXXX is locked by User ID XXXXXX"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user ID being that of the person executing the transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This happens like 3 out of 100 times in the Production Server. We are unable to replicate this issue in Quality or Development Server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We believe it to be a performance issue (database updating is slow)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However Client wants us to investigate the Program and see what is possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are thinking of putting WAIT after the BAPI(s) of the Delivery Update. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions, please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 03:25:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282187#M1633932</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-19T03:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Delivery Document Lock Issue in Z Program using BAPI(s)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282188#M1633933</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;Run Tcode SM12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enter user id And delete locked delivery .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ajit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 03:55:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282188#M1633933</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-19T03:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Delivery Document Lock Issue in Z Program using BAPI(s)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282189#M1633934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Sir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is not the solution. If i Delete the update key, it would then not do the update which I require.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways, we don't have access to sm12 in production.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 04:06:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282189#M1633934</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-19T04:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Delivery Document Lock Issue in Z Program using BAPI(s)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282190#M1633935</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; Check  whenever you are getting  this  error  Delivery Document Lock Issue using BAPI  :  Transaction code  VL02N  or VL01n with same document delivery  might be  accesed by that USER  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Deepak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 04:09:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282190#M1633935</guid>
      <dc:creator>deepak_dhamat</dc:creator>
      <dc:date>2011-10-19T04:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Delivery Document Lock Issue in Z Program using BAPI(s)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282191#M1633936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nitin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First we need to understand as per the business process whether the updates for Outbound Delivery, Service Notification &amp;amp; Service Order are disjoint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Considering they are disjoint, you need to sit with the ABAPer &amp;amp; check which BAPIs are used to update these business objects. Whether the BAPI issues a COMMIT internally or should the caller explicitly call BAPI_TRANSACTION_COMMIT to commit the changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If BAPI_TRANSACTION_COMMIT has to be called, then you need to make the update synchronous by passing 'X' to the WAIT param.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;We are thinking of putting WAIT after the BAPI(s) of the Delivery Update. &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You should consider the implications of WAIT before using it. Major problem with WAIT is that it triggers a implict DB-commit &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope i'm clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 04:50:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282191#M1633936</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-10-19T04:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Delivery Document Lock Issue in Z Program using BAPI(s)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282192#M1633937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These documents are seperate objects but are interlinked. i.e I can see in the Document Flow for Service Order, which is the Service Notification and Outbound Delivery for the Material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, If I'm in change mode in the Outbound Delivery, I cannot go into the change mode of the Service Order. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, we are using BAPI_TRANSACTION_COMMIT after each BAPI in the Program. We have used the Wait Statement in all BAPIs for the Service Notification. These BAPI(s) are before the IW32 BDC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am copying code from one of the commit BAPI(s)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;                EXPORTING&lt;/P&gt;&lt;P&gt;                  wait = c_x.&lt;/P&gt;&lt;P&gt;              WAIT UP TO 1 SECONDS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed in the Outbound Delivery BAPI(s) (two of them) don't have the wait in the BAPI_TRANSACTION_COMMIT. Hence I though if we add this, could this resolve the issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Service Order gets updated last through BDC for IW32 after all the BAPI(s) are executed for Outbound Delivery and Service Notification.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand WAIT would increase processing time, that is why I am posting this to know if we have some other solution available for such a lock issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 05:18:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282192#M1633937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-19T05:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Delivery Document Lock Issue in Z Program using BAPI(s)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282193#M1633938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nitin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry but i'm confused &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First you say, &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;I am copying code from one of the commit BAPI(s)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = c_x.
WAIT UP TO 1 SECONDS.&lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;I noticed in the Outbound Delivery BAPI(s) (two of them) don't have the wait in the BAPI_TRANSACTION_COMMIT. Hence I though if we add this, could this resolve the issue?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please clarify whether your BAPI commits have 'X' passed to the WAIT param or they don't. If the latter, then try passing 'X' to the BAPI commit &amp;amp; check &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: If you've passed 'X' to the WAIT param, you need not use WAIT statement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 06:15:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282193#M1633938</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-10-19T06:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Delivery Document Lock Issue in Z Program using BAPI(s)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282194#M1633939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;- As you have identified the object which is locked by the update process, don't use a WAIT (except the COMMIT WORK/BAPI_TRANSACTION_COMMIT with WAIT option) but try to lock yourself the delivery after the BAPI (look via SM12 or in the error message to get the correct object to lock) perform a loop (like DO/ENQUEUE_EVVBLKE/ENDDO) until you are able to get the lock on the delivery, then release it (DEQUEUE_EVVBLKE) and call your IW32 BDC. In most case the lock will be immediate, so not much delay.&lt;/P&gt;&lt;P&gt;- You could also try to use BAPI_ALM_ORDER_MAINTAIN and not a BDC on IW32. As the CALL TRANSACTION (using bdc) create a new internal session, it don't share the same LUW than the BAPIs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 06:35:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delivery-document-lock-issue-in-z-program-using-bapi-s/m-p/8282194#M1633939</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2011-10-19T06:35:46Z</dc:date>
    </item>
  </channel>
</rss>

