Home > .NET Connector 3.0, C#, SAP > SAP Connection Manager using .NET Connector 3.0

SAP Connection Manager using .NET Connector 3.0


SAP Configuration Manager: This is a simple, C# class library project to connect .NET applications with SAP. This component internally implements SAP .NET Connector 3.0. The SAP .NET Connector is a development environment that enables communication between the Microsoft .NET platform and SAP systems. This connector supports RFCs and Web services, and allows you to write different applications such as Web form, Windows form, or console applications in the Microsoft Visual Studio.Net. With the SAP .NET Connector, you can use all common programming languages, such as Visual Basic. NET, C#, or Managed C++.

Features: Using the SAP .NET Connector you can:

  1. Write .NET Windows and Web form applications that have access to SAP business objects (BAPIs).
  2. Develop client applications for the SAP Server.
  3. Write RFC server applications that run in a .NET environment and can be installed starting from the SAP system.

Configuration Steps:

Following are the steps to configure this utility on your project

  1. Download and extract the attached file and place it on your machine. This package contains 4 libraries:
    1. SAPConnectionManager.dll
    2. SAPConnectionManager
    3. sapnco.dll
    4. sapnco_utils.dll

Now go to your project and add the reference of all these four libraries. Sapnco.dll and sapnco_utils.dll are inbuilt libraries used by SAP .NET Connector. SAPConnectionManager.dll is the main component which provides the connection between .NET and SAP.

Once the above three steps are complete, you need to make certain entries related to SAP server on your configuration file. Here are the sample entries that you have to maintain on your own project. You need to change only the values which are marked in red color. Rest remains unchanged.

<appSettings>

   <add key=”ServerHost” value=”127.0.0.1″/>

   <add key=”SystemNumber” value=”00″/>

   <add key=”User” value=”sample”/>

   <add key=”Password” value=”pass”/>

    <add key=”Client” value=”50″/>

    <add key=”Language” value=”EN”/>

    <add key=”PoolSize” value=”5″/>

    <add key=”PeakConnectionsLimit” value=”10″/>

    <add key=”IdleTimeout” value=”600″/>  

  </appSettings>

  1. To test this component, create one windows application. Add the reference of sapnco.dll, sapnco_utils.dll and SAPConnectionManager.dll on your project.
  2. Paste the below code on your Form lode event

SAPSystemConnect sapCfg = new SAPSystemConnect();

RfcDestinationManager.RegisterDestinationConfiguration(sapCfg);

RfcDestination rfcDest = null;

rfcDest = RfcDestinationManager.GetDestination(“Dev”);

That’s it. Now you are successfully connected with your SAP Server. Next you need to call SAP business objects (BAPIs) and extract the data and stored it in dataset or list.

Categories: .NET Connector 3.0, C#, SAP
  1. DURAI
    February 18, 2013 at 9:51 AM

    PLEASE TELL ME HOW TO USE THIS CODE? THIS CODE FOR WHICH APPLICATION, ASP.NET OR WINDOWS FORM APPLICATION…… pLEASE HELP ME GUYS…!

    • February 18, 2013 at 11:52 AM

      You can use this code in ASP.NET application or Win form application both. I suggest you can create a class library project or a web service or WCF service and use that code.

      • DURAI
        February 19, 2013 at 9:17 AM

        Where to place this code?

  2. DURAI
    February 19, 2013 at 9:20 AM

    Where to place this code?

    • February 19, 2013 at 11:51 AM

      If you are using Web Service, then you can put that code on code behind file of web service.

  3. Carlos Viales
    April 17, 2013 at 4:06 PM

    Hi, i see the line
    SAPSystemConnect sapCfg = new SAPSystemConnect();

    What is the definition to SAPSystemConnect?

    Thanks

  4. April 18, 2013 at 5:05 AM

    SAPSystemConnect is a custom component (build in C#) which internally implements .netConnector 3.0. This is the heart of the logic. Without implementing this, u can’t connect to SAP.

  5. May 10, 2013 at 9:34 AM

    Hi Prateek. I like your article – simple and to the point. Please visit my web-site and if you like what you read send me an email – maybe we can find common ground using SAP.NET Technology. I am in the FDA regulated industry. ;)

  6. October 8, 2013 at 10:21 AM

    sir can u send me code for it on my id arjundhilod@gmail.com i was already use connecter 2.0 but 3.0 using 1st time

  7. Ankur Deshpande
    November 18, 2013 at 10:20 AM

    Hi prateek. I have followed your post. Now how can i call a RFC using your post.?

  8. Claudio Olivera
    November 20, 2014 at 3:27 AM

    Hi Prateek

    Can you use this connector with Kerberos? How?

    Thanks
    Claudio

  1. No trackbacks yet.

Leave a comment