Issues with calling BAPI from UIPath Studio

I am newbie to UiPath. I tried sales order creation BAPI from my process. I read the data from excel spread sheet and converted them into Datatable and DataRow as per the input parameter definitions. When I try to execute the file, I am getting the below error.

SAP.Middleware.Connector.RfcCommunicationException: TCPHOST not correctly set

RETURN CODE: PARAMETER_ERROR at SAP.Middleware.Connector.RfcChannelDriverFactory.GetHostAndPort(RfcConfigParameters allParams, RfcProgramType type, String& host, Int32& port)

at SAP.Middleware.Connector.RfcChannelDriverFactory.CreateTCPDriver(RfcProgramType type, RfcConnection rfcConn, RfcDestination destination, Int32& port, String& host, HttpProxy proxy)

at SAP.Middleware.Connector.RfcChannelDriverFactory.CreateChannelDriver(RfcProgramType type, RfcConnection rfcConn, RfcDestination destination)

at SAP.Middleware.Connector.RfcConnection.ConnectAsClient(RfcDestination destination, Boolean forRepository)

at SAP.Middleware.Connector.RfcConnectionPool…ctor(RfcDestination destination, Boolean forRepositoryCalls)

at SAP.Middleware.Connector.RfcConnectionPool.GetPool(RfcDestination destination, Boolean forRepository, Boolean create)

at SAP.Middleware.Connector.RfcDestination.GetClient(Boolean forRepository)

at SAP.Middleware.Connector.RfcDestination.SetAttributeValues()

at SAP.Middleware.Connector.RfcDestination.get_SystemAttributes()

at SAP.Middleware.Connector.RfcRepository.GetRepositoryForDestination(RfcDestination destination)

at SAP.Middleware.Connector.RfcDestination.get_Repository()

at UiPath.SAP.BAPI.ConnectionService.SapConnectionService.SapConnector.SetRepository(String destinationNameString)

at UiPath.SAP.BAPI.ConnectionService.SapConnectionService.SapConnectionService.Connect(SapConnection sapConnection)

at UiPath.SAP.BAPI.Activities.SapApplicationScope.<>c__DisplayClass156_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.SapApplicationScope.Connect(NativeActivityContext context)

at UiPath.SAP.BAPI.Activities.SapApplicationScope.Execute(NativeActivityContext context)

at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)

at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

I am able to connect to my SAP instance successfully from the UiPath. Able to list the BAPI available in the instance. But when I try to execute, I am getting the error.

Kindly help me in resolving this issue. I couldn’t find any documentation from SAP Side or UiPath side for this issue.

1 Like

Hi @5U88U

can you check this below thread

Thanks for your revert. I have checked both of them. First I am able to connect to the SAP instance successfully from UI Path activity. Next I am able to fetch the list of available BAPIs in the instance.

The above error is thrown only when I am executing it.

The error discussed in the referenced forum topics is different from my error.

Hello,
Did you manage to solve this issue? I’m facing the same problem.

Hi Ahmed,

No its not resolved. I stopped working with UiPath. Even no one from UiPath technical team helped me in this regard.

Moved to GUI Scripting wrapping with python. It has better community support.

Regards,
Subbu S.