SAP BAPI error

Good day! I’m connecting to sap through SAP Application scope, connection is OK and the use SAP BAPI then I got the error “NOT_AUTHORIZED”.
What could be the cause?



StackTrace: at SAP.Middleware.Connector.RfcConnection.ThrowRfcErrorMsg()

at SAP.Middleware.Connector.RfcConnection.RfcReceive(RfcFunction function)

at SAP.Middleware.Connector.RfcFunction.RfcDeserialize(RfcConnection conn, IRfcIOStream stream)

at SAP.Middleware.Connector.RfcFunction.RfcCallReceive(RfcConnection conn, IRfcIOStream stream, RFCID rid)

at SAP.Middleware.Connector.RfcFunction.RfcCallReceive(RfcConnection conn)

at SAP.Middleware.Connector.RfcFunction.Invoke(RfcDestination destination)

at UiPath.SAP.BAPI.ConnectionService.SapConnectionService.SapConnector.InvokeFunction(IRfcFunction function)

at UiPath.SAP.BAPI.ConnectionService.SapConnectionService.SapConnectionService.ExecuteApi(String apiName, ICollection`1 dataTables)

at UiPath.SAP.BAPI.Activities.InvokeSapBapi.<>c__DisplayClass26_0.b__0(SapBapiTelemetryOperation operation)

at UiPath.SAP.BAPI.Telemetry.TelemetryServiceBase.Operation[T](String operationName, String activityId, Func`2 method, String bapiName)

at UiPath.SAP.BAPI.Activities.InvokeSapBapi.Execute(CodeActivityContext context)


It may be due to the BAPI you are trying to use is not allowed or inaccessible to the credentials you are trying.

Check the access with your SAP admin.

Ashok :slight_smile:

  1. Check User Permissions: Ensure the SAP user credentials you’re using in the SAP Application Scope have the required authorization to execute the specific BAPI function
  2. BAPI Authorization Object: Some BAPIs require specific authorization objects within SAP security. These objects define which users can access the BAPI functionality
    3 Consult your SAP administrator to ensure the SAP system is configured correctly to allow access to the BAPI