If you’ve worked in SAP long enough, you’ve likely encountered (or even written) a Z-program. For decades, these custom-coded extensions were used to adapt SAP to fit unique business requirements. Whether it was a custom pricing logic, an additional field in a report, or a unique workflow, Z-code gave companies flexibility that the standard system couldn’t.
However, this flexibility came at a cost. Over time, organisations realised their “custom magic” often became a maintenance nightmare. Each upgrade risked breaking business-critical logic buried deep inside the system. The codebase grew older, the dependencies multiplied, and the pace of innovation slowed.
Now, with SAP S/4HANA and the Business Technology Platform (BTP) defining a new era, it’s time to rethink how extensions should work to modernise and future-proof the system.
The Era of Z-Programs, Powerful but Problematic
Back in the ECC days, custom code (the famous “Z”) was the easiest way to make SAP do what the business needed.
Need a new process? Create a Z-program.
Need a workflow? Add a Z-table.
Need an enhancement? Drop it in a user exit.
It worked beautifully, but over years (sometimes decades) of system evolution, these Z-programs created what many consultants now call “technical debt at scale.”
- Every Z-object depended on internal SAP code, which could change with any update.
- Testing cycles ballooned because each release required regression tests for hundreds of custom objects.
- Developers had to trace obscure dependencies buried in code written years ago by people no longer with the company.
Worse, as more Z-code accumulated, companies began to fear upgrades, turning what should be a strategic enabler into a technical bottleneck.
The biggest problem wasn’t the code itself; it was the philosophy behind it, to tightly couple business logic to the SAP core.
The Cloud Changed the Rules
Then came SAP S/4HANA and the Business Technology Platform (BTP): a new architecture, a new mindset, and a clear message from SAP: “keep your core clean, innovate in the cloud.”
That doesn’t mean stop customising, it means extend intelligently.
With SaaS and continuous upgrades, businesses can’t afford rigid, interwoven custom code that breaks every time the system updates.
SAP BTP provides a modern, flexible platform where you can:
- Build side-by-side extensions that interact with S/4HANA via APIs and events, rather than direct modification.
- Use SAP Integration Suite, Workflow Management, and SAP Build Apps to deliver functionality without touching the core.
- Host apps, services, and automations on a secure, scalable cloud environment, fully integrated with your ERP.
In short, BTP allows enterprises to maintain stability in the core while enabling agility at the edge.
The Modern Extension Model: Clean Core + BTP
Let’s look at how this new model differs from the traditional approach:
| Old ECC Approach | Modern BTP Approach |
| Custom ABAP (Z-code) inside SAP core | Extensions built externally on BTP |
| Tight coupling to SAP internals | Loose coupling through APIs/events |
| High upgrade risk | Upgrade-safe architecture |
| Limited scalability | Cloud-native scalability |
| Monolithic development | Modular, reusable components |
In the BTP world, the idea is simple: keep the digital core (S/4HANA) as standard as possible and move customisation to the Cloud where it can evolve independently.
For example, instead of building a new order-approval logic directly in S/4HANA, you can:
- Expose the order data via API.
- Create an approval workflow using SAP BTP Workflow Management.
- Build a custom UI using SAP Fiori Elements or SAP Build Apps.
- Trigger backend updates through secure event handling.
This approach gives you freedom to innovate, without ever jeopardising the upgrade path or system stability.
And yes, no more “Z” surprises during upgrade testing.
Key Principles for Modern SAP Extensions
To get this transition right, enterprises should rethink not only where extensions are built, but how.
- Adopt an API-First Mindset
Every new development should start with APIs in mind, standard ones where possible, custom OData services where needed. This makes extensions interoperable and upgrade-safe.
- Separate Business Logic from the Core
Keep custom logic on BTP or microservices. Your ERP should remain lean, stable, and focused on transactions, while the cloud handles innovation.
- Leverage Modern UX
The days of SAP GUI screens are over. Use SAP Fiori or SAP Build Work Zone to design intuitive interfaces that users actually enjoy using.
- Ensure Security and Governance
Extensions must follow enterprise security standards. Tools like Identity Authentication Service (IAS) and Cloud Transport Management help enforce governance.
- Iterate and Measure Value
Treat every extension like a product: gather feedback, release updates frequently, and measure business impact (not just technical performance).
How to Start Your Journey
If you’re looking to move from legacy Z-code to modern SAP extensions, start by inventoring your custom code. Use tools like Custom Code Analyser or ABAP Test Cockpit (ATC) to classify Z-programs by usage and complexity. Decide which processes must stay standard, and which need custom handling. Create governance rules to protect the core. Don’t try to migrate everything at once. Start with one or two high-value extensions and prove the model. Invest in BTP, Fiori, and CAP (Cloud Application Programming Model) skills. Establish DevOps and CI/CD for BTP. Automate builds, tests, and deployments to maintain agility across your hybrid landscape.
Final Thoughts
The future of SAP development is about smarter extensibility. Z-programs got us here. But cloud apps will take us further. Modern SAP extensions are about writing smarter, more flexible, and strategically placed code. When you decouple innovation from your core ERP, you don’t just reduce risk, you unlock speed, creativity, and scalability.
And that’s the essence of clean core and cloud extensibility:
Keep what’s essential inside, innovate freely outside, and let your business evolve without friction.
If you need help with modern extensions using BTP, you can hire SAP BTP development consultants at AvoTechs. We’ve supported multiple clients through this transformation. One of our clients had over 1,200 custom Z-programs before starting their S/4HANA journey.
Through a structured assessment and selective replatforming using BTP, we helped them reduce custom code by 40%, improve deployment times from weeks to days, and achieve near-zero issues during the next upgrade.
The strategy is simple: extend only where it adds business value.

