• Mon-Fri: 9:00 AM - 6:00 PM
×

Logic-motive can help you grow higher with the right SAP consulting services and solutions at the right time. Let us do it for you.

Office 05, Devraai, Mukai Chowk,
Kotwal Nagar, Ravet, Pimpri-Chinchwad,
Maharashtra 412101
9:00 AM - 6:00 PM
SAP AMS

S/4HANA custom code assessment: what to keep, fix or retire

An S/4HANA custom code assessment built on SAP's own tools, with a keep/fix/retire table and India-specific checks. Get the 3-month plan.

LogicMotive blog cover: S/4HANA custom code assessment: what to keep, fix or retire

Mainstream maintenance for SAP ERP 6.0 on enhancement packages 6 to 8 ends on 31 December 2027 (SAP Community). Our guide to SAP ECC end of support in 2027 covers the dates and options. This post covers the part that drives much of the effort: your custom ABAP.

SAP's tools can tell you which Z-programs run in production and which will break on S/4HANA. They cannot tell you what a ten-year-old program does for your GST return, or whether anyone still needs it. A sound S/4HANA custom code assessment needs both answers. Below: SAP's method and its limits, a decision table, how to handle undocumented code, India-specific checks, and a three-month plan ending in a pack your CFO can budget from.

Why an S/4HANA custom code assessment decides project size

SAP adapts its own code for S/4HANA; your custom code is yours to adapt and test. Every used object that touches a changed SAP object needs a change and a retest, and every unused object you carry forward adds effort with no return.

The unused share can be large. SAP's own SCMON post on SAP Community estimates that on average 40 to 60% of custom code is never executed in production (SAP Community, ABAP Call Monitor). SAP recommends cleaning it up before migration. Treat that as SAP's average, not your number; your own usage data will show the real share.

SAP's Conversion Guide for SAP S/4HANA 2023 calls the custom code check the most important preparation step for ABAP code. It advises running the check before conversion, as a basis for planning.

Effort then turns on four drivers. They are how much code is used, how many findings need manual work, how much business-critical logic must be retested, and how much of the code anyone understands. SAP's tools measure the first two. The last two need people.

SAP's tools, and what each one cannot do

In short: collect usage data now, run the ABAP Test Cockpit (ATC) S/4HANA readiness checks centrally, and use SAP Readiness Check for the early view.

  • ABAP Call Monitor (SCMON) with SUSG. What it gives you: Which ABAP objects run in production, how often, and from which business process. Prerequisite: Standard from AS ABAP 7.50; on 7.00 and higher via the ST-PI add-on as /SDF/SCMON (SAP Note 2679723). Watch out for: SCMON keeps detail for 7 days by default; aggregate with SUSG. ABAP-based usage only.
  • Usage Procedure Logging (UPL). What it gives you: Usage counts via SAP Solution Manager. Prerequisite: Solution Manager. Watch out for: SAP calls SCMON its successor; never run both in parallel.
  • Workload monitor (ST03/ST03N). What it gives you: Workload broken down by transactions executed. Prerequisite: Standard. Watch out for: Transaction level only; a cross-check, not a substitute.
  • Simplification Database (SAP Note 2241080, loaded with SYCM). What it gives you: SAP's list of objects changed in S/4HANA, each linked to a note. Prerequisite: Central check system. Watch out for: The old SYCM worklist is where-used based; SAP calls its false-positive rate extremely high.
  • ATC with S/4HANA readiness check variants. What it gives you: Code-level findings against simplification items, plus SAP HANA checks. Prerequisite: Central ATC check system on SAP_BASIS 7.52, checking ECC remotely; SAP Note 2436688. Watch out for: SAP says the checks do not yet find every incompatibility; testing is still required.
  • Custom Code Migration app (SAP Fiori). What it gives you: ATC results plus usage data; scoping; deletion transport for unused code. Prerequisite: S/4HANA 1809 or higher, or SAP BTP ABAP Environment. Watch out for: Scoping depends on the usage data you upload.
  • SAP Readiness Check for SAP S/4HANA (SAP Note 2913617). What it gives you: High-level custom code view, interface inventory, recommended Fiori apps. Prerequisite: Data collection in ECC. Watch out for: Planning-level view; ATC does the deep analysis.
  • Quick fixes in ABAP Development Tools (ADT) for Eclipse. What it gives you: Semi-automatic bulk fixes for common findings. Prerequisite: Converted S/4HANA system (1809 or higher). Watch out for: SAP lists fixes for MATNR, VBFA, VBUK, VBUP, KONV, BSEG and VBTYPE patterns.

Which check variant to run

S4HANA_READINESS_REMOTE checks against every item in the Simplification Database. Release-specific variants such as S4HANA_READINESS_2023 or S4HANA_READINESS_2025 check only items relevant to that release (SAP Note 3666462 covers the 2025 variant). Use the variant for your actual target release.

SAP sizes the central check system at about 1 CPU and 4 GB RAM per 16,000 custom objects. After conversion, the Conversion Guide has you run ATC locally with the S4HANA_READINESS variant and do the adaptation in ADT. SE80 no longer supports all object types, such as CDS views.

None of these tools tells you what a program is for, who depends on it, or whether S/4HANA standard now does the same job. That judgement belongs to your functional owners.

The decision: retire, replace, fix or keep

Decide object by object from usage data and ATC findings. For anything critical, add a business purpose confirmed by its functional owner.

  • No production use in a year or more of SCMON/SUSG data, including a year-end close; no owner claims it. Decision: Retire. Evidence needed: SUSG last-used data from every relevant system; owner sign-off; backup
  • Copy of a standard SAP program, or a modification that can go back to standard. Decision: Retire (delete the copy; reset modifications to standard in SPAU during conversion). Evidence needed: Comparison with the standard object
  • Used, but S/4HANA standard now covers the need. Decision: Replace. Evidence needed: Side-by-side output test by the business user
  • Used, with ATC findings tied to simplification items. Decision: Fix. Evidence needed: ATC finding and its SAP note; quick-fix availability; test cases
  • Used, no findings, business-specific logic. Decision: Keep, and retest. Evidence needed: Clean ATC run on the target-release variant; regression test
  • Used, but nobody can say what it does. Decision: Hold until documented. Evidence needed: Plain-language documentation reviewed by the functional owner

SAP recommends resetting as many modifications as possible to standard in SPAU. Before fixing a report, look for a standard app; SAP's inventory course describes Stock – Multiple Materials and Slow or Non-Moving Materials (SAP Learning), which may cover Z stock reports.

"Fix": the data-model changes behind most findings

  • Material number. MATNR grows from 18 to 40 characters (SAP Note 2267140). Even if you keep short numbers, code with length or type conflicts must be adjusted.
  • Finance. Index tables BSIS, BSAS, BSID, BSAD, BSIK and BSAK, and totals tables such as GLT0, KNC1, LFC1 and FAGLFLEXT, are replaced by compatibility views. Line items sit in the universal journal (table ACDOCA); reads still work, but writes must be removed from custom code (SAP Note 1976487).
  • Sales. Status tables VBUK and VBUP are eliminated; the status fields moved to VBAK/VBAP, LIKP/LIPS and VBRK.
  • Pricing. Pricing results are stored in PRCD_ELEMENTS instead of KONV. KONV can still be used for data declarations.
  • Inventory. Material documents are stored in MATDOC instead of MKPF and MSEG, and stock quantities are calculated on the fly.
  • Business Partner. Business Partner is mandatory, and a system without customer/vendor integration is declined for conversion. XD01, XK01, FD01, FK01 and VD01 redirect to transaction BP, so uploads built on recordings of those screens need redesign.

SAP's adaptation process post adds database checks: native SQL, SELECTs without ORDER BY before a binary search, and access to pool or cluster tables need review.

"Retire": do it safely

SAP recommends at least a year of usage data; its learning material says 6 to 18 months including at least one year-end close, collected in production (SAP Learning). Watch for programs that run only at year-end, audit time or for annual filings.

Do not decommission an object that is unused in one system but used in another. Keep a backup, for example in abapGit. And do not leave unadapted code in the converted system; SAP says it risks data inconsistency.

The undocumented-code problem

Usage data and ATC tell you that a program runs and where it will break, not which business rule it enforces. Only a process owner can confirm that, and they need something readable to work from.

Often the developer has left and the specification is lost. The risk runs both ways: teams fix code that standard S/4HANA would replace, or retire code that holds a control. For illustration, a Z-check that blocks billing when a customer's GSTIN is missing looks like clutter, yet enforces a tax rule.

Document and confirm in this order, by the cost of getting it wrong:

  1. Programs and enhancements that create or change accounting documents.
  2. GST, e-invoice and e-way bill logic, and anything producing tax values or return data.
  3. TDS and other statutory reports.
  4. Pricing and billing logic.
  5. Interfaces: IDocs, RFCs and BAPIs, files to banks, GST Suvidha Providers (GSPs) and logistics partners. Readiness Check's integration analysis lists these.
  6. Management reports that feed decisions.

For each object, aim for one page: purpose, trigger, tables read and written, business rules, outputs, users. The owner then confirms whether it is still needed, whether standard covers it, and who will test it.

Writing those pages by hand is slow, which is where ABAP Inferencer, LogicMotive's documentation tool, fits. It uses AI to read custom ABAP and describe the business logic in plain language, with flags for complexity hotspots and dead code. Treat its output as a first draft for the owner to check. It does not run SAP's simplification checks or change code, and its dead-code flags come from the source, so they complement SCMON usage data.

India-specific code to check first

Tax and statutory custom code needs its own pass, because S/4HANA's India localisation now covers part of what ECC teams built themselves.

E-invoicing. In 2020 SAP released two e-invoicing routes for ECC and S/4HANA (SAP Community). One is an automated, licensed solution through SAP Cloud Integration and a GSP; the other is a manual route where the customer builds the JSON request offline. Find out which route you use and what custom code surrounds it, including BAdI implementations such as BADI_EDOCUMENT_IN_EINV.

What S/4HANA standard now offers. SAP's India documentation for S/4HANA 2025 groups these under Document and Reporting Compliance. They include electronic invoices, electronic waybills, GSTR1, GSTR3B, ITC04 and GSTR6 reports, and withholding tax reporting. The new GSTR1 Report supports electronic submission and reconciliation against the tax authority's draft.

SAP also says integration flows for its legacy e-invoice solution lose support from the 2027 FPS0 release, and points customers to the cloud edition of Document and Reporting Compliance. So a Z GSTR extract or custom JSON builder is a "replace" candidate. Confirm fit, licensing and GSP support for your release with your tax team and SAP.

CIN master data. In S/4HANA, CIN fields such as PAN and vendor classification live in LFA1 and KNA1. SAP Note 2285611 and transaction LOIN_CV_MD_MIG move them there from J_1IMOVEND and J_1IMOCUST. After that, BP edits do not update the old CIN tables (SAP Note 2877717, in the Simplification List). Z-reports or TDS logic reading PAN from J_1IMOVEND will get stale data unless changed.

Print forms. SCMON records ABAP usage only and does not map Smart Forms usage back to the form. Check GST invoice layouts through output configuration and print programs.

A three-month plan, and what to take to the CFO

Month 1: measure

  • Switch on SCMON in production (/SDF/SCMON below 7.50) with SUSG aggregation, or confirm UPL in Solution Manager. A year of data takes a year, so start now.
  • Pull the inventory: Z and Y programs, function modules, classes, enhancements, BAdI implementations, modifications, forms and interfaces.
  • Run SAP Readiness Check. SAP says it is included in your maintenance agreement at no additional cost.
  • Set up checks: a central ATC system on 7.52, or the Custom Code Migration app on SAP BTP or an S/4HANA sandbox, with the latest Simplification Database content.

Month 2: analyse

  • Run ATC with the variant for your target release.
  • Join findings with usage; set aside unused code.
  • Tag critical objects, document the undocumented ones and get owner review.
  • Test the India items against standard in a sandbox.

Month 3: decide

  • Record a decision per object: retire, replace, fix, keep or hold. Retire decisions stay provisional until a full year of usage data is in.
  • Retire the clear cases in ECC now, such as owner-approved copies of standard programs, with a backup.

The CFO pack

Do not invent a rupee figure yet. Give the CFO the effort drivers an estimate is built from:

  • Object counts by type and by decision (retire, replace, fix, keep, hold).
  • Used objects with ATC findings, split by simplification area and by quick-fix versus manual.
  • Interfaces affected, and tax or statutory objects needing a retest.
  • Objects with no owner or documentation.
  • Open items: usage window not yet complete, standard-fit tests pending, licences to confirm.

Give the same inventory to every bidder so quotes price the same scope. For an independent review, see our SAP support and implementation services.

Frequently asked questions

How long should we collect usage data before retiring custom code?

SAP recommends at least one year of usage data from the production system, including at least one year-end close. SCMON keeps detailed data for only 7 days by default, so schedule SUSG to aggregate it. Treat retire decisions taken earlier as provisional.

Do we need an S/4HANA system to run the S/4HANA custom code checks?

No. You can run remote ATC checks against ECC from a central check system on SAP_BASIS 7.52, or use SAP's Custom Code Migration app in the SAP BTP ABAP Environment. The on-premise version of the app needs S/4HANA 1809 or later.

Will SAP's tools fix our custom code automatically?

Only partly. After conversion, quick fixes in ABAP Development Tools handle common patterns such as material number length and access to VBUK, VBUP, KONV and BSEG. Logic changes remain manual, and SAP states that its checks do not yet catch every incompatibility, so business testing is still needed.

Get a custom code readiness check on 20 programs

LogicMotive runs ABAP Inferencer on 20 custom programs you choose (a mix across modules, including the ones your team is wary of touching) and returns plain-language documentation of each program's business logic, with complexity and dead-code flags, as input to your keep, fix or retire decision. It complements SAP's S/4HANA simplification checks and does not replace them.

What you provide: the source code of the 20 programs, shared under NDA, and a functional contact who can answer questions.

Ask for the custom code readiness check.

Sources

  1. Custom code adaptation for SAP S/4HANA – FAQ, SAP Community (Olga Dolinskaja, SAP), community.sap.com (accessed Oct 2026)
  2. SAP S/4HANA System Conversion – Custom code adaptation process, SAP Community (Olga Dolinskaja, SAP), community.sap.com (accessed Oct 2026)
  3. ABAP Call Monitor (SCMON) – Analyze usage of your code, SAP Community (Olga Dolinskaja, SAP), community.sap.com (accessed Oct 2026)
  4. Collecting Usage Data for Custom Code, SAP Learning, learning.sap.com (accessed Oct 2026)
  5. Conversion Guide for SAP S/4HANA 2023 (document version 7.0), SAP, help.sap.com (accessed Oct 2026)
  6. Simplification List for SAP S/4HANA 2023, Feature Pack Stack 3 (document version 1.35), SAP, help.sap.com (accessed Oct 2026)
  7. SAP Readiness Check: Key Feature Overview, SAP, help.sap.com (accessed Oct 2026)
  8. Displaying Transaction Profiles (Workload Monitor), SAP Help Portal, help.sap.com (accessed Oct 2026)
  9. Using Analytical Apps for Inventory Management, SAP Learning, learning.sap.com (accessed Oct 2026)
  10. Electronic Invoices (Legacy), India, SAP S/4HANA 2025, SAP Help Portal, help.sap.com (accessed Oct 2026)
  11. GSTR1 Report, India, SAP S/4HANA 2025, SAP Help Portal, help.sap.com (accessed Oct 2026)
  12. Withholding Tax Reporting, India, SAP S/4HANA 2025, SAP Help Portal, help.sap.com (accessed Oct 2026)
  13. GST India: E-Invoicing Solution, SAP Community (SAP), community.sap.com (accessed Oct 2026)
  14. Maintenance Timelines for SAP ERP 6.0 ("ECC"), SAP Community (Arne Schmidthals, SAP), community.sap.com (accessed Oct 2026)
  15. Document and Reporting Compliance, India, SAP S/4HANA 2025, SAP Help Portal, help.sap.com (accessed Oct 2026)

LogicMotive SAP

SAP & ERP consulting team, Pune

Next step

Planning an SAP or ERPNext project?

Talk to our consultants about S/4HANA, SAP Business One, ERPNext, AMS or audits. The first consultation is free.

Book a free consultation
Ask me
LogicMotive AI ×
Welcome! How can I assist you with our SAP or Digital Transformation services today?