← All posts

ABAP Code Remediation

Retire Before You Rewrite: Shrink Your S/4HANA Scope

Retire Before You Rewrite: Shrink Your S/4HANA Scope

Rewriting code nobody runs is the most avoidable cost in a migration, and SAP HANA Optimization suffers when teams tune programs nobody calls. Yet most teams do it. They inherit a custom code repository with years of accumulated reports, user exits, and interfaces, then assume every object needs attention. Smarter planning starts with execution evidence. 2iSolutions US has delivered SAP work since 2005, and the pattern repeats: a large share of custom code never runs, and the team that proves it saves real money.

This post explains how an evidence-backed retirement list works, why retirement does not need a full migration, and how to turn the results into a tighter project plan.

What Is Execution Evidence and Why Does It Shrink Scope?

Execution evidence is usage data that shows which custom objects actually ran in your production system, how often, and by whom. It shrinks scope because every object with no recorded use becomes a retirement candidate instead of a rewrite task. Fewer objects in the plan means lower cost and lower risk.

Most scoping exercises rely on static analysis alone. A scan finds every custom object that breaks under S/4HANA rules, and the resulting list looks enormous. But a list of broken objects says nothing about which ones matter. Still, a report that fails the compatibility check yet has not run since 2019 does not deserve a rewrite.

Execution evidence changes the question. Instead of asking "what breaks?", you ask "what breaks and still gets used?" That second list is usually far shorter.

Where the evidence comes from

Usage statistics live in several places inside a running SAP system. Teams combine them to build a defensible picture.

  • Workload statistics that record transaction and report calls over time
  • Usage logs for custom function modules and classes
  • Job scheduling records that show which batch programs still run
  • Interface monitoring that reveals active inbound and outbound connections

No single source tells the whole story. A program might never appear in dialog statistics but run nightly as a background job. Cross-checking sources prevents the one mistake that makes retirement scary: deleting something that turns out to be needed at quarter end.

Why static analysis alone misleads teams

Static analysis is a scan of source code that flags objects incompatible with the target release. It answers a technical question well. It cannot answer a business one.

Consider a mid-sized manufacturer with several thousand custom objects. The scan flags a few hundred as affected. The project manager sees that number, multiplies by an average rewrite effort, and the budget balloons. Nobody asks how many of those objects have any users. Once the team checks, a big portion turns out to be dead weight from old projects, test programs, and reports built for people who left years ago.

How an Evidence-Backed Retirement List Works

An evidence-backed retirement list is a documented inventory of custom objects proposed for removal, each paired with usage data and a recorded reason. It works because every deletion decision carries proof, so business owners can approve it with confidence instead of guessing.

The process follows a clear sequence.

  1. Run a full-repository break analysis to find every custom object affected by S/4HANA changes.
  2. Collect execution evidence across a full business cycle, including year-end and seasonal peaks.
  3. Match each broken object against its usage record.
  4. Classify objects as retire, rewrite, or review.
  5. Send the retire list to business owners for sign-off.
  6. Log the decisions so auditors and architects can trace them later.

Step two deserves attention. A month of data misses the annual close. Twelve months or more catches the odd report that finance runs once a year. Short windows create false retirement candidates, and false candidates destroy trust in the whole list.

What a good list entry looks like

Each entry should name the object, its package, the last recorded execution, the call count, and the owner who approved removal. For example, a custom pricing report with zero calls in thirteen months and an owner who confirms the team replaced it with a standard Fiori app is an easy call. Another entry might show a rare call pattern tied to an audit process. Because of that, it moves to the review bucket.

Handling the review bucket

The review bucket is where judgment lives. Objects land there when usage is low but not zero, or when the owner cannot be found. Do not let this bucket grow unchecked. Assign each item a named reviewer and a deadline, because an unowned review list quietly becomes a rewrite list.

Owner hunting is often the slowest part. Original developers have moved on, and business sponsors have changed roles. In those cases, check who last executed the object. A user name in the log gives you someone to call.

Why Retirement Can Happen Without a Full Migration

Retirement does not depend on moving to S/4HANA first. You can delete unused custom code in your current ECC system today, because removal needs only usage evidence and a normal transport process. So doing it early shrinks the repository before the migration clock starts.

This matters for planning. Many organizations treat cleanup as a project phase that begins after the migration contract is signed. That order costs more. Consultants billed by the day spend their first weeks on objects that never needed to move.

Cleaning first flips the economics. The team that arrives for the migration finds a smaller, healthier system. Testing cycles shrink because fewer objects need regression checks. Cutover rehearsals run faster because fewer interfaces need validation.

A safe way to delete

Deletion should never feel like a leap. A staged approach keeps the risk low.

  1. Lock the object first so nobody can run it, but keep the code in place.
  2. Wait one full business cycle and watch for complaints.
  3. Transport the deletion through the normal environment.
  4. Keep an archive copy of the source for a defined period.

Locking before deleting gives you a cheap undo button. If a user objects, you unlock the object in minutes. If silence lasts through year-end, the deletion proceeds with real confidence.

Where outside help fits

Some teams run this alone. Others bring in partners for the analysis because the tooling and pattern knowledge speed things up. Ongoing SAP Support Services can also cover the monitoring work that keeps evidence collection running while internal staff focus on daily operations. Whoever does the work, the principle holds: prove first, delete second.

How Retirement Results Reshape Your Project Plan

A smaller scope changes more than the effort estimate. It changes the timeline, the team mix, the testing plan, and the conversation with the steering committee. Retirement results give you real numbers to replace the padded guesses that usually fill an early plan.

Start with effort. Every object removed from the rewrite list saves analysis, development, unit testing, and integration testing. Those savings compound because testing effort grows faster than code volume. A smaller repository means fewer test scripts, fewer defects, and fewer late surprises.

Next, look at the team. A leaner scope may need fewer ABAP developers and more functional analysts to confirm business processes. That shift affects hiring, and it affects budget lines. Teams that plan for the new mix avoid paying for skills they will not use. Planners comparing transformation approaches can also review KPMG S/4HANA transformation services to see how large advisory firms frame scope and team structure.

Setting realistic milestones

Evidence also sharpens milestones. Instead of promising that all custom code will be "assessed" by a given date, you can commit to measurable outcomes.

  • A signed retirement list covering every flagged object
  • A rewrite list with effort estimates per object
  • A review list with owners and deadlines
  • A cutover plan sized to the reduced interface count

Steering committees respond to specifics. A statement like "we retired the objects with no usage and cut the rewrite list substantially" lands better than a vague promise of progress.

Using the retired list to guide design choices

Retirement also reveals what the business stopped needing. If five custom reports were replaced years ago by standard functionality, that tells you users already prefer standard. Use that signal in design workshops. Push back on requests to rebuild custom logic when the evidence shows people moved on.

Connecting Scope Reduction to Data and Platform Decisions

Scope reduction affects more than code. Fewer custom objects mean fewer dependencies on tables, interfaces, and reports, and that opens up choices about the data layer and the target platform. You can design the new system around what the business uses today rather than what it used a decade ago.

Reporting is a good example. Many custom reports exist only because the old system could not answer a question quickly. A modern SAP Data Warehouse approach often replaces dozens of those reports with governed, reusable models. Evidence tells you which reports have active readers, so you rebuild only those and retire the rest.

Performance work benefits too. Teams planning SAP HANA Optimization often waste effort tuning custom programs that nobody calls. Retire those programs first, then tune what remains. The tuning budget then goes to code that affects real users.

Choosing the target deployment

The retirement list also feeds hosting and rollout decisions. A smaller custom footprint makes a move to SAP S/4HANA Cloud Private Edition easier to justify, because fewer extensions need to fit within the cloud operating model. Teams exploring SAP cloud migration services can start the conversation with a clean inventory instead of an unfiltered scan.

Resourcing follows the same logic. A project that needs delivery muscle on short notice can draw on SAP Implementation Services USA once the scope is firm. Hiring before the scope settles often means paying for roles the project later drops.

Governance after go-live

Retirement should not be a one-time event. Custom code grows back unless someone owns it. Many organizations set up an SAP Center of Excellence in USA to review new requests, track usage, and prune unused objects every year. That habit keeps the repository small and the next upgrade cheap.

A yearly review needs only a few steps. Pull the usage data, compare it against the object list, flag anything dormant, and send it to owners. The routine takes days, not months, and it prevents the slow build-up that created the problem in the first place.

Common Mistakes That Undermine Retirement Efforts

Even well-run retirement programs stumble in predictable ways. Knowing the traps lets you avoid them before they cost time or credibility.

The first mistake is a short observation window. A team collects usage for six weeks, retires everything silent, and then hears from finance in March that the year-end consolidation report has vanished. One incident like that can freeze the whole program. Collect at least a full year when you can.

The second mistake is skipping business sign-off. Technical teams sometimes assume that no usage means no value. But an object may support a regulatory process that runs only when an audit occurs. Owners know things the logs cannot show.

The third mistake is treating retirement as a developer task. It is a business decision with technical support. When developers decide alone, users distrust the outcome. When owners decide with evidence in hand, the list sticks.

Warning signs your list is not ready

Watch for these signals before you lock the list.

  • Objects with no named owner after repeated attempts
  • Usage windows shorter than a full business cycle
  • Interfaces marked unused without checking the partner system
  • Batch jobs missing from the evidence because scheduling data was ignored

Fix these gaps first. A smaller, trusted list beats a larger, doubtful one every time.

What to Do Before Your Migration Scope Gets Locked

Start collecting usage data now, even if your migration date is a year away. Evidence takes time to gather, and a full business cycle is the minimum for a list you can defend. Every month of delay narrows the window before scoping begins.

Then run the break analysis, match it to usage, and build the retire, rewrite, and review buckets with named owners. Lock before you delete. Keep archives for a set period. Record every decision so the next architect understands what happened and why.

Teams that follow this path walk into migration with a smaller, cleaner system and a plan built on proof. 2iSolutions US helps organizations build that evidence base and turn it into a scope the business trusts, so the project pays only for code that earns its place.

Frequently Asked Questions

Q. How long should we collect usage data before retiring custom code?

A. Collect data for at least one full business cycle, which usually means twelve months. That window catches year-end and seasonal processes that shorter periods miss. If you cannot wait, extend the review bucket for anything with a seasonal link.

Q. Can we delete unused custom code before moving to S/4HANA?

A. Yes. Removal works in ECC through the normal transport process, and it shrinks the repository before migration starts. Locking objects first gives you a safe way to reverse a mistake.

Q. Who should approve a retirement list?

A. Business owners should approve it, with technical teams providing the evidence. Owners understand regulatory and periodic processes that logs may not reveal. Their sign-off also protects the project when someone questions a deletion later.

Q. What happens to objects in the review bucket?

A. Each one needs a named reviewer and a deadline. Reviewers check recent users, confirm business need, and decide to retire or rewrite. Without that discipline, the bucket quietly turns into extra rewrite work.

Q. How does 2iSolutions US support scope reduction?

A. 2iSolutions US analyzes custom code, collects execution evidence, and builds the retire, rewrite, and review lists with your business owners. The team then carries the reduced scope into planning and delivery so the savings show up in the project budget.

Email us at [email protected] to request a demo of AI ABAP code remediation.

Want this applied to your SAP estate?

Tell us where you are and we'll come back with a concrete next step.

Talk to our team