SAP is a very common ERP system used by dozens of  corporations. Sometimes there is a need of enabling communication between SAP and .NET application. SAP Connector gives You this kind of possibility. It allows You to exchange informations by the RFC(Remote Function Calls) or Web Services. This article is a short tutorial on how to enable comunnication with SAP from Your .NET Application using SAP Connector.

In the begenning I assume that You have already installed VisualStudio 2003 which is fully compatibile with SAP Connector. I haven’t  tried to use SAP Connector with VS 2005, but I read that it doesn’t work properly. So let’s get on with it:

  • Install SAP Connector for .NET 2.0
  • Create a new project, f.e. a new Windows Application named “MySAPApplication”
  • Right click on the project, then select Add -> Add new item…
  • In the opened dialog box search for the SAP Connector Proxy and add it to the project. System will add new SAPWSDL(SAPProxy1.sapwsdl named by default) file.

  • Go to the Server Explorer(View -> Server Explorer) and click Add Application Server…

  • Specify data needed to connect with SAP server

  • After establishing connection, right click on the Functions and Add Function Filter…

  • Enter function name and GroupFilter(You can use wildcard ‘*’, f.e. GroupFilter ‘Z*’ will find all functions which name starts with letter ‘Z’)

  • Expand newly created filter

  • Drag and drop selected function onto opened SAPProxy1.sapwsdl file.

That’s it! Now You can build Your project and extend it with C# code which uses above class to communicate with SAP:

MySAPApplication.SAPProxy1 connector = new MySAPApplication.SAPProxy1();