RFC using SAP - DotNetSpider · Web viewBuilding Proxy and using it in the same machine....

13
RFC using SAP.NET Connector 2.0 Building Proxy and using it in the same machine . Prerequisites: Visual Studio 2003 SAP.NET Connector 2.0 Visual Studio 2005 Process Flow: 1. Open VS 2003. 2. Open the project in which RFC is needed. The slide after opening the project is shown as in the below slide

Transcript of RFC using SAP - DotNetSpider · Web viewBuilding Proxy and using it in the same machine....

Page 1: RFC using SAP - DotNetSpider · Web viewBuilding Proxy and using it in the same machine. Prerequisites: Visual Studio 2003 SAP.NET Connector 2.0 Visual Studio 2005 Process Flow: Open

RFC using SAP.NET Connector 2.0

Building Proxy and using it in the same machine.

Prerequisites:

Visual Studio 2003 SAP.NET Connector 2.0 Visual Studio 2005

Process Flow:

1. Open VS 2003.2. Open the project in which RFC is needed.

The slide after opening the project is shown as in the below slide

3

Page 2: RFC using SAP - DotNetSpider · Web viewBuilding Proxy and using it in the same machine. Prerequisites: Visual Studio 2003 SAP.NET Connector 2.0 Visual Studio 2005 Process Flow: Open

3. Right Click the solution and click Add New Project Class Library and create the class library in the required location.

4. Then after creation of the class library create a proxy using the following steps and slides.

5. Right click the class library and click Add New Item SAP Connector and create the proxy in the required name. Those steps are displayed in the following slides.

Thus a class library is created and the location is also browsed before creation.

Page 3: RFC using SAP - DotNetSpider · Web viewBuilding Proxy and using it in the same machine. Prerequisites: Visual Studio 2003 SAP.NET Connector 2.0 Visual Studio 2005 Process Flow: Open

Slide to create a SAP Proxy:

6. If you click the Add new Item option the following window is displayed. Thus the SAP connector is created …

Page 4: RFC using SAP - DotNetSpider · Web viewBuilding Proxy and using it in the same machine. Prerequisites: Visual Studio 2003 SAP.NET Connector 2.0 Visual Studio 2005 Process Flow: Open

Now go to Server Explorer and open the pane.

In the following pane you’ll have a menu like SAP.

The structure is like SAP Application Server Add Application Server

The window creation is displayed as below…

Click the Plus sign of SAP, which will display a tree like schedule Application Server will be visible and right click the option and click Add Application Server. Thus the following slide will be displayed

Page 5: RFC using SAP - DotNetSpider · Web viewBuilding Proxy and using it in the same machine. Prerequisites: Visual Studio 2003 SAP.NET Connector 2.0 Visual Studio 2005 Process Flow: Open

Thus the creation of the Application server is done. After that the items will be displayed and from that right click the Functions and click Add Function Filter.

Thus when the following is clicked a window will be opened and there the filter is specified as marked.

Filters are specified and created

Page 6: RFC using SAP - DotNetSpider · Web viewBuilding Proxy and using it in the same machine. Prerequisites: Visual Studio 2003 SAP.NET Connector 2.0 Visual Studio 2005 Process Flow: Open

Thus after creating the filter if the Functions option is clicked the BAPI related to the Filter text are displayed.

Now after creating the filter then from the BAPI’s displayed Click, Drag & Drop the BAPI and drop it in the proxy File.

These are the BAPI that are fetched from the

Page 7: RFC using SAP - DotNetSpider · Web viewBuilding Proxy and using it in the same machine. Prerequisites: Visual Studio 2003 SAP.NET Connector 2.0 Visual Studio 2005 Process Flow: Open

Thus after dropping the BAPI the process will be performed and the details related to the BAPI is placed in the Proxy file and the slide will be as below.

After dropping the files the reference is added to the project for the BAPI .dll files and the SAP related .dll files.

This has to be done by Right clicking the project and

Add Reference Browse BAPI Folder Bin Debug <FileName.dll>

Thus the details are referred in the project and shown as in the slide

Page 8: RFC using SAP - DotNetSpider · Web viewBuilding Proxy and using it in the same machine. Prerequisites: Visual Studio 2003 SAP.NET Connector 2.0 Visual Studio 2005 Process Flow: Open

The following steps applicable for both VS 2003 / VS 2005

Thus the reference will be added as shown in the browse window

Then add the SAP.Connector.dll and SAP.Connector.rfc.dll also from the Browse button and is displayed as follows

Page 9: RFC using SAP - DotNetSpider · Web viewBuilding Proxy and using it in the same machine. Prerequisites: Visual Studio 2003 SAP.NET Connector 2.0 Visual Studio 2005 Process Flow: Open

Thus the details are referred to the project.

Page 10: RFC using SAP - DotNetSpider · Web viewBuilding Proxy and using it in the same machine. Prerequisites: Visual Studio 2003 SAP.NET Connector 2.0 Visual Studio 2005 Process Flow: Open

Check if “System.Web.Services” reference is available. Then the Coding is created as follows

Thus the objects for the Tables in BAPI are created and the Connection is established.

Thus the SAP.NET connector is defined in same machine.

SAP.NET Connector in Different Machine:

Follow the same process till the creation of .dll. Then copy the dll to the other machine. Now in the project follow the steps to add reference of the <ClassLibrary.dlls>, SAP.Connector.dll and SAP.Connector.rfc.dll. Then follow the coding process and execute.

ClassLibrary5.SAPProxy1 bapi = new ClassLibrary5.SAPProxy1();

bapi.ConnectionString= "CLIENT=768 USER=abaper PASSWD=devapd1* LANG=EN ABAP_DEBUG=0 ASHOST=10.3.0.27 SYSNR=0";

ClassLibrary5.BAPIP0001BTable disp1 = new ClassLibrary5.BAPIP0001BTable();ClassLibrary5.BAPIP0002BTable disp2 = new ClassLibrary5.BAPIP0002BTable();ClassLibrary5.BAPIP0032BTable disp3 = new ClassLibrary5.BAPIP0032BTable();ClassLibrary5.BAPIP0105BTable disp4 = new ClassLibrary5.BAPIP0105BTable();ClassLibrary5.BAPITOAV0Table disp5 = new ClassLibrary5.BAPITOAV0Table();ClassLibrary5.BAPIP0001B disp11 = new ClassLibrary5.BAPIP0001B();ClassLibrary5.BAPIP0002B disp21 = new ClassLibrary5.BAPIP0002B();ClassLibrary5.BAPIP0032B disp31 = new ClassLibrary5.BAPIP0032B();ClassLibrary5.BAPIP0105B disp41 = new ClassLibrary5.BAPIP0105B();ClassLibrary5.BAPITOAV0 disp51 = new ClassLibrary5.BAPITOAV0();

ClassLibrary5.BAPIRETURN ret = new ClassLibrary5.BAPIRETURN();

bapi. Bapi_Employee_Getdata(Authority_Check, Blding_No, Costcenter, Date, Employee_Id, Extension, Fst_Name_K, Fst_Name_R, Fstname_M, Jobtxt, Jobtxt_Lg, Lastname_M, Liplate_No, Lst_Name_K, Lst_Name_R, Orgtxt, Orgtxt_Lg, Phone_No, Postxt, Postxt_Lg, Readdb, Room_No, Userid, out ret, ref disp5, ref disp4, ref disp3, ref disp1, ref disp2);