Every S/4HANA move drags a custom-code mountain behind it: thousands of ATC readiness findings, each needing understanding, a decision and a fix. This playbook runs AI through that funnel — explain the finding, draft the remediation diff, justify it against the simplification item — with a human-verified transport as the only exit.
Tier: Core · Workflow area: ERP Development & Testing · ~40 minutes
Custom-code remediation is the perfect AI workload because it is high-volume, pattern-heavy and evidence-rich: the Custom Code Migration app tells you exactly which objects break, ATC names the simplification item, and the fixes cluster into a dozen recurring shapes — MATNR field-length extension, KONV replaced by PRCD_ELEMENTS, VBFA navigation changes, deprecated function modules with released successors. What AI compresses is the understanding step, which is where remediation projects actually burn their hours.
Get the finding inventory with usage data. Run the Custom Code Migration app (or ATC with the S/4HANA readiness variant against your custom namespace) and export findings to a spreadsheet: object, check ID, simplification-item note number, line. Join in usage statistics (SUSG/SCMON aggregates). Sort into: unused (candidate for deletion), used + quick-fixable, used + judgment-needed. AI works the third pile; ADT quick fixes clear much of the second.
Explain each judgment-needed finding with full grounding. The prompt carries three ingredients — finding, note context, and your actual code:
S/4HANA readiness finding, ATC check: S4HANA_READINESS_2023.
Simplification item: SI2: Data model change in pricing —
KONV replaced by PRCD_ELEMENTS (Note 2220005 summary pasted below).
Our code (ZSD_PRICING_REPORT, lines 118-142) pasted below reads
KONV directly with SELECT ... WHERE KNUMV = ...
Explain:
1. Exactly why this breaks or degrades in S/4HANA.
2. The remediation options (compatibility view vs. redesign to
released API) with the trade-off in one paragraph each.
3. Which option you recommend given this code path runs in a
month-end batch job over ~2M documents, and why.
The recommendation-with-context question is what separates this from reading the note yourself: performance-sensitive batch paths often flip the answer from "compatibility view is fine" to "redesign."
Draft the remediation diff, constrained to released objects.
Write the remediated version of the pasted routine for S/4HANA
on-premise 2023. Constraints: use PRCD_ELEMENTS (or the released
API you recommended), keep the routine's interface unchanged,
preserve existing behavior for the KAPPL/KSCHL filtering exactly,
and add an inline comment on each changed line citing the
simplification item. Output as before/after blocks.
Read the diff like a hostile reviewer. The classic AI mistakes here: quietly changing selection scope (KONV vs PRCD_ELEMENTS key differences), dropping a FOR ALL ENTRIES guard against an empty table, and inventing field names that existed in ECC. Every changed line must trace to the simplification item or be rejected.
Prove behavior equivalence, not just syntax. For each remediated object: syntax check and ATC re-run (finding gone, no new ones), then an equivalence check appropriate to the object — for reports, run old and new against the same test data in a converted sandbox and diff the output; for routines with pb-45-style unit tests, green suite on both sides. An output diff of zero rows on representative data is the sentence your sign-off stands on.
Batch by pattern, and industrialize the checklist. Findings repeat: once the KONV pattern is verified twice by hand, process the remaining objects of that pattern in batches — same prompt scaffold, same diff review, same equivalence check, logged per object in the inventory sheet. The sheet becomes the audit trail: finding → explanation → diff → evidence → reviewer → transport.
Exit through the transport, with paperwork. Each remediation transport bundles: the changed objects, the updated inventory rows, and the equivalence evidence reference. Human reviewer releases; nothing ships on the model's confidence. The deferred and exempted findings get formal ATC exemptions with justifications — also draftable by AI, also human-approved.
Remediation prompts require pasting custom code that may embed business logic, pricing rules or hard-coded credentials. Scan for secrets before pasting, use your tenant-approved model for anything competitively sensitive, and never paste productive data extracts to demonstrate a bug.
AI collapses the understand-and-draft phase of S/4HANA remediation from hours per finding to minutes — and changes nothing about the exit: behavior proven equivalent on real data, every line traced to a simplification item, and a human releasing the transport.