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
- Apply the Deployment:
kubectl -n dev apply -f ./k8s/deployment.yaml
Within the dev
Namespace:
- Choose
SAP S/4HANA Cloud Extensibility
. - Choose Add.
- Choose the
api-access
plan. - Choose the Add Parameters option and provide the communication arrangement JSON. For the material stock example, use the following snippet. Make sure to adjust the systemName parameter.
{
"systemName": "{System Name}",
"communicationArrangement": {
"communicationArrangementName": "INBOUND_COMMUNICATION_ARRANGEMENT",
"scenarioId": "SAP_COM_0164",
"inboundAuthentication": "BasicAuthentication"
}
}
- Choose Create.
- Open the
s4hana-materialstock
Function. - Choose the Configuration tab.
- In the Service Bindings pane, choose the Create Service Binding option.
- Choose the ServiceInstance for the S/4HANA system.
- 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