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

With the installation of the SAP GUI for Windows 7.60 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

2 Likes