<?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 Call BAPI_ACC_DOCUMENT_POST in parallel processing - is this possible? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522539#M1655928</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 have a dilemma of calling BAPI_ACC_DOCUMENT_POST in parallel processing and I hope someone can help me out here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, I understand that BAPI_TRANSACTION_COMMIT needs to be called after checking RETURN for successful posting message.  However, since I call BAPI_ACC_DOCUMENT_POST with STARTING NEW TASK for parallel processing, the RETURN will be collected in the RESPONSE subroutine.  Well, here is the dilemma.  Based on SAP note 675042, I can not call another FUNCTION or issue COMMIT WORK in the RESPONSE subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone encountered the same issue and had it resolved?  Any idea or this simply CAN NOT be done?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kuo-Hsiung Huang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Jan 2012 16:22:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-01-26T16:22:31Z</dc:date>
    <item>
      <title>Call BAPI_ACC_DOCUMENT_POST in parallel processing - is this possible?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522539#M1655928</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 have a dilemma of calling BAPI_ACC_DOCUMENT_POST in parallel processing and I hope someone can help me out here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, I understand that BAPI_TRANSACTION_COMMIT needs to be called after checking RETURN for successful posting message.  However, since I call BAPI_ACC_DOCUMENT_POST with STARTING NEW TASK for parallel processing, the RETURN will be collected in the RESPONSE subroutine.  Well, here is the dilemma.  Based on SAP note 675042, I can not call another FUNCTION or issue COMMIT WORK in the RESPONSE subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone encountered the same issue and had it resolved?  Any idea or this simply CAN NOT be done?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kuo-Hsiung Huang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 16:22:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522539#M1655928</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-26T16:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Call BAPI_ACC_DOCUMENT_POST in parallel processing - is this possible?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522540#M1655929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did that some time ago, if I remember correctly I wrapped the call to BAPI_ACC_DOCUMENT_POST, some long text handling and a final COMMIT WORK into a remote-enabled Z-function module and called that one STARTING NEW TASK.&lt;/P&gt;&lt;P&gt;Worked well, nice to see 15 dialog processes working hard to post your stuff &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 21:34:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522540#M1655929</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2012-01-26T21:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Call BAPI_ACC_DOCUMENT_POST in parallel processing - is this possible?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522541#M1655930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kuo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Other possibility is use ARFC technique and create your own queue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 11:32:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522541#M1655930</guid>
      <dc:creator>former_member214857</dc:creator>
      <dc:date>2012-01-27T11:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Call BAPI_ACC_DOCUMENT_POST in parallel processing - is this possible?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522542#M1655931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or:&lt;/P&gt;&lt;P&gt;have a global variable and set it to X or some flag in the return procedure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;outside the FM call, &lt;/P&gt;&lt;P&gt;wait until gv_flag = X. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then program waits till the gv_flag is set.. and you are setting this in the return module.. once it reaches the correct flag value. your next line would be the commit work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 11:57:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522542#M1655931</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-27T11:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Call BAPI_ACC_DOCUMENT_POST in parallel processing - is this possible?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522543#M1655932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kuo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you can wrap the BAPI calls in a custom RFC &amp;amp; call this RFC asynchronously as mentioned by Thomas. Also you can try using the WAIT UNTIL command &amp;amp; issue the COMMIT outside of the callback procedure. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* Call the Accounting doc posting BAPI asynchronously
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST' STARTING NEW TASK 'DOC_POST'
  PERFORMING f_read_bapiret ON END OF TASK.

***Your code which can run independent of the bapi result***

* Program waits for the callback procedure to be executed
WAIT UNTIL gv_callback = 'X'.

IF gv_error = `X`.
  CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  f_read_bapiret
*&amp;amp;---------------------------------------------------------------------*
FORM f_read_bapiret USING task_id TYPE clike.
  
* RECEIVE results from the asynch-RFC(aRFC)

* Read BAPIRET &amp;amp; check error message
  READ TABLE gt_bapiret WITH KEY type = `E`.
  IF sy-subrc = 0.
*   Set the callback flag
    gv_callback = `X`.
    gv_error = `X`.
    RETURN.
  ENDIF.

* Set the callback flag
  gv_callback = `X`.
ENDFORM.                    "f_read_bapiret&lt;/CODE&gt;&lt;/PRE&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>Fri, 27 Jan 2012 11:59:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522543#M1655932</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2012-01-27T11:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Call BAPI_ACC_DOCUMENT_POST in parallel processing - is this possible?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522544#M1655933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does this really work? At the time when GV_CALLBACK is evaluated, we are no longer in the parallel phase, so how would the process know which one of the tasks should be rolled back or commited?&lt;/P&gt;&lt;P&gt;I might be missing an important bit, then please help me &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 12:37:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522544#M1655933</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2012-01-27T12:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Call BAPI_ACC_DOCUMENT_POST in parallel processing - is this possible?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522545#M1655934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if the bapi has error but i still commit, whats the problem? any ways the doc wont be posted .. right? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but yes, if it has chained updated then yours would be a considerable case i think&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 13:30:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522545#M1655934</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-27T13:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Call BAPI_ACC_DOCUMENT_POST in parallel processing - is this possible?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522546#M1655935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all the responses!  Look like it's doable and there are options.  I will give it a try and mark this thread as answered when a positive result is achieved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kuo-Hsiung&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 14:06:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522546#M1655935</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-27T14:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Call BAPI_ACC_DOCUMENT_POST in parallel processing - is this possible?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522547#M1655936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; At the time when GV_CALLBACK is evaluated, we are no longer in the parallel phase, so how would the process know which one of the tasks should be rolled back or commited?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;DEL&gt;I suppose the OP is calling only one task(BAPI_ACC_DOCUMENT_POST) asynchronously, please correct me if i'm wrong&lt;/DEL&gt;

&lt;DEL&gt;So when the program flow reaches the WAIT UNTIL &lt;EM&gt;log_expr&lt;/EM&gt; statement (and finds the logical exp to be false) it'll wait for the execution of the call-back procedure &amp;amp; once completed it'll check the value again.&lt;/DEL&gt;

&lt;DEL&gt;To be honest, i think the use of the flag GV_CALLBACK is redundant! Once callback routines of all aRFCs(which i suppose to be one in this case) have been executed, the program resumes after the WAIT statement.&lt;/DEL&gt;

&lt;DEL&gt;Let me know if you think i'm misinterpreting something. Meanwhile let me cook-up a demo program to satiate our curiosity.&lt;/DEL&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get your point, Thomas. We're COMMIT'ing in a separate session than the one in which the aRFC was called. Theoritically(logically as well) this should not work, my bad!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Kuo: I'm pretty sure the solution involving WAIT UNTIL won't work for reasons mentioned above. Try implementing the solution proposed by TZ!&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;Cheers,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Jan 27, 2012 9:03 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 15:27:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522547#M1655936</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2012-01-27T15:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Call BAPI_ACC_DOCUMENT_POST in parallel processing - is this possible?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522548#M1655937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was assuming multiple tasks being started and running in parallel, in (available minus reserved) dialog processes...thinking that this is what our OP is up to. We will find out &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 15:38:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522548#M1655937</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2012-01-27T15:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Call BAPI_ACC_DOCUMENT_POST in parallel processing - is this possible?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522549#M1655938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you think about my previous commentt?&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>Fri, 27 Jan 2012 15:59:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522549#M1655938</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2012-01-27T15:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Call BAPI_ACC_DOCUMENT_POST in parallel processing - is this possible?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522550#M1655939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a success!  TZ's solution works perfectly.  It's easy and straight forward. Thank you, Thomas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition, I do want to thank everyone as well for all the responses.  This is truly a community that gets things done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kuo-Hsiung Huang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 17:56:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-acc-document-post-in-parallel-processing-is-this-possible/m-p/8522550#M1655939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-27T17:56:55Z</dc:date>
    </item>
  </channel>
</rss>

