Unused custom objects inflate every estimate and every test plan, and a SAP ECC to S4HANA Migration makes the problem far more expensive. Nobody budgets for them, yet they sit in the repository and add hours to each line of the project schedule. Dead code in SAP is the custom programs, enhancements, interfaces and dictionary objects that no user or process has touched in years. It is almost always larger than anyone expects. Most teams discover that only when someone finally measures it.
This post explains how runtime statistics and dependency maps expose that hidden weight. It also shows where remediation cost actually concentrates, which is rarely where teams guess. 2iSolutions, a Toronto-based SAP partner serving Canadian clients, sees the same pattern in assessment after assessment.
What Is Dead Code in an SAP System?
Dead code is custom SAP development that the business no longer runs. It includes reports nobody opens, user exits that never fire, and interfaces feeding systems that were retired long ago. The code still exists, so it still counts in every analysis, every upgrade and every test cycle.
Most of it accumulates for ordinary reasons. One consultant builds a report for a one-time audit. When a department reorganizes, its custom screens go quiet. Then a vendor integration ends, but the outbound interface stays in place.
Nobody deletes these objects because nobody is sure what depends on them. That uncertainty is the real problem. Deleting the wrong object can break month-end close, so the safe choice is always to leave it alone.
Why the Pile Grows Every Year
Each project adds objects and almost none remove them. After ten or fifteen years, a typical system carries thousands of custom objects. Some started as copies of standard programs, which creates a second maintenance burden because the copy drifts from the original.
Teams also inherit work from earlier partners. Documentation is thin, the original developers have moved on, and the safest assumption becomes “someone might still use it.” As a result, the repository only grows.
Where Dead Code Hides
Dead code rarely sits in one obvious place. It spreads across several object types, and each type hides it differently.
- Custom reports and transactions that nobody launches
- User exits and enhancements attached to retired processes
- Interfaces that still run but feed nothing downstream
- Custom tables and data elements that no program reads
- Function modules left behind after a project closed
A report is easy to spot because it has a menu entry. A dictionary object is harder, because a table can look active when only a dormant job writes to it. So teams tend to undercount.
How Runtime Statistics Show What Nobody Uses
Runtime statistics record which programs, transactions and function modules actually executed over a period of time. They answer a simple question with evidence: did anyone run this object? That evidence replaces opinion, and opinion is where most estimates go wrong.
A usage review works like this:
- Collect execution data covering at least a full business cycle, including year-end.
- Match every custom object against that data.
- Flag objects with zero executions as candidates for retirement.
- Confirm each candidate with the business owner before removal.
The year-end window matters. A report that runs once a year looks dead in a three-month sample, then fails the finance team in December. A long enough sample protects you from that mistake.
What the Analysis Reads and What It Skips
Our Environment Assessment agents read the custom repository, enhancements, interfaces, dictionary objects and runtime statistics. They do not read business data. Your invoices, employee records and customer details stay where they are.
That distinction matters to security and privacy teams. The analysis looks at how the system is built and used, not at what the business stores in it. Approval is simpler because no sensitive records leave the environment.
Why Usage Data Beats Interviews
Interviews feel thorough, but they miss a lot. Ask ten power users which custom reports they rely on and you will hear about six. People remember what they run weekly. They forget the quarterly extract that a colleague built in 2014.
Usage data has no such blind spot. It records every execution, including the ones triggered by background jobs that nobody remembers scheduling. For example, a nightly job might call a custom program that writes to a log table no one reads. Only the statistics catch it, and then only if the window is long enough.
The best practice is to use both. Statistics tell you what ran. Interviews tell you why it ran and whether the business still needs it. Together they give a defensible list.
Dependency Maps Reveal What Is Safe to Remove
Zero executions alone do not prove an object is safe to delete. A dependency map shows what calls what: which programs invoke which function modules, which enhancements hook into which standard processes, and which interfaces feed which tables. It turns a flat list of objects into a connected picture.
Consider a custom function module with no direct usage. On the map, you might see that a live program calls it inside a rarely triggered branch. Remove it and that branch fails. Without the map, you would never know.
The reverse also happens. A cluster of twenty objects may depend only on each other, with nothing outside the cluster calling in. That cluster looks busy in a code search because the objects reference one another. In reality, the whole group is an island, and you can retire it together.
Reading the Map for Clusters and Orphans
Two patterns matter most. Orphans are single objects with no callers and no execution history. Islands are connected groups with no live link to the rest of the system. Orphans are easy wins. Islands take more care but deliver the larger savings.
Teams that skip the map usually retire orphans only. They leave the islands in place because the internal references look like activity. As a result, they clear a fraction of the real total and wonder why the next project still runs long.
Where the Remediation Cost Actually Concentrates
Remediation cost concentrates in testing and analysis, not in coding. Every custom object inside a project’s scope needs review, adjustment and regression testing. Dead objects consume that effort without returning any business value, so they inflate the bill in places teams rarely check. Broader SAP and Oxford Economics research on technology value shows why organizations are under growing pressure to spend effort only where it returns something.
Think about a single custom report during a system upgrade. Someone must read the code, check it against changed standard objects, fix any conflicts and test the result. If nobody uses the report, all of that work is waste. Multiply it by hundreds of objects and the schedule stretches by weeks.
Here is where the extra hours usually appear:
- Impact analysis, because each object needs a decision
- Code adjustment, because standard changes break custom copies
- Unit and regression testing, because each fix needs proof
- Defect triage, because dead code produces confusing failures
- Documentation, because someone must explain why the object stays
The Hidden Cost in Test Plans
Test plans suffer quietly. Testers write scripts for processes that nobody runs, then spend days chasing failures in objects the business would not miss. That time never shows up as a line item. It hides inside general testing effort, so the budget looks normal until the schedule slips.
A cleaner repository shortens every later project. Fewer objects mean fewer scripts, fewer defects and smaller review meetings. The savings repeat with each release, which is why cleanup pays back faster than most teams predict.
Dead Code and the Move to S/4HANA
Dead code matters most when a system faces a major change. Moving to a new platform forces a decision on every custom object, so a bloated repository turns a manageable project into a long one. Retiring unused objects first shrinks the scope before anyone writes a single estimate.
Teams planning an SAP ECC to S4HANA Migration often treat custom code as a fixed quantity. It is not. A usage review before scoping can remove a large share of the objects that would otherwise need analysis and adjustment. The migration then starts from a smaller, cleaner base.
The order of work matters. Clean first, then scope, then convert. Teams that estimate first and clean later pay for the same objects twice, once in the estimate and once in the rework.
Keeping Useful Custom Code Healthy
Not every custom object is waste. Some carry real competitive value, such as pricing logic or a specialised approval flow. The goal is to keep what earns its place and retire the rest.
Good SAP Custom Development follows that discipline from the start. Each new object gets an owner, a purpose and a review date. When the business reason ends, the object leaves with it. That habit stops the pile from growing back after cleanup.
Performance also improves. A lighter repository means shorter transport queues, quicker system checks and less noise in monitoring. Teams that pursue SAP Performance Optimization often find that removing dead objects does as much good as tuning the live ones, because the system stops carrying work it never needed.
How to Start a Dead Code Review
Start with measurement, not deletion. A review needs a defined scope, a long enough data window and clear owners for each decision. Done in that order, it produces a retirement list the business trusts and a baseline you can compare against later.
Follow these steps:
- Define the scope: which systems, which object types, which time window.
- Pull runtime statistics for at least twelve months.
- Build the dependency map for all custom objects.
- Separate orphans from islands and live objects.
- Review the list with business owners and finance, especially for year-end items.
- Retire in stages, with transports you can reverse.
Reversible steps give people confidence. If someone objects after a transport moves, you restore it and discuss. That safety net speeds approval, because nobody has to bet the close on a guess.
Choosing the Right Support
Some teams run this review alone. Others bring in outside help, especially when the original developers have left and the documentation is gone. External specialists bring tooling and a repeatable method, and they free your own staff for daily work.
Look for SAP Consulting Services Canada providers who show their method, explain what data they read, and confirm that business records stay untouched. Ask how they handle year-end processes. Ask who signs off on each retirement. Clear answers there tell you more than any sales deck.
Reporting also benefits from cleanup. Teams building dashboards on top of a tidy environment, including those using SAP Analytics Cloud Canada deployments, spend less time tracing data back through abandoned interfaces. The source systems become easier to explain, so the reports become easier to trust.
For the official product background on the platform many teams are heading toward, see the SAP S/4HANA overview.
Frequently Asked Questions
Q. How much dead code does a typical SAP system carry?
A. The amount varies, but most mature systems hold far more unused custom objects than their owners expect. Systems that ran for ten years or more across several partners tend to carry the largest share. Only a usage review against runtime statistics gives a real number for your system.
Q. Is it safe to delete custom objects with zero executions?
A. Not on that evidence alone. A dependency map must confirm that no live object calls the candidate, and a business owner should approve the removal. Staged, reversible transports add a further safety net.
Q. Does a dead code analysis read our business data?
A. No. The 2iSolutions assessment reads the custom repository, enhancements, interfaces, dictionary objects and runtime statistics. It does not read invoices, employee records or customer details, so sensitive data stays in your environment.
Q. How long should the usage data window be?
A. Use at least twelve months so the sample includes year-end and other annual processes. A shorter window can flag a yearly report as dead, which causes a failure at the worst possible time.
Q. Should we clean up before or after a platform migration?
A. Clean up before. Retiring unused objects shrinks the scope, lowers the estimate and cuts testing effort. Teams that clean afterward pay to convert and test objects they later delete.
What a Smaller Repository Gives You Next
Dead code is expensive because it hides. It adds hours to analysis, test scripts and defect triage, and no budget line captures it. Runtime statistics show what nobody runs, and dependency maps show what is safe to remove, so together they turn a vague worry into a specific list.
The payoff repeats. Every later upgrade, migration and audit starts from a smaller base, and every estimate gets more accurate. Teams that measure first usually find the cleanup funds itself through the project savings that follow.
2iSolutions runs this assessment for Canadian organizations that want facts before they scope their next project. The output is a ranked retirement list, a dependency map and a clear view of where remediation effort would land, ready for your own planning.
Email us at info@2isolutions.com to book an AI environment assessment.