Archive

Archive for the ‘ABAP’ 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

Sending Synchronous Mail from SAP via Outlook using OLE2 Objects

January 1st, 2009

OLE2 objects are the milestone of COM technologies in SAP. You can connect any other system such as Outlook, Excel, Word, Adobe PDF from SAP with registering these assembly files of these systems.

You can not use OLE2 objects in background. While using some functions deal with OLE2 objects, there should be a connection to GUI.

OLE2 objects are very usefull while creating our localized applications. Such as you need to create an excel file with suppliying SAP data and so you can draw graphics in excel. We can diversify our examples. Think that you have a word template file. Such as a billing word document. You need to supply the required information to this template file. As a result, you can achieve your word document that was feeded with your SAP information as an output.

In our example, we will show a mail document in foreground. We will attach some documents to this mail. I have managed several document management projects in SAP. Documents are scanned and loaded into network and any document can be shown in SAP with the header information of this document. But, there is requirement that this document should be mailed easiliy. So, the fateful operation is adding the reqired documents to outlook mail message.

We will examine how to use the OLE2 objects from the beginning.

Read more…

ABAP, COM, Document Management System, MS Outlook, OLE2, SAP

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