Blogs

Ted Teng

Connect SAP R/3 4.6C and SharePoint 2003 - Part II: Define SAP Proxy
Ted Teng
Business Card
Company: Shanghai Secco Petrochemical Co. Ltd.
Posted on Oct. 16, 2005 02:00 AM in Interoperability .NET

URL: http://ms.mblogger.cn/tedteng/posts/18470.aspx

Subscribe.Subscribe
Print. Print
Permalink Permalink
Connect SAP R/3 4.6C and SharePoint 2003 - Part II: Define SAP Proxy

In previous tip, I described how to set up the testing/development environment for connecting SAP 4.6c and SharePoint Portal Server 2003 in order to meet the business needs of displaying SAP data on SharePoint sites.

The case study's objective to create two web parts. One web part retrieves and displays the customer list staring with some characters from SAP IDES database via RFC interface. The second web part displays the order list of a customer from IDES via BAPI interface. These two web parts can be connected. When user selects a customer on the first web part, the second web part will display the order list accordingly.

The key starting point of accessing SAP data is to define a SAPProxy, which is "generated from a standard Web Service Description Language (WSDL) file, a WSDL file included in an SAP interface repository (IFR), or from an SAP server. At run time, the SAP .NET Connector uses these classes to perform and manage communication between the .NET application and the SAP server." In our first web part, we will invoke one of RFC functions the SAP proxy class provides to get the customer data like below figure shows.



So far we have a Sharepoint testing server installed with SAP .net connector 2.0.1 and JRE 1.4 and I have a SAP IDES(say, IP: xxx.xx.xx.xx, Client number:800, System number:0) with a developer-right user name and password. (IDES stands for Internet Demonstration and Evaluation System, which is a demo system of SAP, so for testing and studying, we start to use IDES as our back end SAP system.) Now we can go to this testing server and open VS 2003 to implement below steps.

1. Create a New WebPart Library Project named "SAPCustomerWebParts"

2. Solution Explorer, right click solution "SAPCustomerWebParts" and Add New Item

3. Select SAPConenctor icon, add a new SAP proxy named "SAPProxy1"



4. Click Server Explorer on design view window of SAPProxy1, a node SAP will appear on server explorer tree with other server data source nodes. If this SAP icon does not appear, just right click server explorer and click refresh. If you have installed SAP .net connector, SAP node should be there.



5. Under SAP node, there is a child node called "Application Servers" , right click it and Add new SAP Application Server

6. A window popped up like below Define DestinationType as Custom Logon Settings, input SAP user name such as "tedteng" (you must request your SAP admin add a developer user for you), set the client number in my case is "800" (if you do not know, ask your SAP admin. at this point, I made a mistake because I had little knowledge of SAP on this configuration), set AppServerHost as the ip address like my case' SAP IDES server ip or its servername like seccoides in my company, and then define SystemNumber as 0.



7.Then a node "10.20.130.29" (AppServerHost's value) will appear on under node of "Application Servers". Under this new node, there are two children nodes: BOR and Functions. In SAP, BOR stands for Business Object Repository and Functions for RFC / BAPI functions. RFC stands for Remote Function Calls and BAPI for Business Application Programming Interface.



8. Right click Functions node, Add function filter with "RFC_CUS*" as the value of filter. Then there are four SAP RFC functions starting with "RFC_CUS" will appear under the Functions node.

9. Right click a node named "RFC_Customer_Get" (this SAP RFC function is to get a list of customers), then click Add to Designer, a retrieving data window pops up. This retrieving function need the Java Run Environment.



10. Then the SAPProxy1 designer window will be like below:



11. Initial SAPProxy1 use below codes:

    SAPProxy proxy = new SAPProxy1();
    SAPDestination dest =
        new SAPDestination("your sap server ip or name", youSapClientNumber,systemNumber,"yourSAPUserName","yourSAPPassword");
        //here just for demo, we use fix SAP user account, in real world, we may choose SharePoint Single Sign On function to replace above code;
    SAPCustomerWebParts.BRFCKNA1Table customer_T = new BRFCKNA1Table();
    try
    {
        proxy.Connection
            = new SAP.Connector.SAPConnection(dest);
        proxy.Rfc_Customer_Get("",//customer ID
        searchText,//customer name
        ref customer_T);
     }
    catch (Exception ex)
    {
        ...
    }
    finally
    {
        proxy.Connection.Close();
    }




BRFCKNA1Table customer_T is SAP table but it can be transferred to ADO DataTable. So you will easily to use it as you use .net data tables.

Next we will come back to .net world to create web parts. I will describe in next tip.

Ted Teng is an expert on MS SharePoint Portal.


Add to: del.icio.us | Digg | Reddit


Comment on this article
Comment on this weblog
Showing messages 1 through 3 of 3.

Titles Only Full Threads Oldest First

  • Good one, follow-up
    2005-12-19 16:14:34 Shannon Giacomo Business Card [Reply]

    Yes this is great information, thank you. Our company is also on 4.6C, installing a Sharepoint infrastructure and evaluating Enterprise Portals as well. I keep coming back to the question: why use two portals? My manager showed this in practice by linking a dynamic BW 3.5 web report (hosted on a Netweaver WAS 6.40) into our test Sharepoint team site, everything worked just fine except for the single sign-on which we haven't addressed but that should not be a big deal. So it seems to me that you only need ITS/WAS 6.20 for a version 4.6C or older system, or WAS 6.40 in the Netweaver world, then you could still use Sharepoint as the sole portal without ever installing Enterprise Portals? Any thoughts or ideas on direction from here? I just attended the Enterprise Portals seminar in Orlando and this seemed to be a valid approach, but am concerned that we are missing something by not implementing SAP Enterprise Portals?
  • Good one
    2005-10-17 07:12:51 Krishnakumar Ramamoorthy Business Card [Reply]

    Ted-


    Thanks for your weblog. Incidently, I am designing global interface architecture for one of our clients using Biztalk 2004. To facilitate an "perfect" end-to-end monitoring of interfaces (apart from various other portal needs), I was speculating between Share Point or SAP EP 6.0. Your weblog comes right in the moment. Guess, I will post my experiences once we start putting some stuff in place.


    Thanks again and I hope to keep you posted with more questions :-)


    Thanks
    KK


Showing messages 1 through 3 of 3.