NwRfcNetCore 0.2.1
See the version list below for details.
dotnet add package NwRfcNetCore --version 0.2.1
NuGet\Install-Package NwRfcNetCore -Version 0.2.1
<PackageReference Include="NwRfcNetCore" Version="0.2.1" />
<PackageVersion Include="NwRfcNetCore" Version="0.2.1" />
<PackageReference Include="NwRfcNetCore" />
paket add NwRfcNetCore --version 0.2.1
#r "nuget: NwRfcNetCore, 0.2.1"
#:package NwRfcNetCore@0.2.1
#addin nuget:?package=NwRfcNetCore&version=0.2.1
#tool nuget:?package=NwRfcNetCore&version=0.2.1
.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.
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 | Versions 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. |
-
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.