none
Called a BAPI successfully. Next step RRS feed

  • Question

  • I seem to have created an orchestration that calls a BAPI (BAPI_ACC_INVOICE_RECEIPT_POST).  I know the operation is successfull because I get the response: Document posted successfully in the response.

     

    However, when I search for the newly created document in the SAP GUI I cannot find it.

     

    I'm thinking that I need to call some sort of commit operation but I'm not sure how to accomplish this.  Can someone please point me in the right direction?

     

    Thanks.

    Wednesday, January 23, 2008 7:08 PM

Answers

  • You're right - you should call BAPI_TRANSACTION_COMMIT to commit the changes you make to the SAP backend. When you call a BAPI from outside SAP, you need to call BAPI_TRANSACTION_COMMIT to commit the changes you make after the BAPI call succeeds. Similarly, you'd be calling BAPI_TRANSACTION_ROLLBACK in case the BAPI call fails. I Hope this helps Smile

    Wednesday, January 23, 2008 9:10 PM

All replies

  • You're right - you should call BAPI_TRANSACTION_COMMIT to commit the changes you make to the SAP backend. When you call a BAPI from outside SAP, you need to call BAPI_TRANSACTION_COMMIT to commit the changes you make after the BAPI call succeeds. Similarly, you'd be calling BAPI_TRANSACTION_ROLLBACK in case the BAPI call fails. I Hope this helps Smile

    Wednesday, January 23, 2008 9:10 PM
  • Thanks.

    Wednesday, January 23, 2008 10:06 PM
  • I've added the COMMIT request after my successful BAPI call.  The COMMIT response has no errors (see below)

     

      <?xml version="1.0" encoding="utf-8" ?>
    - <BAPI_TRANSACTION_COMMITResponse xmlns="http://Microsoft.LobServices.Sap/2007/03/Bapi/BUS6003/">
    - <RETURN>
      <TYPE xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/" />
      <ID xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/" />
      <NUMBER xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/">0</NUMBER>
      <MESSAGE xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/" />
      <LOG_NO xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/" />
      <LOG_MSG_NO xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/">0</LOG_MSG_NO>
      <MESSAGE_V1 xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/" />
      <MESSAGE_V2 xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/" />
      <MESSAGE_V3 xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/" />
      <MESSAGE_V4 xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/" />
      <PARAMETER xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/" />
      <ROW xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/">0</ROW>
      <FIELD xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/" />
      <SYSTEM xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/" />
      </RETURN>
      </BAPI_TRANSACTION_COMMITResponse>
     
    However, I still do not see the data in SAP.  Does this COMMIT response look typical?  Any ideas on what I should look at to get this working?
     
    I would expect there to be more data in this response, like a TYPE code or something that indicates that the server took some sort of action.
     
    Any help is appreciated.  Thanks.
    Thursday, January 24, 2008 10:20 PM
  • When using transactions with sap adapter, you need to use the same connection context. That means that you need to use the same send port and set the context of the first message (you need to add a new reference to the project Microsoft.Adapters.SAP.BizTalkPropertySchema, then set the context property Microsoft.Adapters.SAP.BiztalkPropertySchema.ConnectionState) to OPEN (if using mySAP 3.0, check manual to see the commands) or REUSE in the following messages. In COMMIT message, the context command is CLOSE and, in ROLLBACK message, is ABORT.
    Friday, June 19, 2009 9:59 AM