How to use SAP NCo from SAP GUI for Windows Installation with Invoke Code Activity

With the installation of the SAP GUI for Windows release 7.60 or higher the SAP dotNET Connector NCo is also installed. NCo offers the possibility to use remote enabled function modules (RFC) with dotNET, and therefore also UiPath. In this post I describe a way to use the installed NCo from the SAP GUI for Windows. On this way is an additional installation of the NCo no longer required.

To use RFC calls it is necessary to add a few lines in the XAML file of your project.

Add in the Activity tag the following attributes:
xmlns:smc="clr-namespace:SAP.Middleware.Connector;assembly=sapnco_utils" xmlns:smc1="clr-namespace:SAP.Middleware.Connector;assembly=sapnco"

Add at the end of the TextExpression.NamespacesForImplementation tag in the sco:Collection the line:
<x:String>SAP.Middleware.Connector</x:String>

Add at the end of the TextExpression.ReferencesForImplementation tag in the sco:Collection the lines:
<AssemblyReference>sapnco</AssemblyReference>
<AssemblyReference>sapnco_utils</AssemblyReference>

It is necessary to create two dummy variables, one with a type from the library sapnco and one with a type from the library sapnco_utils.

image

Now you can use SAP NCo in your code activity without any additional installation of SAP NCo.

image

image

4 Likes

@StefanSchnell
Appreciate detailed instructions on API automation of SAP. I have SAP GUI installed and tried to follow above steps. However, I am still getting error of “NameSpace: SAP Muddkeware connector can not be resolved”. Tried to check whether the package exists and it is available in C:\Windows\Microsoft.NET\assembly\GAC_64. Can you please guide me further ? I am trying to use sapnco and sapnco_utils from SAP gui installation and trying to call RFC enabled BAPI

Hi,

I guess the main issue would be 64bit version, go with x86 and see if it will work for you.

Best regards, Lev

Thanks for quick response. Here we are not mentioning absolute path anywhere for middleware connector libraries. I don’t have these libraries in X(86) folder :C:\Program Files (x86)\Microsoft.NET

I am just saying, that you have to use x86 version, this is only version supported today, because of technical limitations on SAP side

sorry for confusion. Got it. Thanks Lev