<?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: .NET Connector BAPIs and CommitWork and Wait in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/net-connector-bapis-and-commitwork-and-wait/m-p/951099#M65210</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andreas!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe 'wrongly used' is to try a change without checking the status before. Then two processes try to get a lock on this order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would propose an explicit commit work and wait call and a loop for waiting. Restrict the loop to a fixed number, don't try to often (not more often than once a second, if there is a really long update queue, you might have to wait a minute -&amp;gt; every 5 or 10 seconds is good, too).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess you would prefer a deadlock and an information of problem by system instead of missed updates from time to time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jul 2005 11:19:47 GMT</pubDate>
    <dc:creator>christian_wohlfahrt</dc:creator>
    <dc:date>2005-07-21T11:19:47Z</dc:date>
    <item>
      <title>.NET Connector BAPIs and CommitWork and Wait</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/net-connector-bapis-and-commitwork-and-wait/m-p/951096#M65207</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 experiencing timing issues calling Bapi_Salesorder_Change immediately after executing Bapi_Salesorder_Createfromdat1 in a .NET Connector v2.0 environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bapi_Salesorder_Change returns an error that the sales order does not exist (yet) and therefore fails updating the data. I suspect transaction commit has not yet completed in the SAP system of the Bapi_Salesorder_Createfromdat1 call since this error only occurrs sporadically (s. &lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="5359"&gt;&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since there is no support for CommitAndWait in .NET Connector v2.0 (s. &lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="16948"&gt;&lt;/A&gt;) I wonder what the best implementation strategy is in this case ?!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a possibility to use a "SET UPDATE TASK LOCAL" approach from the .NET Connector ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any hints,&lt;/P&gt;&lt;P&gt;Andreas Koschinsky&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2005 20:07:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/net-connector-bapis-and-commitwork-and-wait/m-p/951096#M65207</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-20T20:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: .NET Connector BAPIs and CommitWork and Wait</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/net-connector-bapis-and-commitwork-and-wait/m-p/951097#M65208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andreas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as Reiner proposed in one of your links: copy FM bapi commit and call this z-function explicit with wait = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this won't help in all cases (normally it should!), then add a select for you new sales order in between. If this is successfull, go on - otherwise wait up to n seconds, next select...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;P&gt;P.S.: Which change can't be done in creation?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2005 05:24:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/net-connector-bapis-and-commitwork-and-wait/m-p/951097#M65208</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2005-07-21T05:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: .NET Connector BAPIs and CommitWork and Wait</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/net-connector-bapis-and-commitwork-and-wait/m-p/951098#M65209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your answer: Problem is that Reiner stated that this function has been explicitly disabled in .NET Connector 2.0 (s. &lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="16948"&gt;&lt;/A&gt;: Mr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reiner Hille-Doering "because it can - wrongly used - cause deadlocks that bring your SAP system in an unusable state" - but he did not explain what "wrongly used" means...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did some test implementations using "Bapi_Transaction_Commit"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1) DOES not work consistently, because Createfromdat1 Transaction might not be &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;completed when Change is called&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bapi_Salesorder_Createfromdat1(..) with WithOutCommit = " "&lt;/P&gt;&lt;P&gt;Bapi_Salesorder_Change()&lt;/P&gt;&lt;P&gt;Bapi_Salesorder_Change.CommitWork&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(2) DOES work consistenly in test environment&lt;/P&gt;&lt;P&gt;Bapi_Salesorder_Createfromdat1(...) with WithOutCommit = "X"&lt;/P&gt;&lt;P&gt;Bapi_Transaction_Commit("X", ...)&lt;/P&gt;&lt;P&gt;Bapi_Salesorder_Change()&lt;/P&gt;&lt;P&gt;Bapi_Salesorder_Change.CommitWork&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll probably use The "GetStatus()" wait loop, though this is not my favourite coding style &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. I am using Bapi_Salesorder_Createfromdat1 wich does not support TEXT updates for sales order positions (s. &lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="47136"&gt;&lt;/A&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2005 10:56:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/net-connector-bapis-and-commitwork-and-wait/m-p/951098#M65209</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-21T10:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: .NET Connector BAPIs and CommitWork and Wait</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/net-connector-bapis-and-commitwork-and-wait/m-p/951099#M65210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andreas!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe 'wrongly used' is to try a change without checking the status before. Then two processes try to get a lock on this order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would propose an explicit commit work and wait call and a loop for waiting. Restrict the loop to a fixed number, don't try to often (not more often than once a second, if there is a really long update queue, you might have to wait a minute -&amp;gt; every 5 or 10 seconds is good, too).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess you would prefer a deadlock and an information of problem by system instead of missed updates from time to time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2005 11:19:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/net-connector-bapis-and-commitwork-and-wait/m-p/951099#M65210</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2005-07-21T11:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: .NET Connector BAPIs and CommitWork and Wait</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/net-connector-bapis-and-commitwork-and-wait/m-p/951100#M65211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes - I have implemented this strategy now. I parse the message number of the return data structure of the Bapi_Salesorder_Change function and if "number" is "302" (which stands for "sales document not found") I retry x times with y ms to wait between the calls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A more elegant solution might be as dennis proposed (s. &lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="52896"&gt;&lt;/A&gt; - sorry posted this question twice, first in the wrong forum) but I wanted to avoid introducing a new user defined rfc function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2005 14:54:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/net-connector-bapis-and-commitwork-and-wait/m-p/951100#M65211</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-21T14:54:43Z</dc:date>
    </item>
  </channel>
</rss>

