Contact Us
Technical DebtFor Portfolio Paul4 min

The SAP 'Clean Core' Trap: Why Legacy Custom Code Is a 60% CAPEX Tax on Your Next Exit

Legacy SAP custom code can inflate S/4HANA migration costs by 60%. Use this diagnostic framework to assess technical debt and protect your deal value.

Digital illustration of an SAP landscape diagram with red warning indicators highlighting custom code 'Z-objects' versus standard core modules, representing technical debt risk.
Figure 01 Digital illustration of an SAP landscape diagram with red warning indicators highlighting custom code 'Z-objects' versus standard core modules, representing technical debt risk.
By
Justin Leader
Industry
Private Equity
Function
Technology Due Diligence
Filed
January 13, 2026

The Asset That Is Actually a Museum

You are looking at a target manufacturing firm with $50M EBITDA. They run SAP. On the surface, this checks a box: "Enterprise-grade ERP: Yes." Your investment committee nods. It implies maturity, scalability, and process rigor.

But under the hood of that SAP ECC instance lies 15 years of "Z-code"—custom ABAP programs, one-off reports, and hard-coded logic written by a developer who retired in 2019. This isn't just software; it is fossilized process debt.

Here is the reality for 2026: SAP has mandated the move to S/4HANA. The concept of the "Clean Core" is no longer a suggestion; it is an architectural requirement. If your target company has heavily customized their ERP (the "Brownfield" approach), they haven't just bought software; they have built a custom application that happens to be hosted on SAP tables.

The Metric That Matters: Industry data indicates that heavy custom code remediation can inflate S/4HANA migration costs by 40-60%. If you don't price this into your CAPEX model, your first 100 days will be consumed by a multi-million dollar remediation project that generates zero new revenue.

The "If It Ain't Broke" Fallacy

The target's CIO will tell you the system is stable. "It works for us," they will say. And they are right—it works for yesterday's business model. But you aren't buying them to keep them static; you are buying them to scale or integrate.

When you try to integrate that bolt-on acquisition next year, or when you try to implement a modern pricing algorithm, you will hit the "Z-code Wall." Every standard SAP update will break their custom logic. Every integration will require a workaround. You didn't buy a platform; you bought a museum.

The Diagnostic Framework: 3 Metrics for the Data Room

Stop accepting high-level IT architecture diagrams. You need raw data from the SAP production environment. If the CIO refuses to run these checks, treat it as a red flag. It takes less than 48 hours to generate these reports.

1. The Z-Object Count (The Volume Metric)

Ask for a list of all objects in the "Z" or "Y" namespace (Customer Namespace). This is the raw count of customizations.

  • < 1,000 Objects: Healthy. Standard configuration was prioritized.
  • 1,000 - 5,000 Objects: Average. Expect significant remediation costs (~$500k - $1M).
  • > 5,000 Objects: High Risk. The system is likely a "snowflake." Migration will be a full re-implementation (Greenfield) in disguise.

2. The Usage Rate (The Obsolescence Metric)

Volume is one thing; utility is another. Request an output from the SAP SQL Monitor (SQLM) or Usage Procedure Logging (UPL) for the last 12 months.

The Benchmark: consistently, 65% of custom code in legacy SAP environments is unused. It was written for a project that died, a regulation that changed, or a user who left. Yet, you are paying maintenance on it, and you will pay to migrate it unless you identify it now.

If the usage rate of custom objects is below 35%, you have a massive opportunity to "delete your way to value"—but only if you budget for the analysis, not the migration.

3. The S/4HANA Readiness Score

Request the ABAP Test Cockpit (ATC) results filtered for S/4HANA readiness checks. This is not a generic code quality check; it specifically flags code that will break on the new HANA database (e.g., code relying on sorting that HANA doesn't guarantee).

Look for "Priority 1" and "Priority 2" errors. If this number exceeds 500, your timeline for migration just pushed out by 6 months. This is technical debt quantified in man-hours.

Bar chart comparing S/4HANA migration costs: Standard 'Clean Core' migration versus 'Brownfield' migration with heavy custom code, showing a 60% cost increase.
Bar chart comparing S/4HANA migration costs: Standard 'Clean Core' migration versus 'Brownfield' migration with heavy custom code, showing a 60% cost increase.

Turning Diagnostics into Deal Terms

You have the data. Now, how do you protect the exit?

First, adjust the Enterprise Value (EV) or working capital targets based on the "Cost to Clean." If the ATC report shows 2,000 critical errors and the usage logs show 80% obsolescence, do not budget for a "lift and shift" migration. Budget for a "Greenfield" implementation, which is often 2x the cost but delivers 4x the long-term value.

Second, mandate the "Clean Core" in the 100-Day Plan. Do not let the legacy IT team convince you to port the custom code to the cloud "for now." That is kicking the can down the road to a future where it weighs more.

The Buyer's Edge: Most acquirers look at SAP license costs and hosting fees. They miss the application lifecycle maintenance (ALM) costs of custom code. By quantifying this debt, you can argue for a specific indemnity or a lower price, citing the immediate CAPEX required to bring the platform up to industry standards.

You want to buy a business that runs on SAP, not a business that is run by a customized, fragile instance of SAP. There is a difference. The former is an asset; the latter is a liability disguised as code.

For more on how technical debt impacts deal terms, read our Technical Debt Quantification Framework and check the 10 Red Flags in Tech Due Diligence. If you are already in the thick of it, review our analysis on the true cost of failed ERP implementations.

Continue the operating path
Topic hub Technical Debt Quantification in dollars, not adjectives. Then a remediation plan that runs in parallel with delivery. Pillar Turnaround & Restructuring Technical debt is real money. Once you can name it as a number — its impact on velocity, EBITDA, and exit multiple — it stops being a vague engineering complaint and becomes a board agenda item. Service Transaction Advisory Services Operator-led buy-side and sell-side diligence for technology middle-market deals. Financial rigor, technical diligence, and integration risk in one workstream. Service Valuations Defensible valuation work for SaaS, services, IP, ARR/MRR, cap tables, and exit readiness in technology middle-market transactions. Service Performance Improvement Revenue, margin, delivery, technical debt, and operating-system improvement for technology firms with stalled growth or compressed EBITDA.
Related intelligence
Sources
  1. SAP Custom Code Migration Guide (2025) - Official benchmarks on remediation efforts.
  2. Resulting IT: 7 Coding Considerations for S/4HANA - Analysis of Brownfield vs. Greenfield code strategies.
  3. Pillir: How to Eliminate Technical Debt in SAP - Data on the Technical Debt Index (TDI) and cost implications.
Move on this

A 14-day operator-led diagnostic, before the gap is priced into your multiple.

No retainer until we agree on the work.

Request a Turnaround Assessment →