Clean Core 是 AI 就緒 ERP 的必要代價
Clean Core Is the Price of AI-Ready ERP
Clean Core 已從 SAP 推廣簡報上的理念,轉為企業 ERP 採用 AI 的硬性前提。文中指出,Z 命名空間約 90% 的自訂物件已停用、重複標準功能或可簡單替換,真正具差異化的約佔 10%。Clean Core 並非清除所有自訂程式碼,而是讓自訂邏輯留在核心之外,透過正式發布的 API 與核心連接,並把差異化功能放到 BTP 擴展或可承受升級的擴展點。
Why clean core went from SAP marketing slide to the hard prerequisite for enterprise AI. A story about Klaus, ZSD_ORDER_FIX_V4, and the copilot that went blind.
The retired developer's name was Klaus. He left in 2019. The only documentation for ZSD_ORDER_FIX_V4 is a comment that says // FIXME: remove after 2015 upgrade. It's 2027. The function module still runs every time a sales order hits delivery.
This is how your ERP dies: not with a bang, but with a Z-program nobody understands anymore.
For twenty years, "clean core" lived on SAP marketing slides — politely ignored by every customer with two decades of Z-code keeping the lights on. Custom code wasn't technical debt; it was how the ERP actually fit the business. Then enterprise AI arrived, and the joke stopped being funny. Every copilot, every embedded agent, every "intelligent" feature landing in S/4HANA assumes standard objects, released APIs, and predictable process flows. The customization that made the system yours is precisely what makes it invisible to the tooling everyone is buying.
Why AI Changed the Math
The demo was going fine. The copilot drafted a sales order. It suggested a delivery date. Then the pricing engine fired — three custom user-exits, a Z-table for delivery blocks, and ZSD_ORDER_FIX_V4 wrapping it all in a bow. The copilot didn't error. It didn't warn. It just… stopped seeing. The suggested delivery date was wrong. The pricing was wrong. The order looked clean on screen but would fail in the warehouse.
The CIO asked why. The architect said: "The model was never trained on our Z-logic. The embedded agent can't call unreleased function modules. No amount of prompt engineering teaches it what ZSD_ORDER_FIX_V4 does, because the only documentation is the developer who retired in 2019."
That's the quiet shift: custom code used to cost you at upgrade time, roughly once a year, and the bill was testing effort. Now it costs you continuously — every AI feature, every embedded agent, every "intelligent" anything arrives working for standard processes and shrugging at yours. The extension debt didn't grow, but the interest rate did.
The inventory moment: 90% of Z-objects are dead, duplicate, or trivially replaceable. Only the green string — genuine differentiation — deserves engineering.
Clean Core Is a Boundary, Not a Purge
The misreading of clean core is that it means "no custom code." It actually means: custom code lives outside the core, talks to the core through released APIs, and leaves standard behavior standard. The differentiating logic your business genuinely needs doesn't disappear — it moves to the BTP side of the fence, or into extension points designed to survive upgrades, where it is documented, versioned, and — critically — visible to anything that can read an API.
AI can work with anything that has a contract. It cannot work with folklore. Clean core is the process of turning folklore into contracts.
What's actually in your Z-namespace
| Category | Typical Share | Fate |
|---|---|---|
| Dead, unused | ~45% | Delete. No transport needed. |
| Duplicates standard | ~25% | Retire. Use the standard object. |
| Trivially replaceable | ~20% | Rewrite via public API / BAdI. |
| Genuine differentiation | ~10% | Move to BTP extension / side-by-side. Give it a contract. |
Seen that way, the clean-core exercise is really an inventory question: which of your 4,000 custom objects encode real competitive differentiation, and which encode a 2007 workaround for a limitation SAP fixed in 2015? Every migration assessment we've seen lands in the same place — a decisive majority of custom code is either dead, duplicating standard, or trivially replaceable. The genuinely differentiating slice is small. That slice deserves proper engineering. The rest is just risk with a transport number.
AI reads the contract (left). It cannot read the folklore (right).
Sequencing It Honestly
The trap is treating clean core as a separate virtue project — nobody funds hygiene. It only moves when attached to something the business already wants: the S/4 move, a new AI capability, an operating-model change. The practical sequence is unglamorous:
-
Run the usage audit. Transaction
/UI5/UI2_CUST_ANALYSIS(or your tool of choice) — filter "last executed > 365 days." Those go first. - Delete the dead weight. No ceremony. No "just in case." If it hasn't run in a year, it's not differentiation — it's folklore.
- Apply the forward rule. New logic goes outside the core unless there's a written reason it can't. "We've always done it this way" is not a reason.
- Contract the survivors. For the ~10% that stays: write the OpenAPI spec before you move the code. If you can't describe the interface, you don't understand the requirement.
You don't clean twenty years in one program. You stop making it worse and let attrition work. The companies getting this right aren't the ones with the purest systems. They're the ones who can answer, for any piece of custom logic: what it does, why it exists, and what API would replace it. That answer is what AI-readiness actually looks like in the ERP world. The models will keep improving on their own. Your Z-namespace won't.
Someone still has to document ZSD_ORDER_FIX_V4. The AI won't. The question is whether you do it before the next copilot arrives, or after it fails again.
Stay with us · poll
What's Your Take on ERP Modernization in the Age of AI?
Do you think your organization needs to prioritize cleaning up its ERP core for better AI integration?
No account needed — pick a take, then keep reading. We rotate these prompts so each piece feels like a conversation, not a clone.
Ayraix.com publisher analysis
What we're really seeing
In the era of enterprise AI, the once-neglected 'clean core' of ERP systems has become a critical necessity. Custom code that was once seen as an integral part of business operations is now a hurdle to AI adoption and efficiency.
As Klaus's story illustrates, undocumented legacy Z-code can derail even the most sophisticated AI features. This underscores the importance of revisiting and modernizing ERP systems to ensure they are not only functional but also compatible with emerging technologies like AI.
Keep exploring on ayraix.com
- Why Your SAP Go-Live Is Already 6 Months Late Before It Starts COMMUNITY
- Clean Core ABAP: The Migration Nobody Wants to Do But Everyone Needs COMMUNITY
- The Real Cost of Running LLMs On-Premise (It's Not What You Think) COMMUNITY
Quick check — did this stick?
Question 1 of 3
Originally published on ayraix.com, practical AI for enterprise builders.
來源:DEV Community · dev.to

