Still running ECC with heavy custom code? You’re not alone, but time’s running out.
Nearly 90% of SAP ECC customers have not yet completed their S/4HANA migration, despite SAP’s 2027 support deadline (2030 with extended support). One major blocker: custom code.
Customizations, once viewed as a competitive advantage, are now a liability. If your legacy ERP system is held together by years of Z-tables, user exits, and hardcoded workarounds, migration isn’t just a software update; it’s open-heart surgery.
This guide outlines practical, proven best practices to prepare your custom code landscape for S/4HANA.
Why S/4HANA + Custom Code Increases Risk
S/4HANAintroduces architectural changes that impact legacy code:
- Obsolete transactions and tables no longer supported
- Restricted direct database access under HANA
- Deprecated modules creating functional gaps
If your system has 10,000+ custom objects, as is common in manufacturing, finance, and logistics, you need more than a lift-and-shift plan. You need to rethink what’s worth keeping, refactoring, or retiring entirely.
SAP estimates that, on average, only 30-50% of custom code remains relevant in an S/4HANA environment. That means up to half of your custom objects are dead weight.
What SAP Won’t Tell You: The Real Cost of Doing Nothing
The temptation to delay migration is real. But here’s the cost of waiting:
Lost Vendor Support
ECC support ends in 2027 (2030 with fees), but many third-party integrations have already stopped certifying for ECC.
Increased Costs Later
The closer we get to 2027, the higher demand for migration experts will be, and the higher their rates will be.
Regulatory Risk
Unsupported systems create compliance risk, particularly in regulated industries.
Step Zero: Inventory Everything
Before you write a line of remediation code, do an inventory of everything.
- Custom reports
- Z-transactions
- Modified standard objects
- Enhancements and BADIs
- Workflows
- Interfaces and BAPIs
- Batch jobs and background processes
SAP’s Custom Code Migration App (part of SAP Readiness Check) is a solid starting point, but it only scratches the surface. To prep effectively, pair it with tools like:
- ATC (ABAP Test Cockpit) with remote code analysis
- UCON (Usage & Configuration Analysis) for runtime tracking
Advanced AMS tooling for business impact mappingYour Goal: identify what is actively used, obsolete, replaceable, or redundant.
Strategic Custom Code Remediation
Once you know what’s there, you need a remediation plan that’s strategic, not reactive.
Strategy 1: Categorize by Business Value
Classify custom code into:
- Must-Migrate (business essential)
- Replace with Standard (S/4 now includes functionality)
- Retire (no longer used or redundant)
Use Application Management Services (AMS) experts to map code to real-world usage, not just technical logs.
Strategy 2: Modularize for Maintainability
Refactor reusable code into modules or services. This future-proofs your landscape and makes integration with Fiori apps and SAP BTP smoother.
Strategy 3: Pilot in a Sandbox, Not in Production
Run remediation in a standalone sandbox with the S/4HANA Compatibility Scope Viewer to validate impact before touching production.
Strategy 4: Don’t Do It All Yourself
Engage a trusted SAP Consulting Services partner (like TotalTek) to handle:
- Static & dynamic analysis
- Code optimization & simplification
- Functional fit-gap analysis
- Technical retrofit of enhancements

The Role of AMS & PMO in Keeping Migration on Track
Why AMS Matters
Many enterprises assume they can manage S/4 prep internally. But in reality, Application Management Services (AMS) provide:
- Deep knowledge of legacy ABAP customizations
- A dedicated team for code remediation, freeing up internal staff
- Tools to benchmark code performance pre/post-migration
AMS isn’t just for break/fix; it’s a strategic lever in custom code cleanup.
Why PMO Matters
You’ll need Project Management Office (PMO) Consulting to:
- Track migration milestones
- Coordinate across departments (finance, logistics, manufacturing)
- Ensure QA/UAT processes are aligned with SAP timelines
- Flag resource overload or project scope drift early
S/4 migrations with strong PMO oversight have 40% fewer delays and 25% lower overrun risk, according to a 2023 ASUG member survey.
Action Plan: 5 PracticalSteps to Prep for Custom Code Migration
Here's how to move from analysis to execution.
Get a high-level view of affected objects and usage stats.
Step 2: Prioritize by Business Process Criticality
Work with business stakeholders to determine which Z-objects are truly revenue or compliance drivers.
Step 3: Implement ATC + UCON in Shadow Systems
Track real-time usage patterns over 90 days to filter out unused code.
Step 4: Refactor or Retire
For each object:
- Simplify where possible
- Retire if unused
- Modularize if reusable
- Annotate with S/4 compatibility notes
Step 5: Execute Pilot Migration with AMS & PMO Support
Use a representative business unit to test the full end-to-end flow, including code execution, interface mapping, and regression QA.
Measure:
- % of objects auto-remediated
- Effort hours per object
- Defects logged post-pilot
- Cycle time for code migration

Legacy ≠ Liability
The truth is, your custom code isn't the enemy; it’s a record of business innovation. But to bring that innovation into the S/4HANA era, it needs to be audited, trimmed, and rebuilt for resilience.
Migrating to S/4HANA with heavy customization isn’t a checkbox project. It’s a strategic transformation that requires cross-functional alignment, executive sponsorship, and expert technical execution.
With the right combination of SAP Consulting, and PMO support, your custom code can become an asset again rather than a blocker.
Ready to Take Control of Your SAP Custom Code Migration?
Don’t let legacy customizations hold back your digital future.
TotalTek helps enterprises accelerate their SAP S/4HANA journey with integrated AMS support, SAP consulting, and expert-led project execution.