NwRfcNetCore 0.2.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package NwRfcNetCore --version 0.2.1
                    
NuGet\Install-Package NwRfcNetCore -Version 0.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NwRfcNetCore" Version="0.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NwRfcNetCore" Version="0.2.1" />
                    
Directory.Packages.props
<PackageReference Include="NwRfcNetCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NwRfcNetCore --version 0.2.1
                    
#r "nuget: NwRfcNetCore, 0.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NwRfcNetCore@0.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NwRfcNetCore&version=0.2.1
                    
Install as a Cake Addin
#tool nuget:?package=NwRfcNetCore&version=0.2.1
                    
Install as a Cake Tool

.NET client library for SAP NetWeaver RFC

An easy way of making SAP RFC calls from .NET. Libray is supported in Windows, Linux and macOS.

NuGet License Build Status

Supported Platforms & Prerequisites

  • Requires .NET 9 (or higher)

  • OS versions

    • Windows x64.
    • Redhat Linux 7 or other Linux distribution that is supported simultaneously by .NET Core and SAP NetWeaver RFC.
    • macOS 10.12+.
  • SAP NetWeaver RFC Library 7.50 SDK C++ binaries must be installed locally. For download and installation instructions check SAP Note 2573790

Using this package

Add the package using the dotnet cli:

$ dotnet add package NwRfcNetCore

Create a class to match SAP RFC parameters

    public class BapiCompanyOutputParameters
    {
        public CompanyDetails[] Details { get; set; }
    }

    public class CompanyDetails
    {
        public string CompanyCode { get; set; }

        public string Name { get; set; }
    }

Map RFC mapameters to class

    RfcMapper mapper = new RfcMapper();

    mapper.Parameter<BapiCompanyOutputParameters>().Property(x => x.Details)
        .HasParameterName("COMPANYCODE_LIST")
        .HasParameterType(RfcFieldType.Table);

    mapper.Parameter<CompanyDetails>().Property(x => x.CompanyCode)
        .HasParameterName("COMP_CODE")
        .MaxLength(4)
        .HasParameterType(RfcFieldType.Char);

    mapper.Parameter<CompanyDetails>().Property(x => x.Name)
        .HasParameterName("COMP_NAME")
        .MaxLength(25)
        .HasParameterType(RfcFieldType.Char);

Open a connection to server and invoke a BAPI

    using (var conn = new RfcConnection(builder => builder
        .UseConnectionHost("hostname")
        .UseLogonUserName("user")
        .UseLogonPassword("password")
        .UseLogonClient("cln")))
    {
        conn.Open();
        using(var func = conn.CallRfcFunction("BAPI_COMPANYCODE_GETLIST"))
        {
            func.Invoke();
        }
    }

or

    using (var conn = new RfcConnection("Server=server_name;lang=en;user=testUser;pwd=secret"))
    {
        conn.Open();
        using(var func = _conn.CallRfcFunction("BAPI_COMPANYCODE_GETLIST"))
        {
            func.Invoke();
        }
    }

Get result and display to Console

    var returnValue =  func.GetOutputParameters<BapiCompanyOutputParameters>();
    Console.WriteLine(String.Format("|{0,-20}|{1,-10}", "Company Code", "Company Name"));
    foreach (var row in returnValue.Details)
    {
        Console.WriteLine(String.Format("|{0,-20}|{1,-10}", row.CompanyCode, row.Name));
    }

Output should be

Company Code Company Name
C001 company 1
C002 Company 2

Samples

Included samples in project

  • List FI Companies
  • List FI Customers
  • Get Details of a FI Customer
  • FI General Ledger Account
  • RFC Read Table

Connection String

Example : Server=server_name;lang=en;user=testUser;pwd=secret

Value Alias
User Name "userName", "userId", "uid", "user", "u"
password "password", "passwd", "pass", "pwd", "p"
Host "target_host", "targetHost", "host", "server", "h"
Logon Language "language", "lang", "l"
System Client "client", "cl", "c"
SystemNumber "system_number", "systemnumber", "sysnr"
SystemId "system_id", "systemid", "sysid"
Trace "trace", "tr", "RfcSdkTrace"
Snc Mode "snc_mode", "sncmode", "UseSnc", "snc"
Snc Qop "snc_partnername", "sncpartnername", "snc_partner", "sncpartner"
Snc Lib "snc_library", "snc_lib", "snclib"

Credits

The package icon was made by Vectors Market and is licensed by the Flaticons license.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NwRfcNetCore:

Package Downloads
NwRfcNetCore.Hosting

An easy way of making SAP RFC calls from .NET Core (Windows, Linux and macOS)

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.2 56 3/24/2026
0.2.1 34 3/24/2026