Archive

Archive for the ‘SAP .NET Connector’ Category

RFC Server : Complete Example for Connection from SAP to .NET Application

March 9th, 2009

——————————————————————————-

Downloadable Files :

——————————————————————————-

In some cases, we need a system that SAP maybe a client, and our unSAP application maybe a server. Although SAP is a comprehensive solution center for all enterprise needs, sometimes SAP can not give answer for all of our needs. Think that you need to supply data to outer database that is not your application server’s database. And think that your application server’s database does not give permission to use native SQL commands. What will you do in this case?

Problems maybe more, such as you want to send SMS from SAP, or you want to send fax [I am accepting SAP has an integrated solution for sending fax, but in some firms, respect to SAP application server's version sending fax is not possible]. You can imagine more problems.

In such a case, there maybe several solutions. One of the solutions is that SAP will be client and our outer application will be server. So, when SAP wants to connect our system, this architecture will be used.

Up to now, we have mentioned about connection from VS.NET to SAP. What about connection from SAP to VS.NET? Of course, this is possible :) Not only from SAP to VS.NET, also connection from SAP to Java or to any other develepment tool program that SAP permitted is possible.

In this article, I want to take care attention how to connect our .NET application from SAP synchronously. So, I will do a small application in NET. This application will send mail respect to our parameters. After examining my example, I am sure, you will have lots of idea where to use this solution. Such as, if you run across a problem as I mentioned in first paragraph, you can do my solution.

Let’s look at what we need :
Read more…

ABAP, C#, GMail, RFC, SAP, SAP .NET Connector, Visual Studio

A Comprehensive Example for Connection to SAP with Visual Studio 2008

January 9th, 2009

——————————————————————————-

Required :

  • Visual Studio .NET 2003
  • Visual Studio 2008
  • SAP Application Server [ Any acceptable version for RFC]
  • SAP .NET Connector 1.1 or 2.0 [ 2.0 is suggestion]

——————————————————————————-

As I promised in my previous articles, I will just explain the building stones of connection to SAP using Visual Studio 2008 development tool.

Before reading this article, I suggest my readers should firstly read my two articles. One of this article is for the basic explanation of .NET Connector in Visual Studio .NET 2003. And the second article is for explaining the logic of connection to SAP with Visual Studio 2005 or Visual Studio 2008.

In this article, we will use SAP .NET Connector 2.0 version. SAP .NET Connector is an add on for Visual Studio .NET 2003.  So, we need Visual Studio .NET 2003 development tool. After installing the SAP .NET Connector add on, we will create a ‘class library’ project in Visual Studio .NET 2003. Below, I showed this operation.

sap_conn_vis2008_1
Read more…

C#, SAP, SAP .NET Connector, Visual Studio, Visual Studio 2005, Visual Studio 2008

A Complete Sample : Connection to SAP from Visual Studio .NET 2003 via RFC.

December 18th, 2008

In this article, we will send a material number and get this material’s stock information using Visual Studio .NET 2003 development tool with creating connection to SAP. Before explaining SAP .NET Connector side, let’s look at the required operations in SAP.

It is required that a function has to be defined in SAP to get a database table’s information or to modify a database table if we are using SAP RFC(Remote Function CALL) way. In this function, input and output parameters are defined. Respect to our example, the signature of our function will be as below.

IM_MATNR (Material number) : Input
TABLE_MARD (Stock Information) : Output (Table)
EX_RESULT (Result) : Output

Let’s look at the picture below.

8

As seen in this picture, we named our function as ZGET_MATERIAL_STOCK_INFO. We defined ‘Remote-enabled mode’ for processing type. Selecting the processing type as ‘Remote-enabled mode’ is required information because of we have to inform SAP that we will call this function via RFC.

Let’s look at the import parameters of our function.

9

Respect to these parameters, there is an input parameter called ‘IM_MATNR’. The type of this parameter is MATNR reference type.

One of the important point in above picture, parameters should be called as ‘pass by value’. So, we selected ‘Pass Value’ selection. Otherwise, we will get compile error.

Let’s look at the output parameters.

101

There is only one paramater is returning and it’s name is ‘EX_RESULT’. ‘Pass Value’ should be selected in output paremeters like input parameters.

Let’s look at the tables which will be used in our function. The tables during function call can be both input and output.

Read more…

ABAP, C#, SAP, SAP .NET Connector, Visual Studio

Connection to SAP using Visual Studio 2005 & 2008

December 18th, 2008

SAP has not developed a connector API for Visual Studio 2005 and Visual Studio 2008 yet. I think the reason of not developing a connector API depends on some marketing strategies and the feasibility that can be developed web service that comes with the SAP 6.0, so the technology that can be developed web service in SAP will replace the connector API.

But, there is an important reality that some Visual Studio .NET 2003 projects which were developed before are connecting to SAP with SAP .NET Connector API. There is a ‘technology problem’ that has to be considered by developers if they want to migrate these projects to Visual Studio 2005 or Visual Studio 2008. Respect to this technology problem, SAP firstly suggest to their customers for examining SAP Application Server version whether higher than or equal to 6.0 or not and if higher than or equal to 6.0, developing a web service in SAP Application Server and solving the required connection via this web service. Of course, this is only one solution in all of solutions to this technology problem.

But, what happen if our SAP Application Server version is lower than 6.0 or we don’t want to connect SAP with web service respect to our analyzing decisions although our application server version is higher than or equal to 6.0? SAP has already a solution to this question, too. In fact, this is not an original solution, it is possible that every software specialist can find this solution after thought a while.
Read more…

SAP, SAP .NET Connector, Visual Studio