Skip to Content
Connect SAP R/3 4.6C and SharePoint 2003 – Part II: Define SAP Proxy

In Connect SAP R/3 4.6C and SharePoint 2003 – Part I: Prepare Environment, 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.

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. 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

    (0) 
    1. Ted Teng Post author
      Thanks for your kind reply, Krishnakumar.

      I am very familiar with SharePoint but Not familiar with SAP EP6.0. I guess EP6.0 should be strong in presenting SAP data, at least quicker and more native than SharePoint do it.

      As far as I know, there is at least quite somewhat coding efforts to display SAP data.

      Our SAP team is also trying setting up Netweaver 2004, maybe later when I look at the SAP portal and also provided my viewpoints on comparison of two portals.

      Thanks for your comments if you have new findings.

      BR

      Ted

      (0) 
  2. Shannon Giacomo
    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?
    (0) 
    1. Ted Teng Post author
      I have no experience with SAP .net weaver portal. So I cannot give your a direct answer.

      And what is more important, we need consider business needs to check whether SPS can cover all needs or whether SAP portal is a need.

      My expertise is mainly with SharePoint. So far I think to present SAP data on SharePoint using SAP .Net Connector still needs quite amount of coding development.

      What I want to do is less coding and take more advantages of new products to quickly meet business challenges. Not sticked in coding.

      Recently SQL 2005 and its .Net Provider for mySAP suite were both released. I have found a lof interesting features to quickly present SAP tables and do business intellogence works using SQL 2005 and lastly it is easily to present the reports on SharePoint.

      I will write some tips on SAP-SQL-SPS-BSM(Microsoft BusinessBoard Manager). hope I get some spare time.

      hope these ideas helpful.

      Ted

      (0) 
    2. Eric Bellmore
      Shannon,

      Have you done anything with single sign on from your Sharepoint portal into SAP? We’re trying to do this right now and it’s not as simple as I had hoped – we’ve got thousands of users who don’t actually login to SAP, so they won’t have logon accounts, but we need to seamlessly pass them through (with a token possibly) but from what I’ve seen, the built in SSO for Sharepoint can’t do that…

      Thanks!

      -eric

      (0) 
  3. Dipali Kulkarni
    During the migration process problems have been reported for this blog. The blog content may look corrupt due to not supported HTML code on this platform. Please adjust the blog content manually before moving it to an official community.
    (0) 

Leave a Reply