Integration between SAP and SharePoint using Advantco REST Adapter


Requirement

This blog is to demonstrate How Advantco REST Adapter can be used to retrieve or place file in the SharePoint server using Microsoft Azure Integration.


REST (Representational State Transfer) is a software architecture style for designing client-server applications based on HTTP which is less complex than the SOAP (Simple Object Access Protocol) approach.


SharePoint is a web application framework and platform developed by Microsoft that integrates intranet, content management, and document management.

The Microsoft Azure Platform provides an API built on REST, HTTP, and XML that allows a developer to interact with the services provided by Microsoft Azure. Microsoft also provides a client-side managed class library which encapsulates the functions of interacting with the services.


The Advantco REST adapter for SAP PI enables system integration between SAP and NON SAP backend systems to connect, retrieve or place file in any SharePoint folder based on the REST along with OAuth which is an open standard for authorization.


Configuration Required

The major challenge that was faced while achieving this integration involves configuration of the Authentication, to connect to the share point site. This could be overcome by retrieving a refresh token which would be used by the REST adapter to retrieve the access token, which in turn is used by the Adapter.

The following are the steps that has to be performed to achieve the goal:


Go to the URL

https://login.windows.net/<tenant_id>/oauth2/authorize?response_type=code&client_id=<client id>

Get Code from URL

                Login and then get the URL. Copy it into a notepad and collect the <CODE>

Get the Refresh Token

Now use the Advantco REST Client to access the rest of the information.

  https://blogs.sap.com/wp-content/uploads/2015/03/1_667452.png
  

Channel Configuration

Use the above token to create the channel configuration:

Authorization Grant Type

Refresh Token

Client Id

<client id>

Client Secret

<client secret>

Token Endpoint

https://login.windows.net/<tenant id>/oauth2/token?client_id=<client id>&client_secret=<URL-encoded client secret>&resource=<App ID>

Refresh Token

<Refresh token obtained above>

Scope

  https://blogs.sap.com/wp-content/uploads/2015/03/2_667453.jpg
  

Testing

A file present in the SharePoint folder would be retrieved and brought into the PI system:

https://blogs.sap.com/wp-content/uploads/2015/03/3_667466.png

File that would be used:

https://blogs.sap.com/wp-content/uploads/2015/03/5_667468.png

Channel used:

https://blogs.sap.com/wp-content/uploads/2015/03/6_667469.png

Screenshot from the SXMB_MONI showing the message:

https://blogs.sap.com/wp-content/uploads/2015/03/7_667470.png

The file present in the SAP Folder:

https://blogs.sap.com/wp-content/uploads/2015/03/7_667470.png

Summary

Connection to SharePoint can be complex because of the Microsoft Authentication Mechanism. Advantco REST Adapter reduces the complex integration process with Microsoft Azure/Sharepoint to simple configurations steps without any custom development.


References

For more details on Advantco REST Adapter, please refer: http://scn.sap.com/community/pi-and-soa-middleware/blog/2011/11/08/rest-adapter-for-netweaver-sap-pi

For the Advantco Rest Adapter website, please refer: https://www.advantco.com/product/REST