How to Extend SAP S/4HANA Business Address Services (or any other SAP S/4HANA application) with Serverless Functions on Kyma Part-I
What is a serverless function?
Serverless functions are single-purpose, programmatic functions that are hosted on managed infrastructure. These functions, which are invoked through the Internet, are hosted and maintained by cloud computing companies.
Benefits of serverless functions:
- Ensures quick deployments following a functional approach
- Enables scaling independent of the core applications
- Gives a possibility to revert changes without causing production system downtime
- Supports the complete asynchronous programming model
- Offers loose coupling of Event providers and consumers
- Enables flexible application scalability and availability
- Your SAP S/4HANA systems may come with limited primary memory which does not allow all the extensions you need to be delivered from the SAP S/4HANA systems.
- Using serverless functions, you can create such extensions without increasing memory consumption and code base of S/4HANA systems.
This blog post demos the usage of Serverless Function which was done in a Proof of Concept for getting the Geocodes of a location based on its address components entered by the user in Business Partner Transaction and updating it in an SAP S/4HANA database.
We are going to follow the sequence of steps listed below. However, if you have already completed some of steps, you can skip them.
- Kyma Environment setup
- Creating first serverless function in Kyma
- Creating trigger and running it on the browser
- Integrating it with SAP S/4HANA system
- Access to SAP BTP Cockpit
You need access to a productive account of SAP BTP Cockpit
This service is available in Trial version of SAP BTP Cockpit
As such, some knowledge is helpful, however, most of the tutorials can be followed without any knowledge.
In this blog post you will learn…
How to Setup your Kyma Account in SAP BTP Cockpit
(If you have already completed setup of Kyma Environment please visit Here for next Steps)
Kyma Environment Setup
Step 1: Configure Kyma Runtime Environment.
Open this link to enter your SAP BTP Account: https://account.hanatrial.ondemand.com/trial/#/home/trial
- In the left side menu, click on “Entitlements” button.
- Enter “Kyma” in the search bar and check whether you have the required entitlements.
If you don’t have the required entitlements, then you need to add them by following the steps below:
- Click Configure Entitlements.
- Press Add Service Plans button to add the ‘Kyma Runtime’ entitlement to your list of entitlements.
- Search for “Kyma”, click the trial checkbox and click on Add Service Plan button on the right.
- Click Save.
- Go to Overview tab on left-hand-side. You should see a tab named Kyma Environment.
Step 2: Enable the Kyma environment
- Click Enable Kyma to activate the Kyma environment.
- In the dialog box, enter the name of Cluster and press Create button.
Note: This step runs as a Background Process to create a new Kubernetes cluster which is being set up. The new cluster contains Kyma runtime and all its components that it will run on. This setup step might take up to 60 mins, so do not worry if you see no action on screen for an hour!
- After the Cluster is created, the below screen will appear where you can see your Kyma environment setup with a Name and Console URL.
Step 3: Assigning User to Role Collection
After Kyma runtime is enabled, the next step is to give your user access to the Kyma console UI. Two different role collections are already created for you in the process of Kyma runtime activation. You just need to assign your user to one or both collections.
The role collections available to you are:
- KymaRuntimeDeveloper role collection with the KymaRuntimeDeveloper role assigned
- KymaRuntimeNamespaceAdmin role collection with the KymaRuntimeNamespaceAdmin role assigned
- On the left navigation panel, click on Security tab and then on Role Collections.
- Click on the KymaRuntimeNamespaceAdmin role collection to see the details of the role.
- Press Edit button to assign your user to this role collection.
- In the Users section, add your user in the KymaRuntimeNamespaceAdmin role. Provide the email address in the ID field.
- Click to add the user to the list.
- Save changes by clicking the Save button.
- You will see that you have successfully given your user the necessary roles.
In this blog post we saw about
- What are serverless functions and need of serverless function.
- SAP BTP Cockpit and how to create your Kyma Workspace in SAP BTP Cockpit.
We are going to see:
how to Create serverless function and deploy them using Kyma
how to Integrate the Kyma serverless function in any SAP S/4HANA applications
For any queries and doubts please comment in comment section I will be more then happy to help you, also you can follow my profile to get updated of new blogs posts.
Hi, will you cover authentication too? How does this compare to Azure functions?
Thank you Shubham