Discrepancy Between UiPath SAP BAPI Commit and SE37 Execution: Data Not Saved

I attempted to execute two SAP BAPI calls within a UiPath sequence using the SAP BAPI activity:

  • BAPI_SALESORDER_CREATEFROMDAT2
  • BAPI_TRANSACTION_COMMIT

Both BAPI calls were processed without errors, yet the expected data was not saved in the SAP database. This raises uncertainty about the underlying cause of the issue.

Interestingly, when performing the same operations via SE37 using the same SAP account credentials, the data was successfully committed to the database. The discrepancy suggests that despite the successful execution and commit in UiPath, the data persistence is not being triggered as it does through SE37, leading me to question whether the issue lies in the UiPath execution environment or in the handling of the BAPI commit within the workflow itself.

Im also facing the same issue as you. Not sure if anyone has any solutions.

I‘m also facing the same issue by calling BAPI[BAPI_COSTCENTER_CHANGEMULTIPLE]. There were no return messages or error messages, and the data was not successfully modified. Do you have any solutions now?

@arslmohsin420 @Foreverlearning @Cheng_Natalia_CN_AB

Hi,

BAPI_SALESORDER_CREATEFROMDAT2 and BAPI_TRANSACTION_COMMIT must be done in the same session.

OK:

SessionBegin
BAPI_SALESORDER_CREATEFROMDAT2
BAPI_TRANSACTION_COMMIT
SessionEnd

BAPIActivity:

SessionBegin
BAPI_SALESORDER_CREATEFROMDAT2
SessionEnd

SessionBegin
BAPI_TRANSACTION_COMMIT
SessionEnd

I need the following to be reflected in SAP, but there is no session continuation in the current BAPI activity.

I use BAPI_SALESORDER_CREATEFROMDAT2 in InvokeCode as follows

RfcFunction = Destination.Repository.CreateFunction(BapiName);

if(BeginContext) SAP.Middleware.Connector.RfcSessionManager.BeginContext(Destination);
RfcFunction.Invoke(Destination);
if(EndContext) SAP.Middleware.Connector.RfcSessionManager.EndContext(Destination);