How to Prepare SAP Custom Code for S/4 HANA

Subscribe to our Blog

Stay ahead in the industry! Subscribe to our blog for the latest insights and expert tips.
Share this article:

What if the biggest threat to your S/4HANA migration isn’t budget or timeline, but your custom code? For years, businesses have relied on custom SAP code to achieve competitive differentiation. But as the shift to S/4HANA accelerates, this very customization can become a bottleneck or worse, a liability. With SAP ending mainstream support for ECC by 2027, companies in North America and beyond are on a tightrope: modernize fast, or risk technical debt piling up. 

Yet many organizations underestimate the extent of preparation required for custom code during a migration. According to SAP’s internal benchmarks, over 50% of the custom ABAP code used by ECC customers is either unused or non-compliant with S/4HANA standards. 

This blog offers a clear, expert roadmap to prepare your SAP custom code for migration, focusing on actionable strategies, relevant statistics, and long-term value. It reflects TotalTek’s deep experience across SAP Consulting Services, Application Management Services (AMS), and Digital Transformation Services for enterprise clients in the U.S. and Canada. 

Why S/4HANA Requires a Rethink of Custom Code 

S/4HANA isn’t just a technical upgrade; it’s a paradigm shift. 

Unlike ECC’s architecture, S/4HANA introduces a simplified data model, new Fiori UX, and revised business logic. These changes often render existing custom code obsolete or incompatible. Ignoring this can lead to: 

  • Code dumps and failed transactions
  • System instability
  • Higher testing and remediation costs
  • Regulatory and operational risk
     

What worked in ECC may not only fail in S/4HANA, but it may also break your core business processes. 

Step 1: Inventory & Analyze Your Custom Code 

Start with data. You need complete visibility into your existing custom developments. 

Actionable Strategy 

Use the SAP Custom Code Migration Worklist (CCLM) and SAP Readiness Check tools to assess: 

  • Which custom objects are used vs. unused
  • Which ones are incompatible with S/4HANA
  • Dependencies on deprecated transactions or obsolete data structures 

Insight 

SAP analysis of customer systems shows that over 60% of Z-code is never executed in production. Eliminating or archiving unused code significantly reduces risk and cleanup costs. 

Step 2: Segment Your Custom Code by Priority 

Once you’ve mapped your codebase, categorize each object based on: 

  • Business Criticality: Does this directly impact operations or compliance?
  • Complexity: Does it require extensive rework or logic revision?
  • S/4HANA Compatibility: Is it entirely compatible, partially compatible, or broken? 

Expert Tip 

Adopt a three-tier strategy: 

Segment  Action Plan 
High Priority  Refactor and retest in advance 
Medium  Review and rework during the sandbox 
Low/Unused  Decommission or archive

Step 3: Refactor for the New Architecture 

One of the most significant changes in S/4HANA is the introduction of the Universal Journal (ACDOCA) and the replacement of numerous aggregate and index tables. This means that custom code using tables such as BSEG, BSIS, or VBRK may no longer be effective. 

Refactor Touchpoints 

  • Replace SELECT statements on obsolete tables.
  • Update logic to reflect new CDS Views or APIs
  • Replace classic BAPIs and user exits with Business Add-Ins (BAdIs) or In-App Extensibility
  • Ensure performance aligns with HANA’s in-memory computing principles 

Stat Check 

According to SAPinsider, 77% of companies that conducted early custom code remediation reduced downtime by over 40% during cutover. 

image1 copy
 

Step 4: Embed Code Remediation in Your Project Plan 

One common mistake? Treating custom code remediation as a “side task” or delaying it until testing. 

Instead, embed it early into your Project Management Office (PMO) planning process. Align with internal stakeholders, from IT to compliance to business units. 

Strategic Advice 

  • Assign code owners and remediation leads.
  • Build sprint-based remediation cycles with agile tracking
  • Use AMS partners for code cleanup, parallel to core implementation 

TotalTek often integrates SAP Consulting Services with PMO support, ensuring that remediation doesn’t derail timelines. 

Step 5: Future-Proof with Clean Core Principles 

Even after remediation, resist the urge to rebuild a “Frankenstein” version of ECC in S/4HANA. This is your opportunity to streamline. 

Implement 

  • Clean Core Strategy: Minimize core modifications, favor extensibility options
  • Side-by-Side Extensions: Use SAP BTP (Business Technology Platform) for custom apps
  • Governance: Introduce policies for custom code management going forward 

Pro Insight 

Companies that limit core customization see 20–30% lower future upgrade costs, according to ASUG’s 2023 digital transformation survey. 

Step 6: Validate, Test, and Optimize 

Once the code is remediated, rigorous validation is essential. 

  • Unit test every object with realistic data
  • Conduct integration tests to catch cross-functional issues
  • Use SAP ABAP Test Cockpit (ATC) to enforce quality and performance standards. 

Bonus: Use Code Push-Down Where Possible 

Refactor performance-critical logic into HANA-optimized SQL and views. This aligns with SAP’s performance-first philosophy and can drastically improve response times. 

Strategic Stats Snapshot: S/4HANA Custom Code Reality 

Metric  Insight 
50–60%  Average % of unused custom code in ECC systems 
77%  Companies that reduced downtime with early remediation 
2x  Cost increases when remediation is deferred until the test phase 
30%  Potential reduction in TCO by implementing the Clean Core strategy

Who Should Own the Custom Code Strategy? 

While IT leads remediation, business users must validate functionality. A cross-functional governance model is key: 

IT Architects 

Ensure compatibility and performance 

Functional Leads 

Validate process logic 

Compliance Teams 

Sign off on regulated code 

PMO 

Track and align with overall project milestones 

Partnering with a firm like TotalTek, which combines Application Management Services (AMS) and Digital Transformation Services, can offer continuity, risk reduction, and scalability. 

Future-Proof Your S/4HANA Journey with the Right Code Foundation 

Preparing SAP custom code for S/4HANA is not a one-time checklist; it’s a strategic transformation initiative. Done well, it strengthens system stability, reduces long-term costs, and opens the door to true digital agility. 

By taking a structured, data-informed, and cross-functional approach, companies can turn a migration risk into a competitive advantage. 

Ready to Build a Clean, Modern SAP Core? 

At TotalTek, we guide clients through high-stakes SAP transitions with clarity and technical precision. Whether you need expert code remediation, AMS support, or full-scope digital transformation services, our integrated approach ensures you’re not just S/4HANA-ready, but future-ready. 

Learn more about our SAP Consulting Services at www.totaltek.com 


The Evolving IT Buyer Report

Today’s IT buyer has changed—has your strategy? In “The Evolving IT Buyer” report, we explore how IT buying behavior has shifted post-pandemic—and what vendors must do to earn trust and stand out. 

Heading 1

with a request body that specifies how to map the columns of your import file to the associated CRM properties in HubSpot.... In the request JSON, define the import file details, including mapping the spreadsheet's columns to HubSpot data. Your request JSON should include the following fields:... entry for each column.

© Copyright 2025, All Rights Reserved.