Skip to content

Getting Started

img This section shows how to install and set up ERPConnect for the first time.

Installation

  1. Download a 30 day trial version of ERPConnect.
  2. Run the ERPConnect executable (ERPConnectSetup.exe) to install ERPConnect. For information on system requirements, see Requirements.
  3. Download one of the following SAP libraries from the SAP Marketplace download area:
  4. When using a 64-bit system, copy the 64-bit version of the library to the C:\Windows\System32 folder.
    When using a 32-bit system, copy the 32-Bit Version of librfc32.dll to the C:\Windows\SysWoW64 folder.
  5. Add the ERPConnect.dll class library as a reference to your project.
    The library is located in the ERPConnect installation directory, e.g., C:\Program Files\ERPConnect.

For more information, see Installation.

Connect to SAP

  1. Create an R3Connection object and define all input parameters.
    Make sure to use an SAP dialog user with sufficient SAP authorization, see Authorization Objects - SAP User Rights.

    using (R3Connection con = new R3Connection())
    {
        con.UserName = "SAPUser";
        con.Password = "SAPPassword";
        con.Language = "EN";
        con.Client = "800";
        con.Host = "sap-erp-as05.example.com";
        con.SystemNumber = 00;
        con.Protocol = ClientProtocol.NWRFC; //use ClientProtocol.RFC for classic RFC library
    
        con.Open();
    }
    
    using (R3Connection con = new R3Connection())
    {
        con.UserName = "SAPUser";
        con.Password = "SAPPassword";
        con.Language = "DE";
        con.Client = "800";
        con.MessageServer = "sap-erp-as05.example.com";
        con.LogonGroup = "PUBLIC";
        con.SID = "ECC";
        con.Protocol = ClientProtocol.NWRFC; //use ClientProtocol.RFC for classic RFC library
        con.UsesLoadBalancing = true;
    
        con.Open();
    }
    
    using (R3Connection con = new R3Connection())
    {
        con.UsesWebSocket = true;
        con.WebSocketHost = "myinstance-api.s4hana.cloud.sap";
        con.WebSocketPort = 443;
        con.TlsSettings = new TlsSettings
        {
            TrustAll = false,
            CryptoLibrary = @"C:\lib\sapcrypto.dll",
            ClientPse = "CLIENT.PSE"
        };
    
        con.AliasUser = "TESTUSER",
        con.Password = "Password",
    
        con.Open();
    }
    
  2. Establish the connection using Open().

  3. Run the program to test the SAP connection.

Note

After the 30 days trial is expired, the license number must be set before connecting to SAP:

ERPConnect.LIC.SetLic("XXXXXXXXXX");

For more information, see Connect to SAP.

Next Steps

ERPConnect offers the following features for reading and writing data from and to SAP:

Functionality / SAP Objects Description
ABAP Code Generate and execute ABAP code on-the-fly.
BAPIs and Function Modules Access BAPIs and RFC function modules to read and write data from and to SAP.
BW Cube and BEx Queries Extract data from SAP BW InfoCubes and BEx Queries.
IDocs Send and receive SAP IDocs.
Queries Extract SAP queries (not BEx queries).
RFC Server Functions Create, register and use RFC server functions.
Tables Read SAP Tables directly via RFC.
Transactions Execute SAP transactions via batch input.

Last update: November 12, 2024