This sample provides a Serverless Function configured to call the Material Stock API provided by S/4HANA using the SAP Cloud SDK. This function is exposed as an un-authenticated API.
This sample demonstrates how to:
- Use the S/4HANA API.
- Create a development Namespace in the Kyma runtime.
- Deploy a Serverless Function and an APIRule.
- SAP BTP, Kyma runtime instance
- kubectl configured to use the
KUBECONFIG
file downloaded from the Kyma runtime - S/4HANA System
- Register an SAP S/4HANA Cloud System in an SAP BTP global account.
- Configure the Entitlements for the SAP BTP subaccount.
-
Create a new
dev
Namespace:kubectl create namespace dev kubectl label namespaces dev istio-injection=enabled
-
Apply the Deployment:
kubectl -n dev apply -f ./k8s/deployment.yaml
Within the dev
Namespace:
-
Apply the service instance and binding by running
kubectl -n dev apply -f ./k8s/s4hana-materialstock-instance.yaml
-
Open the
s4hana-materialstock
Function. -
Choose the buttom Add Environment Variable and choose Secret Variable.
-
Provide the value S4_ for the name.
-
Choose the value s4-hana-cloud-0164-binding for the secret.
-
Choose <All Keys>.
-
Choose Create
-
Verify that the Function is up and running:
kubectl -n dev get function s4hana-materialstock
Use the APIRule:
https://s4hana-materialstock.{cluster-domain}/orders
https://s4hana-materialstock.{cluster-domain}/orders/10000001