7 Steps to Modernizing SAP Custom Code Effectively

Quick Summary

Modernizing SAP custom code effectively starts with an inventory of every custom object, paired with usage data showing which code is actually used. Teams then assess objects against the target S/4HANA release, prioritize remediation by business value and risk, and govern new code after go-live.

  • Pull usage statistics over a full business cycle, including month-end and year-end runs.
  • Retire unused and redundant custom objects before any remediation begins.
  • Score remediation priority on business criticality, usage, effort and risk of change.
  • Run the SAP Readiness Check and Custom Code Migration app, then review findings with process experts.
  • Re-score priorities at each wave boundary, since retiring one object can change another’s usage.

Table of Contents

Why Custom Code Must Be Modernized Before an S/4HANA Transition

Last Updated: November 2, 2026

Thirty years of custom ABAP code sits inside many SAP ECC systems, and most of it was written for processes that no longer exist.

The answer changes the cost of the whole project. Custom-code transformation is increasingly framed around reducing upgrade findings and making regression cycles more predictable, according to SAP Custom Code Transformation: The Key to Future-Proofing S/4HANA Upgrades.

Here is why the timing matters:

  • Clean core depends on it. SAP’s guidance centers on clean-core extensibility, which means custom code must fit the new model, as described in SAP Custom Code Demo – Migration and Modernization.
  • Migrating bad code moves bad code. Carrying dead objects into S/4HANA adds cost and risk for no business value.
  • Legacy data complicates the picture. Migration of custom code and legacy data may remain complex, as noted in SAP Modernization in 2026: The End of Legacy ERP as We Know It.

Watch out: teams often start the migration before anyone has agreed what the custom code is for. Without that agreement, every object looks equally important, and the project stalls.

Step 1: Build a Complete Custom Code Inventory and Usage Analysis

Start with a full list of every custom object, then measure how often each one runs. An inventory without usage data only tells you what exists, not what matters.

A practical inventory covers:

  • Custom programs, reports, function modules, and enhancements
  • Custom tables and data dictionary objects
  • Interfaces and integration points with other systems

Then pull usage statistics over a meaningful period, typically a full business cycle that includes month-end and year-end runs.

Identifying Unused and Redundant Code

Unused code is the easiest saving in the entire project. Objects that have not run in the observed period are candidates for retirement, pending owner sign-off.

Redundant code is harder. Look for two reports that do nearly the same job, or custom logic that duplicates standard SAP functionality.

The inventory covers four kinds of objects and should be checked against usage data before any remediation begins.

Object type What it covers Why it matters
Custom programs Reports, function modules, enhancements Core logic to assess
Custom tables Data dictionary objects Affect data migration
Interfaces Integration points with other systems Break silently if missed
Business owner Named owner for each object Needed for sign-off

Step 2: Run a SAP Custom Code Assessment Against the Target Release

Next, check every remaining object against the target S/4HANA release. This SAP custom code assessment shows which objects break, which need adaptation, and which work unchanged.

SAP consultant and IT director reviewing code analysis results while modernizing SAP custom code in an office
SAP consultant and IT director reviewing code analysis results while modernizing SAP custom code in an office

Run the assessment early. Results drive the effort estimate, and the estimate drives the budget conversation with leadership.

Using the SAP Readiness Check and Custom Code Migration App

SAP provides tools for this step, including the SAP Readiness Check and the Custom Code Migration app.

Treat the output as a starting list, not a final verdict. Tool findings need review by someone who knows the business process behind each object.

Step 3: Prioritize Remediation by Business Value and Risk

Not every flagged object deserves the same attention, and the order in which you fix them determines whether the project delivers value early or stalls in a long tail of low-impact work.

Build the priority score from four inputs, not two:

  • Business criticality. How much revenue, compliance exposure, or operational continuity depends on the process the object supports. Assign a tier (for example, Tier 1 for revenue-critical and statutory processes, Tier 2 for internal operations, Tier 3 for reporting and convenience).
  • Usage evidence. Runtime frequency, number of active users, and whether the object ran during the last month-end and year-end cycles. An object that runs once a quarter for a statutory report can outrank one that runs daily for a convenience dashboard.
  • Remediation effort. Estimated developer days to adapt, retire, or replace the object, informed by the assessment findings from Step 2. Effort is a cost input, not a value input, keep it separate so a cheap fix does not masquerade as a valuable one.

A practical pattern is to score each object on criticality and usage to produce a value score, then divide by effort and risk to produce a priority index.

Who Owns the Score

Business process owners should sign off on criticality and usage tiers for the objects in their domain. Developers should not decide alone which processes matter most, and process owners should not be asked to estimate effort. Split the inputs by who actually holds the evidence:

  • Process owners confirm business criticality and whether the object still reflects the current process.
  • Application support and operations supply usage statistics and incident history.
  • Development leads supply effort estimates and risk assessments.

A common failure mode is a backlog that ranks by technical severity, gets approved once, and is never revisited. Re-score at each wave boundary, because retiring one object often changes the usage profile of another.

Pro Tip
Keep the scoring model visible in a shared spreadsheet or backlog tool. When a business owner asks why their object is scheduled late, the answer should be a row of evidence, not a developer’s opinion.

A Worked Prioritization Example

Consider three custom objects flagged in the assessment:

  • A custom pricing routine used by every sales order, with high remediation effort because it touches the S/4HANA pricing model. High value, high effort, high risk, assign senior developers and plan a dedicated regression cycle.
  • A legacy ALV report used by two finance users monthly, with low effort to adapt. Low value, low effort, batch it with other reporting fixes or retire it if the standard report covers the need.
  • A custom interface to a third-party logistics provider that runs continuously. High value, moderate effort, schedule early because a failure here stops shipments, and the test plan must include an end-to-end integration test.

Ranking these by findings count alone would likely put the pricing routine and the interface in the same bucket and bury the report. Ranking by value, effort, and risk separates them into different waves with different owners and different test depth.

Contact Us →

Prioritization Outputs to Carry Forward

The section should end with three artifacts, not a single ranked list:

  1. A ranked remediation backlog with owner, effort estimate, and target wave for each object.
  2. A retirement list of objects recommended for decommissioning, with the process owner’s sign-off recorded.
  3. A test scope map linking each high-priority object to the regression test cases that will prove the fix works.

These outputs feed directly into Step 4 (remediation and test safeguards) and Step 5 (transport sequencing), so the prioritization work is not a one-off workshop but the control point for the rest of the project. A complete phase-by-phase SAP data migration project plan with RACI roles and timelines can help you sequence these waves.

Step 4: Execute ABAP Custom Code Remediation with Test Safeguards

Remediation is where most projects lose time. Changes to ABAP custom code must be tested against the business processes they support, not just against the code itself.

Build the test plan before the first change. Regression tests should cover the critical processes identified in Step 3. Each fix should trace back to a test case.

ABAP Test Cockpit Checks and Quality Gates

Set quality gates that a change must pass before it moves forward, using the ABAP Test Cockpit’s automated checks where available.

Gates work only when someone enforces them. Agree on who can override a gate and under what conditions.

Step 5: Plan the SAP Custom Code Migration and Transport Sequence

Transport order decides whether the system works at each stage. Objects depend on each other, so moving them in the wrong order causes failures that look unrelated.

Map dependencies first. Then group objects into waves that can be tested as a unit.

Plan the roles, too. Name a person responsible for each wave, the testers who sign it off, and the business owner who accepts the result.

Measuring Outcomes and Governing Custom Code After Go-Live

The project does not end at go-live. Organisations that keep their SAP landscapes lean tend to treat go-live as the start of an ongoing governance cycle. The goal after cutover is not zero custom code, it is custom code that is intentional, owned, and measured.

Define Baseline and Target Measures Before Cutover

A measure without a baseline is an opinion. Capture the baseline during the inventory and assessment steps so the post-go-live comparison is credible. A practical set of measures includes:

  • Custom object count in use. Baseline: total active custom objects before remediation. Target: a defined reduction, with retired objects recorded and signed off.
  • Assessment findings resolved. Baseline: open findings from the Readiness Check and Custom Code Migration app. Target: findings closed or formally accepted with a documented rationale.
  • Remediation backlog burn-down. Open items by wave, with the trend visible to the steering committee.

Set targets with the business, not for the business. A target of “reduce custom objects by 30 percent” is only meaningful if the process owners agree the retired objects are genuinely redundant.

A Clean-Core Extensibility Decision Framework

Governance after go-live is mostly a sequence of build-versus-buy-versus-extend decisions. Give teams a short decision tree so the answer does not depend on who is in the room:

  1. Can standard SAP functionality meet the need? If yes, configure and retire the custom object.
  2. Can a released clean-core extension point meet the need? Prefer SAP-released APIs, BAdIs, and key-user extensibility over modifying standard objects.
  3. Is the requirement genuinely differentiating? If yes, build a side-by-side extension on SAP BTP rather than modifying the core.
  4. If none of the above apply, document the exception, assign an owner, and set a review date. Exceptions should be rare and visible, not the default path.

This framework is the operational version of clean-core guidance: it turns a principle into a gate that every new development request passes through.

Post-Go-Live Safeguards

Governance without enforcement decays. Put three safeguards in place in the first quarter after cutover:

  • A change review board that meets on a fixed cadence and reviews every new custom object request against the decision framework. Membership should include a process owner, an architecture lead, and an operations representative.
  • A quarterly usage review that re-runs the usage analysis from Step 1. Objects that have quietly become unused are retired, which keeps the codebase from growing back.
  • A transport and monitoring check that confirms custom objects are deployed through the standard transport path, with performance monitoring on the interfaces and reports that carry the highest business criticality.
Watch Out
The most common regression after a successful S/4HANA conversion is not a failed transport, it is the quiet re-accumulation of custom code through ungoverned change requests. Without a review gate, the codebase returns to its pre-project state within a few years.

Report Outcomes to the Business, Not Just to IT

Translate the measures into business language for the steering committee: fewer manual workarounds, faster change delivery, lower regression risk, and a smaller surface area to test at each release.

Review the full measure set at six months and twelve months after go-live. Adjust targets where the baseline proved unrealistic, but keep the measures stable so trends are comparable across releases.

Booking Your Custom Code Assessment with Kagool

Modernizing SAP custom code effectively takes experienced people and proven tools. Kagool brings SAP, Microsoft, and data expertise to the inventory, assessment, and remediation work described above.

Pricing depends on system size, object count, and delivery scope, so contact us for a quote. Learn more about Kagool’s SAP and data transformation services before booking. Contact Us to schedule a custom code assessment for your SAP landscape.

Frequently Asked Questions

How do you assess custom code before an SAP S/4HANA migration?

Start with a complete inventory of custom objects and their usage over a representative period, typically including month-end and year-end runs. Run the SAP Readiness Check and the Custom Code Migration app to identify simplification items and compatibility issues against the target release. Then run ABAP Test Cockpit checks to surface code quality findings. Combine these results with business input to decide which objects to remediate, replace or retire. Pricing for an assessment depends on system size and scope, so request a quote from Kagool for current figures.

How can you identify unused SAP custom code?

Use usage analysis data collected over a long enough window to capture periodic business processes, such as quarter-end or annual reporting. Objects with no recorded executions during that period are candidates for retirement, but each one should be confirmed with the business owner before removal. Redundant objects that duplicate standard functionality or other custom code should be flagged separately. Retiring unused code reduces the remediation effort and the regression testing needed after the upgrade.

How do you prioritize SAP custom code for remediation?

Rank objects by business value and risk together. High-value processes with high technical risk, such as code that fails compatibility checks and supports financial close or production planning, should be remediated first. Low-usage objects with low business value are candidates for retirement. Assign a business owner to each critical process so that remediation decisions reflect operational priorities rather than technical preference alone.

How do you test custom code after an SAP upgrade?

Define regression test cases from the business processes that depend on each remediated object, and run them in a quality system before production deployment. Use ABAP Test Cockpit results as an automated quality gate, and track defects by severity. Keep a documented rollback plan and validate key transactions and interfaces after cutover. Testing scope and effort vary with the number of custom objects and integrations.

GoogleAdd kagool.com as a preferred source on Google →