Lesson 4 of 6
Custom code and functional regression
17 min
Listen to this lesson
A conversion keeps your processes but changes what sits underneath them. Standard SAP functions are simplified, data structures change and custom code has to be adapted. Testing everything equally is neither affordable nor smart. The custom code analysis and the simplification items tell you where change happened; the regression strategy should follow that map.
Where the findings come from
- Simplification items relevant to your system, from SAP Readiness Check or the Simplification Item Catalog, describe functional and technical changes in each area.
- Custom Code Migration checks custom code against S/4HANA simplifications before the conversion; the guide notes the checks do not yet find every issue, so custom code must also be tested in S/4HANA.
- After SUM: modifications are adjusted with SPDD, SPAU and SPAU_ENH, and remaining issues are found with an ATC run using the check variant
S4HANA_READINESSin the converted system. - Usage data: unused custom code can be identified and retired, which removes it from both adaptation and testing.
- FindingsATC readiness findings, SPAU/SPDD adjustments, relevant simplification items
- Map to objectsWhich custom objects and standard functions changed
- Map to processesWhich business processes and test cases use them
- PrioritizeBy change depth and business criticality
- TestUnit tests for adapted code; targeted functional tests; full regression for critical paths
Mapping code to processes
The hard step is the middle one. Developers think in objects, testers in processes. Build a simple traceability list: for each adapted custom object, which transactions, apps, jobs or interfaces call it, and which test cases cover those. Usage statistics from production help a lot here, because they show which programs actually run in which business context. Kenji's team owns the object side; Priya's team owns the test case side; together they fill the gap.
| Finding at Contoso | Adapted object | Process and test focus |
|---|---|---|
| Customer/vendor master moves to business partner | Custom customer-creation interface | Create and change customers via the interface; check Great Lakes Fleet Services master data and credit data |
| Changed pricing data model | Custom pricing report reading pricing conditions | Report totals reconciled against billing for a month of orders |
| Material number field length extended | Custom label print program | Labels for CMC-ALT-100 and CMC-RTR-200; layout and barcode |
| Finance tables replaced by the universal journal | Custom GL extract to the consolidation tool | Extract compared with trial balance for 1710 and 1810 |
| Modification in sales order pricing | Adjusted in SPAU | Full order-to-cash regression with all price scenarios |
Examples of findings mapped to targeted tests. Topics are typical conversion areas; confirm the relevant simplification items for your system.
Test layers for adapted code
Adapted code gets three kinds of evidence. Developer tests: ABAP Unit where the code allows it, or at least a documented developer test with before/after output from ED1 and CMD. Comparison tests: run the same report or interface with the same selection in the old system and the converted one and compare results, which is powerful for reports and extracts. Process tests: the business process end to end in CMQ, with key users for critical flows. Unchanged custom code still gets regression through the processes that use it, but with lower priority.
What would you do?
After 4,300 unused objects were deleted, Kenji's scoped ATC run on the 7,500 in-scope custom objects shows 3,900 readiness findings, and usage data shows many objects run only rarely. The test budget covers about 300 targeted tests. What should Priya propose?
- Use simplification items, custom code checks, SPDD/SPAU adjustments and ATC readiness runs as the change map.
- Map adapted objects to processes and test cases; usage data links code to business context.
- Combine developer tests, old-versus-new comparison tests and process tests.
- Retire unused code and prioritize the rest by depth of change and business criticality.
Check your understanding · not graded
Lesson check
1. Which ATC check variant finds remaining S/4HANA issues in the converted system, per the conversion guide?
2. Why must custom code be tested even after all custom code check findings are fixed?
3. What is a comparison test for an adapted custom report?