|
This brief is to showcase how one can implement access to any inbound ODATA or REST API by leveraging SAP Appgyver's intrinsic Data integration capabilities.
We shall see how this can be done using the BANK_0002 API (S4HC) against a productive S/4HANA Cloud system. |
Pre-requisites:
Good to know:
Disclaimer:
- The ideas presented in this blog are personal insights thus not necessarily endorsed by SAP.
- Please note all the code snippets and gists are provided “as is”.
- Images/data in this blog post is from SAP internal sandbox, sample data, or demo systems. Any resemblance to real data is purely coincidental.
- Access to some online resources referenced in this blog may be subject to a contractual relationship with SAP and a S-user login may be required. Always refer to T&C.
|
Before we start...
An aerial view of S/4HANA Cloud APIs.
|
With a whooping [...] and counting business APIs, there is an ever growing number of these APIs that support the principal business user propagation out-of-the-box.
(this is with either OAuth2SAMLBearerAssertion or SAMLAssertion authentication flows) |
Good to know:
- However, even if the above still does not hold true for all the APIs, quite a large number of APIs supports x509 client certificate authentication (albeit with regard to a communication user).
- At present, the customer influence portal is conducting a S/4HANA Cloud campaign focused on the APIs without any upvoting threshold, namely https://influence.sap.com/sap/ino/#/campaign/1175
Let's have a look at the line-up of the S/4HANA Cloud APIs on
SAP_API_BUSINESS_HUB .
Good to know: As the SAP API Business Hub offers its own ODATA catalog service we shall be using it for APIs browsing and discovery as follows:
Additionally, the APIs can be broken down by subtype as follows:
Q: Is there an easy way to know what authentication methods are supported, what communication scenario are involved, etc ?
A: Indeed, it is fairly easy to [programmatically] retrieve a given API characteristics merely by its
catalog name...for instance:
Putting it all together.
Step1. The communication arrangement (S/4HANA Cloud)
Let's create a new communication arrangement based on the Bank Integration communication scenario for the following API, namely
BANK_0002
Please refer to the following
gist for further details.
Step2. myBank API proxy (SAP API Management)
Let's implement S/4HANA Cloud myBank API with the OAuth2SAMLBearerAssertion flow by leveraging API Management.
The end game is to be able to fetch the EDMX metadata using the API Proxy URL below:
https://<API Proxy hostname>/***/BANK_0002/$metadata
Good to know:
- myBank API proxy has a built-in CORS policy where additional headers can be added or removed
Please refer to the following
gist for further details.
Step3. Create a front end web application (SAP Appgyver)
SAP Appgyver offers a so-called "
zero lock-in"
approach to data. In other words your data never hits Appgyver backend servers.
All you need to do is to expose your backend functionality with either ODATA or REST APIs.
and voila...
Please refer to the following gist for further details.
Conclusion.
Last but not least, I hope you enjoyed reading this blog. Please provide your feedback in the comments section below.
Appendix
A case for SAP API Management as a framework to implement your extensions with S/4HANA Cloud
Q. What is the key advantage of using SAP API Management (APIM) to implement extensions with S/4HANA Cloud ?
A. There are several ones.
- First of all there is no code to be written at all.
- Furthermore, one can group S/4HANA Cloud APIs (including combining different authentication methods) into API Products and publish the API Products into the Developer portal.Then developers can create applications subscribing to the API Products.
|
Additional resources