Many a times, the billing documents like invoices or sales orders which is available as a PDF document needs to be copied to SharePoint team site so that it can be made accessible to broader recipients within an organization. Using the OData APIs available in SAP S/4HANA Cloud, integrations patterns provided by Cloud Integration capability and simplified connectivity to SharePoint provided by Open Connectors of SAP Cloud Platform Integration Suite, such a business scenario can be very easily achieved.
In the
blog series, posting of the billing documents from SAP S/4HANA Cloud to SharePoint is covered end-to-end and in this blog, configurations around creating a SharePoint connector instance via Open Connectors is covered.
Prerequisites
App Registration for SharePoint API Access
For using the SharePoint connector from Open Connectors capability of SAP Cloud Platform Integration Suite, you will need an OAuth key and Secret to connect to your SharePoint Online account. In this section, configurations required to connect to your SharePoint Online account has been covered.
- Logon to your Azure Portal using your SharePoint online credentials.
- Navigate to Azure Active Directory and select App Registrations. Click New registration to create an OAuth application.
- In the application registration prompt, enter an application name say SharePointOAuthApp, select the supported account types and in the Redirect URI enter the redirect URI for SAP Cloud Platform Open Connectors, which is https://auth.cloudelements.io/oauth
- The registered application by default only has the User.Read permission from Microsoft Graph APIs and you will need to add in the required permission to access SharePoint REST APIs. Select API permissions tab and then click on Add a permission to add in the permissions for SharePoint REST APIs.
- Select SharePoint to add in the API permissions for SharePoint.
- In SAP Cloud Platform Open Connectors, access to the API is via the signed-in user. Select Delegated Permissions for accessing APIs as signed-in user.
- Select the Permissions as shown in the screenshot below and select Add permissions
- Some of the selected permissions would require administrator consent. After the permission is selected, click on Grant admin access . The permission may take some time to updated as shown in the warning, so wait for few minutes before selecting the Grant admin consent option.
- You may be prompt to confirm the administrator consent. Select Yes.
- After successful operation, the status would change to Granted for your user.
- For connecting to your SharePoint Online account from SAP Cloud Platform Open Connectors, OAuth secret is required.To get your OAuth Secret, select Certificates & secrets tab, click on New client secret.
- Enter a description for your OAuth secret say oauthsecret, select the expiry time, select Add.
- Copy and note down the generated client secret, you will need to provide this while creating SharePoint connector instance from SAP Cloud Platform Open Connectors.The generated client secret cannot be retrieved later.
- For connecting to your SharePoint Online account from SAP Cloud Platform Open Connectors, OAuth client ID is required.To get your OAuth client ID , select Overview tab, copy the Application (client) ID value.
Create SharePoint Connector Instance in Open Connectors
Open Connectors capability of SAP Cloud Platform Integration Suite simplifies and accelerates connectivity to third-party cloud applications. It provides robust, feature rich, pre-built connectors to an extensible library of over 160 of the most popular third-party cloud applications. In this section, steps to create SharePoint connector instance from Open Connectors capability of Integration Suite is captured.
SAP Cloud Platform Integration Suite is available for test, explore and try out in SAP Cloud Platform trial. If you have not enabled SAP Cloud Platform Integration Suite in your trial tenant, refer this blog to enable it.
- Logon to your SAP Cloud Platform trial
- Select Subscription and search and select Integration Suite. Click on Go to Application
- It will launch the Integration Suite launch pad in a new browser tab. Select Extend Non-SAP Connectivity In case this option is not visible for you, you can click on Manage Capabilities and enable Open Connectors capability. More details in this blog
- You would be navigated to Open Connectors Home page.
- Click on Connectors tab to view all the available pre-built, feature rich connectors. Search for the SharePoint connector by entering Shar in the search region.
- Hover over the Sharepoint connector and select the option Authenticate to connect to your own SharePoint account.
- In the connection wizard, enter a name for your connector instance say mysharepointdemo, Enter your Sharepoint Site Address in the format {your_sharepoint_domain}.sharepoint.com, enter your copied OAuth Client ID in the API Key text field, enter your copied OAuth secret in the API Secret text field and select Show Optional Fields.
- During the creation of OAuth Client & Secret on Microsoft Azure portal since the delegated user access approached was used, select the Delegate User access flag to true in Open Connectors as well.
- Select Create Instance to create SharePoint connector instance.
- You may be prompted to enter your SharePoint user credentials. In case, you are already logged into your SharePoint account the logged in session may be automatically taken by the browser.
- You may be prompted to trust the SharePoint OAuth application. Select Trust It
- After the authenticated connection to your SharePoint account has been created successfully you would be able to test out the connection from SAP Cloud Platform Open Connectors. To try out the SharePoint connector APIs, click on the option Test in the API Docs.
- This would launch the integrated OpenAPI specification based API Documentation for your SharePoint connector, so that you can test and try out the connector from SAP Cloud Platform Open Connectors.
- Select any of the available Resources say GET /files to read files from your SharePoint sites and click on Try it Out
- To read files from SharePoint, the information about your teams site should be passed in the field Subsite in the format /sites/{your_site_name} and path to your file should be passed in the format /{your_directory}/{your_filename}. In this blog series, the name of SharePoint teams site used was General and name of the filename was docx. Enter /welcome.docx in the path field and /sites/General in the Subsite field. Select Execute.
Note:- If your site contains spaces then in the Subsite field enter the site name without spaces.
- Click on the Download file to download and view your file from SharePoint To view the downloaded word or office files appropriate software on your local machine will be required.
- To consume this newly created connector instance from Cloud Integration, copy down the connectors instance authorization token and the Request URL.
With this you have successfully created a SharePoint connector instance from Open Connectors capability of SAP Cloud Platform Integration Suite. You would be able to use this connector instance in Cloud Integration to integrate data from SAP system to SharePoint or build an application connecting to your SharePoint account. In the
next blog part of the
Blog Series Posting Documents to SharePoint , steps to consume this SharePoint connector instance from Cloud Integration will be covered in details.
More information about Pre-built connectors features like normalized search, pagination, bulk, eventing is available in
help documentations
To know more about Open Connectors visit us at
SAP Community