Sub topic 9
Choosing a BTP runtime for your extension
This chapter helps you pick where a side-by-side extension runs on SAP Business Technology Platform (BTP). It assumes you know the three extension options from earlier chapters, can read a CAP project like the PartnerReview example, and know what a container and an OAuth 2.0 token are. Kubernetes knowledge helps but is not required.
Why the runtime is a separate decision
The clean core principle tells you to build outside the S/4HANA core and to call only released APIs. It does not tell you what to run your code on. BTP offers three runtime options for side-by-side work:
- The Cloud Foundry environment.
- The Kyma environment.
- The ABAP environment.
All three reach S/4HANA through destinations and released APIs, so your choice does not change how clean the core stays. It changes four things:
- The language and programming model you use.
- How much infrastructure you operate.
- Which team can maintain the extension.
- How the extension is packaged and deployed.
Choose the runtime early. Moving later means rewriting deployment descriptors, and with the ABAP environment it means rewriting the code.
The three runtimes
Cloud Foundry environment
Cloud Foundry (CF) is a platform-as-a-service. You push an application and the platform builds and runs it from a buildpack. A buildpack is a platform-supplied script that detects your language, installs the runtime, and starts the app. You do not manage containers or clusters.
Key traits:
- Node.js and Java are first-class. This is the default home for CAP applications.
- You package a multitarget application (MTA) with an
mta.yamlfile. It describes modules (your code) and resources (service instances such as Destination or XSUAA). - You deploy with the
cf deploycommand. - Service instances bind to the app and inject credentials through the
VCAP_SERVICESenvironment variable. CAP reads this automatically. - Scaling is simple: you set instance count and memory per app.
CF suits teams that want the shortest path from CAP code to a running service and do not need custom containers.
Kyma environment
Kyma is SAP's managed Kubernetes runtime, based on the open-source Kyma project. You work with containers, Helm charts, and Kubernetes resources, and SAP manages the cluster.
Key traits:
- You can run any language that fits in a container image, not only Node.js and Java.
- You can deploy lightweight serverless functions as well as full containers.
- An API Rule exposes a service to the internet and can secure it.
- Eventing is built in. Kyma subscribes to events and delivers them to your workload over HTTP, which suits the event-driven chapter later.
- You need to understand deployments, services, secrets, and namespaces.
Kyma suits teams that already use Kubernetes, need containers or polyglot services, or want one cluster for many small extensions.
ABAP environment
The ABAP environment (also called Steampunk) is a managed ABAP system on BTP. You develop in ABAP Cloud with the ABAP RESTful Application Programming Model (RAP). It is not a Node.js or Java platform.
Key traits:
- Your existing ABAP developers write the extension in their own language.
- Only released APIs and a restricted ABAP language version are available, which enforces clean core by design.
- You develop in ABAP Development Tools for Eclipse.
- It has its own system lifecycle and licensing, so it is heavier than a small CF app.
Do not confuse it with developer extensibility. Developer extensibility with ABAP Cloud runs inside the S/4HANA system (on stack). The ABAP environment is a separate system that calls S/4HANA remotely (side-by-side).
Comparing the runtimes
| Criterion | Cloud Foundry | Kyma | ABAP environment |
|---|---|---|---|
| Main skill needed | Node.js or Java with CAP | Containers and Kubernetes | ABAP and RAP |
| Packaging | MTA archive | Container image and Helm chart | ABAP software components |
| Infrastructure effort | Low | Medium to high | Low to medium |
| Language freedom | Buildpack languages | Any containerized language | ABAP only |
| Event handling | Via Event Mesh or similar service | Built-in eventing | Via enterprise event enablement |
| Typical use | CAP services, UIs, workflows | Microservices, functions, polyglot | ABAP-skilled teams, RAP apps |
Deploying the same CAP project to two runtimes
The PartnerReview project from the previous chapters is runtime-neutral. CAP generates deployment files for the target you choose. The commands below add CF descriptors, build an MTA archive, and deploy it.
# Add MTA descriptor, authentication and destination service configuration
cds add mta,xsuaa,destination
# Build the archive (requires the MBT tool) and deploy to Cloud Foundry
mbt build -t gen --mtar mta.tar
cf deploy gen/mta.tarFor Kyma, you generate a Helm chart instead and deploy container images:
# Add a Helm chart for Kubernetes and Kyma deployment
cds add helmAfter cds add helm, you build container images, push them to a registry, and install the chart with Helm. The CAP code and the remote service configuration stay the same. Only packaging and service binding differ.
Connectivity and authentication across runtimes
All three runtimes use the Destination service for outbound calls. Your code asks for a destination by name, and the service returns the URL and authentication data. Two points matter when you choose a runtime:
- Cloud Foundry and Kyma both support destinations for OAuth 2.0 and for principal propagation (forwarding the logged-in user's identity to S/4HANA).
- For an on-premise S/4HANA system, you add the Cloud Connector and a connectivity service instance. Plan this per runtime, because service bindings are configured differently.
Decision criteria
Work through these questions in order.
- Who will maintain it? If the team knows ABAP and not JavaScript or containers, the ABAP environment is likely best. If the team knows CAP, use CF or Kyma.
- Does it need a custom runtime? If you need a language or library that no buildpack supports, or a binary that must run in a container, use Kyma.
- How much platform work will the team accept? If the team wants none, use CF. Kyma requires you to manage Kubernetes manifests, namespaces, and image pipelines.
- Is it event-heavy or composed of many small services? Kyma's eventing and service model fits this well. CF works too, but you add messaging services yourself.
- Does the organization already have a standard? If the company runs other workloads on Kyma or CF, follow it. Consistent operations and monitoring are worth more than a marginal technical gain.
Common mistakes
- Picking Kyma for a single small CAP service. You take on Kubernetes operations for no benefit. CF is usually quicker.
- Using the ABAP environment when you meant developer extensibility. If your logic must run inside S/4HANA transactions, such as validations in the same commit, a remote system cannot do that. Use in-app or developer extensibility instead.
- Putting business logic in the runtime configuration. Keep it in CAP services, so the runtime stays replaceable.
- Ignoring subaccount boundaries. Destinations, service instances, and role collections belong to a subaccount. A runtime in one subaccount cannot see another subaccount's destination.
- Assuming the runtime affects clean core. It does not. A CF app that calls unreleased internals breaks the contract just as a Kyma app does.
Exercise
A team of ABAP developers must build a small approval application that reads business partners from S/4HANA Cloud through a released API. They have no JavaScript or Kubernetes experience. Which runtime fits best, and what is one reason it would be wrong if the approval logic had to run in the same database transaction as an S/4HANA posting?
Show answer
The ABAP environment fits best, because the team can use ABAP Cloud and RAP and still call the released API through a destination. A side-by-side app runs in a separate system and calls S/4HANA remotely. It cannot take part in the same database transaction as an S/4HANA posting. That logic would need in-app or developer extensibility inside S/4HANA.
Exercise
You have a working CAP service on Cloud Foundry and a new requirement to run it on Kyma. Name what stays the same and what changes.
Show answer
The CDS model, the service handlers, the remote service definition for API_BUSINESS_PARTNER, and the destination name S4HC_BP stay the same. The packaging and deployment change: you generate a Helm chart with cds add helm, build container images, and bind services through Kubernetes secrets instead of using an MTA archive and cf deploy.