Sub topic 15
Governance and Lifecycle of Extensions
This chapter assumes you know the clean core principle, released APIs, the clean core levels A to D, and the three extension options (in-app, developer, and side-by-side). It also assumes you have seen a CAP service that consumes an S/4HANA API through a destination. Here you learn how to keep extensions clean after the first go-live.
Why governance is needed
A clean core is not a state you reach once. Every new request adds an extension, and each one can add a dependency on something that SAP may change. Without rules, teams drift back to the habits the clean core principle was meant to remove: unreleased objects, copied data, and extensions nobody owns.
Governance is the set of rules, checks, and roles that keep each extension within the agreed clean core level over its whole life. It has three goals:
- Prevent new extensions from breaking the core.
- Make existing extensions visible, owned, and classified.
- Detect drift early, before an upgrade exposes it.
The extension lifecycle
Every extension moves through the same stages. Governance adds a checkpoint at each stage.
| Stage | Governance checkpoint | Typical evidence |
|---|---|---|
| Request | Is an extension needed, or can standard configuration solve it? | Fit-gap note |
| Design review | Which extension option and which clean core level? | Decision record |
| Build and test | Does the code use only released APIs? | Automated check results |
| Operate and monitor | Is the extension still compliant and owned? | Inventory entry, usage data |
| Retire | Is the extension still used? Can standard now replace it? | Decommission ticket |
Decision records
At design review, write down why you chose an approach. A short decision record is enough. It should contain:
- The business requirement.
- The options you considered, such as in-app, developer, or side-by-side.
- The chosen option and the target clean core level.
- The released APIs and events the extension depends on.
- The owner and the date of the next review.
Decision records matter during upgrades. When SAP announces a change, the team can search the records for the affected API instead of reading code.
Keeping an inventory
You cannot govern what you cannot list. Keep an inventory with one entry per extension. Useful fields are:
- Name and business purpose
- Extension option and clean core level (A to D)
- Technical owner and business owner
- Consumed released APIs, with versions
- Consumed events
- Destinations and technical users it relies on
- Runtime and subaccount
- Date of last review
Many teams hold this in a configuration management database or a simple repository file. The format matters less than the habit of keeping it current.
Automating the checks
Manual reviews do not scale. Move as many checks as possible into tooling.
In ABAP Cloud development
Developer extensibility enforces the clean core boundary in the language itself. ABAP Cloud development only allows access to released objects. ABAP Test Cockpit (ATC) checks can be run in the development pipeline to flag use of unreleased objects. Treat ATC findings as a gate: a finding in a cloud-ready check variant should block a transport from moving on.
In side-by-side projects
For CAP projects there is no compiler that rejects an unreleased API. The check is a convention you enforce yourself. Keep every imported API definition in one folder, for example srv/external, and review changes to that folder in pull requests. A reviewer can then confirm each imported model comes from SAP Business Accelerator Hub and is marked as released.
You can also automate part of this check. The script below lists imported API models and fails the build if the folder contains a file that is not on an approved list. It runs with Node.js.
const fs = require('fs')
const path = require('path')
const folder = 'srv/external'
const approved = new Set([
'API_BUSINESS_PARTNER.edmx',
'API_BUSINESS_PARTNER.csn',
'API_BUSINESS_PARTNER.json'
])
if (!fs.existsSync(folder)) {
console.log(`Folder ${folder} not found, nothing to check.`)
process.exit(0)
}
const unknown = fs.readdirSync(folder)
.filter(file => fs.statSync(path.join(folder, file)).isFile())
.filter(file => !approved.has(file))
if (unknown.length > 0) {
console.error('Imported models that are not on the approved list:')
unknown.forEach(file => console.error(` - ${file}`))
process.exit(1)
}
console.log('All imported API models are approved.')Run it in your pipeline before the build step. When a developer needs a new API, they add it to the approved list in the same pull request. The reviewer then checks the API's release state at the same time.
Handling API deprecation
Released APIs are stable, but they are not permanent. SAP publishes a lifecycle state for each API. A deprecated API still works for a defined period. After that period, it can be removed in a later release.
A practical routine has four steps:
- Subscribe to release notes and deprecation notices for the APIs in your inventory.
- When an API is deprecated, find every extension that uses it with the inventory.
- Plan the move to the successor API as a normal backlog item with a deadline before the decommission date.
- Update the inventory and decision record once the change ships.
For OData APIs, a new version may rename fields or change behavior. Re-import the API model and run your tests. Because the CAP projection from earlier chapters lists the fields it uses, a removed field shows up as a compile error instead of a production failure.
Upgrade readiness
S/4HANA Cloud receives updates on a fixed schedule. Side-by-side extensions do not move with those updates, so they need their own regression tests.
Build a small test set that calls each consumed API through the destination and checks the response shape. Run it:
- On every change to the extension.
- After each S/4HANA release in a test or preview system, before the release reaches production.
This turns an upgrade from a surprise into a scheduled check. Extensions at level A and B should pass without changes. A failing test points to either a deprecated API or a hidden dependency that lowers the level.
Operating side-by-side extensions
An extension on SAP BTP also has its own operational surface. Governance has to cover it.
| Area | What to govern | Common failure |
|---|---|---|
| Destinations | Named per system, owned, documented | A destination points to the wrong tenant after a copy |
| Technical users and secrets | Rotation schedule and minimal authorizations | A shared user with broad rights, never rotated |
| Role collections | Mapped to business roles, reviewed regularly | Leavers keep access |
| Subaccounts | Separate development, test, and production | Testing against production data |
| Runtime and dependencies | Patching of Node.js, libraries, and buildpacks | Outdated libraries with known vulnerabilities |
| Monitoring | Logs, alerts, and health checks | Failures found by users first |
Roles and responsibilities
Governance fails when everyone assumes someone else is responsible. Assign these roles explicitly:
- Extension owner: accountable for one extension, its inventory entry, and its retirement.
- Architecture review group: approves the extension option and clean core level at design review. It should answer quickly, or teams will bypass it.
- Platform team: runs the BTP subaccounts, destinations, and shared pipelines.
- Business owner: confirms the extension is still needed.
Measuring drift
Pick a few measures and report them on a regular schedule:
- Number of extensions by clean core level (A, B, C, D).
- Number of extensions that depend on a deprecated API.
- Number of extensions without a named owner.
- Number of ATC findings open for unreleased object usage.
- Extensions not reviewed within the agreed period.
A rising count of level C or D extensions is the earliest sign that the process is being bypassed. Treat level C and D entries as debt. Give each one a target date to move up a level or retire.
Retiring extensions
Retirement is the stage teams skip. Review usage at least yearly. If an extension is unused, or if SAP now ships the same function as standard, retire it. Remove its destinations, role collections, technical users, and subscriptions, then mark the inventory entry as retired. Leftover credentials are a security risk even when the application is stopped.
Common errors
- Treating the first review as the last. Approval at design time says nothing about the state two releases later.
- Governing only the code. Destinations, secrets, and role mappings drift as often as code does.
- No owner. An extension without an owner will not be migrated when its API is deprecated.
- Blocking everything. A review process that takes weeks pushes teams toward workarounds. Define a fast path for low-risk, level A extensions.
- Counting only new extensions. Existing custom code from earlier releases is usually the larger risk.
Exercise
Your team's inventory shows a side-by-side extension that reads the Business Partner API through destination S4HC_BP. SAP announces that the API version you use is deprecated. List the steps you take, in order, and name two things you update afterwards.
Show answer
First, use the inventory to confirm which extensions consume the deprecated API. Second, check the deprecation notice for the successor API and the decommission date. Third, schedule the migration as a backlog item with a deadline before that date. Fourth, re-import the new API model, adjust the projection and handlers, and run the regression tests against a test S/4HANA system. Finally, deploy and verify. Afterwards, update the inventory entry (API and version) and the decision record.
Exercise
A reviewer finds an extension with a technical user that has broad rights and has not been rotated in two years. Which governance area is affected, and what two changes reduce the risk?
Show answer
The area is technical users and secrets. Reduce the risk by rotating the credential and limiting its authorizations to what the extension needs. Where the API supports it, switch to user propagation so that S/4HANA authorizations apply per person.