Skip to main content

«  View All Posts

SAP Custom Code Governance: How to Manage ABAP Code Across the Entire Lifecycle

October 30th, 2026

6 min read

By Jagdish Sahasrabudhe

SAP Custom Code Governance: How to Manage ABAP Code Across the Entire Lifecycle
13:53

TL;DR

SAP custom code governance gives enterprise teams a structured way to manage ABAP code from analysis through transformation, optimization, security, decommissioning, and ongoing change. Without clear governance, custom code can accumulate technical debt, increase upgrade costs, slow S/4HANA programs, and impede clean core progress.

A practical governance model should help SAP teams:

  • Inventory and assess existing custom code
  • Decide what to retire, re-platform, redesign, or retain and adapt
  • Apply standards for performance, security, stability, and ABAP Cloud readiness
  • Use automation to manage change at enterprise scale

Governance works best as a lifecycle framework, supported by automation, measurable decision rules, and continuous visibility into the codebase.

Introduction

Most enterprise SAP systems carry years, and often decades, of accumulated ABAP customizations. smartShift and ASUG research notes that typical SAP systems in the market are 10 to 20 years old, with millions of lines of custom code built over time.

ASUG research conducted with smartShift found that too many customizations in legacy instances are a leading challenge in S/4HANA migrations. smartShift benchmarks also show that a typical SAP ECC system contains roughly 22,000 custom objects and 2.7 million lines of code, with 40% to 60% of custom code potentially unused.

Treating custom code as an IT cleanup task understates the risk. SAP teams need lifecycle governance to assess, control, modernize, optimize, and retire existing ABAP code with confidence.

What Is SAP Custom Code Governance?

SAP custom code governance is the policies, roles, processes, and tools used to control how existing ABAP code is assessed, maintained, optimized, modernized, and retired across its lifecycle. Governance continues after each migration milestone as an operating discipline.

Without governance, enhancements, reports, interfaces, and extensions accumulate without consistent ownership, approval standards, quality controls, or retirement plans. A lifecycle framework should cover:

  • Creation and approval
  • Quality assurance
  • Active maintenance
  • Optimization and modernization
  • Retirement and decommissioning

SAP’s clean core extensibility level concept classifies extensions from Level A to Level D based on architecture, upgrade safety, and alignment with clean core principles.

Why Does Custom Code Governance Matter for S/4HANA and Clean Core?

Ungoverned custom code is a major reason SAP modernization projects exceed budgets, miss timelines, and struggle to maintain clean core alignment. Governance matters because the codebase keeps changing after each project milestone, and unmanaged technical debt returns during every upgrade cycle.

Recent ASUG/smartShift research found that 92% of respondents expect to carry custom code into SAP S/4HANA, and 64% expect to retain more than one-quarter of their existing custom code landscape. The same research found that only 17% of organizations are significantly optimized toward clean core. smartShift benchmarks show that a typical SAP ECC system contains roughly 22,000 custom objects and 2.7 million lines of code, with 40% to 60% of custom code potentially unused.

With SAP S/4HANA now on a two-year release cycle, lifecycle governance helps teams reduce recurring remediation, upgrade risk, and cloud-readiness blockers.

What Are the Five Stages of the ABAP Code Lifecycle?

The ABAP code lifecycle gives SAP teams a practical framework for governing existing custom code from assessment through modernization, active maintenance, and retirement. Each stage helps reduce technical debt, protect upgrade readiness, and support clean core goals without losing sight of business-critical functionality that must remain in place.

Stage 1: Creation and Approval

Governance also needs a prevention control for future custom code. Every new customization request should pass through an approval gate that asks whether SAP standard functionality, configuration, or key user extensibility can meet the requirement.

A practical decision path should prioritize:

  • Configuration
  • Key user extensibility
  • Released APIs and ABAP Cloud patterns
  • Classic ABAP, when justified
  • Higher-risk approaches are only an exception

For this article, creation and approval should be treated as a prevention control. The primary focus remains the governance of existing ABAP custom code, with new development controls used to prevent future technical debt.

Stage 2: Quality Assurance and Testing

Approved custom code should pass quality gates before transport. ABAP Test Cockpit (ATC) helps enforce static checks for S/4HANA compatibility, performance, security, syntax, naming, and other coding standards.

Governance should also define:

  • Code review expectations
  • Naming conventions
  • Required documentation
  • Exemption rules
  • Remediation ownership

ATC can be configured with SAP S/4HANA checks and clean core analysis variants. Critical findings should trigger remediation before release so technical debt does not move unchecked into production.

Stage 3: Active Maintenance

Production code needs active ownership and usage monitoring. Every custom object should have a designated owner who understands the business purpose, dependency risk, and maintenance responsibility.

SAP Usage and Procedure Logging, or UPL, and ABAP Call Monitor, or SCMON, help track which custom objects are actively used. SAP Solution Manager Custom Code Lifecycle Management, or CCLM, can consolidate custom code data into dashboards and reporting views across quantity, quality, criticality, and usage.

Active maintenance gives teams the evidence needed to prioritize modernization, reduce unused code, and avoid surprise scope during upgrades.

Stage 4: Optimization and Modernization

Governance should include scheduled reviews of existing custom code against SAP’s clean core level concept. Objects in Level C or Level D often need closer analysis because they may rely on internal SAP objects, modifications, direct table writes, or other higher-risk techniques.

Optimization and modernization should evaluate:

  • ABAP Cloud readiness
  • Use of released APIs
  • Security vulnerabilities
  • Missing authority checks
  • HANA performance opportunities
  • Deprecated or obsolete patterns

Optimization and modernization help teams improve upgrade stability, reduce technical debt, and prepare critical custom code for future S/4HANA and cloud requirements.

Stage 5: Retirement and Decommissioning

Treat retirement as a core governance requirement. smartShift benchmarks show that a typical SAP ECC system contains roughly 22,000 custom objects and 2.7 million lines of code, with up to 40% of custom code potentially unused.

A governed decommissioning process should include:

  • Usage analysis across full business cycles, ideally 13 months
  • Dependency mapping
  • Business owner validation
  • Safe deactivation
  • Documented retirement and rollback planning

SAP Solution Manager’s Decommissioning Cockpit can help identify and retire redundant or obsolete custom code objects. Automation becomes important when SAP teams need to apply that process across large, complex ABAP landscapes.

How Do You Build an Effective SAP Code Governance Framework?

An effective SAP code governance framework depends on people, process, and tools working together. People define ownership and accountability. Process creates approval workflows, audit cadences, and retirement rules. Tools provide visibility, quality checks, and automation at scale.

  • People: Establish a governance board or technical debt steering group. Assign ownership for every custom object, including approval, review, remediation, and retirement authority.
  • Process: Create formal approval workflows for new customization requests. Set ATC quality thresholds, schedule quarterly code audits, and run decommissioning reviews at least annually.
  • Tools: Use CCLM and ATC for foundational visibility and quality enforcement. For enterprise landscapes with millions of lines of ABAP, automation is essential for code analysis, transformation, security remediation, decommissioning, and clean core alignment.

What Role Does Automation Play in SAP Code Lifecycle Management?

Automation turns SAP custom code governance from a policy document into a continuously enforced system across the full codebase. Manual governance cannot keep pace when SAP landscapes contain thousands of custom objects and millions of lines of ABAP.

Automation supports each lifecycle stage:

  • Code analysis: Creates visibility into usage, risk, quality, security, and upgrade readiness.
  • Code transformation: Modernizes existing ABAP for S/4HANA, HANA performance, stability, security, and clean core alignment.
  • Code decommissioning: Identifies unused or obsolete code and supports safe retirement.
  • Dual maintenance: Keeps ECC and S/4HANA landscapes synchronized during transition periods.

smartShift is the only complete solution built to manage the full SAP custom code lifecycle. Its automation-first approach helps enterprises analyze, remediate, optimize, validate, and manage existing SAP custom code at scale with fixed-price, fixed-timeline delivery and guaranteed quality. Forrester’s Total Economic Impact study found that smartShift delivered 253% ROI over three years.

For SAP leaders, the key question is who can control the custom code layer with enough depth, scale, governance, and accountability.

Conclusion

SAP custom code governance gives enterprise teams the structure to manage ABAP code across its full lifecycle, from visibility and active maintenance to modernization and retirement. As organizations move through S/4HANA transformation, clean core initiatives, and recurring upgrades, governance helps reduce technical debt before it becomes a recurring blocker.

A strong lifecycle model should help teams:

  • Understand what custom code exists
  • Identify what is used, risky, obsolete, or business-critical
  • Modernize existing code for performance, security, and upgrade readiness
  • Retire unused code safely
  • Apply automation where manual governance cannot scale

For SAP leaders, the goal is sustained control over the custom code layer. With the right framework and automation, governance becomes a practical path to lower risk, faster transformation, and a cleaner core.

FAQs

Is it better to establish governance before or during an S/4HANA migration?

SAP teams gain the most value when governance starts before an S/4HANA migration. Early governance helps teams understand custom code volume, usage, dependencies, risk, and modernization needs before project scope hardens.

Governance can also begin during a migration if the program is already underway. In that case, the priority should be to quickly create visibility, define ownership, identify unused code, and apply quality gates before remediation decisions create downstream risk.

How long does it take to implement a custom code governance framework?

The timeline depends on system size, customization volume, available usage data, and the maturity of existing SAP development processes. A basic governance framework can begin with ownership rules, ATC quality gates, and recurring code reviews.

Enterprise-scale governance takes longer because teams need reliable inventory, usage analysis, dependency mapping, decommissioning workflows, modernization criteria, and automation to apply decisions consistently across millions of lines of ABAP.

What percentage of custom code can typically be safely decommissioned?

smartShift benchmarks often show that 40% to 60% of custom code may be unused. Safe decommissioning depends on more than usage statistics, though. SAP teams also need dependency analysis, business owner validation, full-cycle usage history, and documented rollback planning.

A governed decommissioning process helps separate code that is truly obsolete from code that runs infrequently but supports seasonal, regulatory, financial, or business-critical processes.

Does SAP’s clean core A-D extensibility model apply to on-premise S/4HANA systems?

smartShift benchmarks show that up to 40% of custom code in an average SAP system may be unused. Unused code is a strong decommissioning signal, but it is not an automatic retirement decision. SAP teams still need dependency analysis, business owner validation, full-cycle usage history, and documented rollback planning.

A governed decommissioning process helps separate code that is truly obsolete from code that runs infrequently but supports seasonal, regulatory, financial, or business-critical processes. That distinction reduces unnecessary maintenance and testing while preserving business functionality.

What tools are used for ABAP code governance?

Common ABAP code governance tools include:

  • ABAP Test Cockpit, or ATC, for static checks and quality gates
  • Usage and Procedure Logging, or UPL, for usage tracking
  • ABAP Call Monitor, or SCMON, for runtime usage data
  • SAP Solution Manager CCLM for lifecycle visibility
  • SAP Custom Code Migration app for migration-related analysis
  • Decommissioning tools for safe retirement workflows
  • Automation platforms for enterprise-scale analysis, transformation, security remediation, decommissioning, and dual maintenance

Jagdish Sahasrabudhe

As the Chief Technology Officer at smartShift, he brings over 25 years of experience in product strategy, SAP applications, and enterprise AI. Previously, he served as SAP's field CTO, where he worked with ISVs and channel partners to align complex technologies with market needs. He has earned multiple accolades, including the SAP Innovation Award (2005). His leadership roles across startups and large enterprises, along with recognition such as the Zinnov Start-up Beacon Award (2014), uniquely position him to drive innovation and growth at smartShift.

Stay ahead of SAP modernization.

Get the latest insights on S/4HANA, Clean Core, custom code, and AI delivered to your inbox.