SAP S/4HANA Migration

SAP Custom Code Migration Approach for SAP S/4HANA

A practical SAP custom code migration approach for assessing, adapting, testing, and governing ABAP custom developments during an SAP S/4HANA conversion.

SAP S/4HANA custom code migration workflowShow the controlled sequence from inventory through post-go-live monitoring.SAP S/4HANA custom code migration workflowShow the controlled sequence from inventory through post-go-live monitoring.scopefindingsadapt or replaceevidenceapproved scopeInventoryand usage…Collectcustom…ImpactanalysisRun theCustom Code…Classify andprioritizeChooseretain, adap…Adapt ABAPChange codeusing…Testbusiness…Verifytechnical,…Cut overand monitorReconciletransports…CertPas original visual explanation
Process diagram showing SAP S/4HANA custom code migration from inventory and impact analysis through classification, ABAP adaptation, testing, cutover, and monitoring.
On this page
  1. Plan the custom code workstream
  2. Build a usable custom code inventory
  3. Run technical impact analysis
  4. Adapt ABAP custom code
  5. Prioritize the migration backlog
  6. Test adapted custom code
  7. Control transports and cutover
  8. Common failure patterns
  9. Operational checklist

Plan the custom code workstream

A reliable SAP custom code migration approach treats custom development as a governed workstream rather than a late technical cleanup. Establish the system scope, conversion approach, business owners, development teams, transport path, test environments, and decision dates before analysis begins. The SAP S/4HANA migration overview provides the broader program context for this workstream.

Define an inventory baseline from the production system and include custom reports, transactions, function modules, classes, interfaces, enhancements, forms, workflows, batch jobs, custom tables, and externally consumed APIs. Record the owner, business process, execution frequency, dependencies, data sensitivity, and replacement status for each object. This baseline supports decisions to retain, adapt, replace, archive, or retire custom code.

Custom code disposition decisionsHelp project teams choose an evidence-based action for each custom object.Custom code disposition decisionsHelp project teams choose an evidence-based action for each custom object.assessnoyesyesnoCustomobject…Start withusage,…Required intarget…Confirmbusiness nee…RetireUse whenevidence and…Standardcapability…Assessreplacement…ReplaceMove theprocess to…Adapt andtestChange thecode,…CertPas original visual explanation
Decision tree for custom code disposition: review the object, confirm target-scope need, retire unused code, replace code with standard capability where appropriate, or adapt and test it.

Build a usable custom code inventory

Start with evidence from production usage, repository metadata, transport history, and business interviews. Usage data helps distinguish business-critical developments from objects that exist only because they were once needed. Give priority to objects that run during financial close, order processing, procurement, manufacturing, warehouse operations, or integrations.

Group findings by action so the backlog remains manageable:

  • Retain: the object remains valid after the conversion and needs only confirmation.
  • Adapt: the object remains required but needs changes for changed data models, APIs, syntax, or authorization behavior.
  • Replace: standard SAP S/4HANA capability or an approved extension replaces the custom object.
  • Retire: usage and business ownership evidence support removing the object from the target scope.
  • Investigate: technical or business evidence is incomplete and requires a decision.

Keep the inventory connected to a work item, owner, transport, test case, and acceptance decision. A spreadsheet can start the process, but a controlled backlog is more effective once multiple teams are working in parallel.

Run technical impact analysis

Use the Custom Code Migration app and ABAP Test Cockpit checks to identify syntax issues, changed objects, obsolete constructs, incompatible interfaces, and simplification-related impacts. Combine automated findings with the simplification item check guide, because a code finding has business meaning only when its affected process and target behavior are understood.

Run analysis against a representative development or conversion system with the relevant custom namespace and software component scope. Preserve the analysis result with the scan date, system level, checked packages, exclusions, and rule configuration. Re-run the analysis after major target changes so the team can separate resolved findings from newly introduced ones.

Classify each finding by impact and action. High-priority findings usually include code that reads changed tables directly, calls replaced or restricted interfaces, depends on obsolete transactions, performs financial postings, or controls a high-volume integration. A low-severity syntax finding can still be operationally important when it affects a critical batch job.

Adapt ABAP custom code

Adapt code in a controlled development system and keep each change traceable to an inventory item. Prefer released APIs, stable extension points, and documented integration contracts. Review direct table access, dynamic SQL, hard-coded organizational values, authorization checks, date and currency handling, batch-input dependencies, and assumptions about document or master-data structures.

Coordinate adaptation with functional owners. A technically clean program can still produce an incorrect result when the target business process uses a changed status, new master-data relationship, different document flow, or revised authorization design. For integrations, confirm payload structure, error handling, retry behavior, monitoring ownership, and the target endpoint before approving the change.

Use a short feedback loop: implement a focused change, run syntax and static checks, execute a technical test, attach the evidence to the work item, and promote through the agreed transport path. Keep unrelated refactoring outside the conversion backlog unless it removes a migration risk or materially simplifies testing.

Prioritize the migration backlog

Prioritize with a transparent score based on business criticality, execution frequency, technical impact, integration exposure, data sensitivity, and test complexity. Combine the score with project milestones so high-risk objects are completed before integration testing and business validation.

A practical sequence is:

  1. Resolve blockers for core finance, sales, procurement, manufacturing, and logistics processes.
  2. Adapt shared frameworks, reusable classes, interfaces, and background processing components.
  3. Address forms, reports, workflows, and operational utilities.
  4. Retire unused objects after business ownership and dependency checks.
  5. Handle low-risk improvements only when they do not threaten the conversion path.

Review the backlog at each project gate. The SAP S/4HANA project phases guide helps place analysis, adaptation, testing, and cutover decisions in the wider delivery sequence.

Test adapted custom code

Test custom code at several levels. Start with unit or developer tests for changed logic, then execute technical integration tests for RFC, IDoc, file, web service, and batch interfaces. Continue with end-to-end business scenarios that cover master data, document creation, approvals, posting, output, reporting, and reconciliation.

Use production-like volumes for performance-sensitive programs. Measure runtime, database access, memory behavior, lock duration, parallel processing, and downstream queue effects. Include negative paths such as missing master data, authorization failures, duplicate messages, rejected postings, interrupted jobs, and restart processing.

Record expected results and business evidence for every critical scenario. A successful program execution is not enough when the result affects accounting, inventory, tax, compliance, or customer communication. The SAP S/4HANA test strategy guide can be used to align custom-code tests with the wider test cycle.

Control transports and cutover

Map every adapted object to its transport request, dependency order, test evidence, and target-system owner. Coordinate custom code transports with standard changes, configuration, interfaces, forms, roles, and data activities. A transport that passes syntax checks can still fail when a dependent class, table, interface, or authorization role is absent from the target system.

Before cutover, freeze the approved custom-code scope and reconcile the inventory against the final transport list. Confirm that retired objects are excluded from the productive scope, emergency changes have owners, and rollback actions are documented. During dress rehearsals, measure import duration, post-import activation, batch-job behavior, interface recovery, and business validation time.

After go-live, monitor dumps, failed jobs, interface queues, authorization errors, posting exceptions, and performance regressions. Link each incident back to the migration inventory when possible. Close an item only after technical resolution, business confirmation, and operational handover are complete.

Common failure patterns

Late discovery: teams begin custom-code analysis after functional testing has started. Start the inventory and impact scan during preparation so adaptation capacity and test dependencies are visible early.

Technical-only decisions: developers mark findings as resolved without confirming business behavior. Require a functional owner and evidence for decisions involving postings, master data, interfaces, reports, or compliance.

Uncontrolled retirement: unused-looking objects are deleted without checking jobs, variants, interfaces, roles, or external callers. Use repository references, runtime evidence, transport history, and owner confirmation before retirement.

Test-case gaps: teams test the changed program but not the surrounding process. Trace each critical object to an end-to-end scenario and include failure, restart, reconciliation, and authorization paths.

Weak cutover traceability: the final transport list does not match the approved backlog. Reconcile objects, dependencies, transports, test evidence, and sign-offs before the productive import.

Operational checklist

Use this checklist before declaring the custom-code workstream ready for the next project gate:

  • Inventory covers custom ABAP, interfaces, forms, workflows, jobs, tables, and external callers.
  • Production usage and business ownership are recorded for priority objects.
  • Custom Code Migration app and ABAP Test Cockpit findings have assigned actions.
  • Simplification-related impacts are linked to affected business processes.
  • Adapted objects use approved APIs and extension patterns where available.
  • Critical scenarios have technical, integration, end-to-end, and negative-path tests.
  • Transport dependencies and import order are documented.
  • Cutover, rollback, monitoring, and operational handover owners are assigned.
  • Retired objects have dependency and business-owner approval.

A migration is ready to progress when the remaining findings have explicit owners, deadlines, accepted risk, and evidence-based decisions. The goal is a controlled target scope that supports business operations, rather than the largest possible custom-code inventory.

Back to all articles