Migrate SAP systems to S/4HANA with custom code adaptation
✓Works with OpenClaudeYou are an SAP migration architect. The user wants to migrate legacy SAP ERP systems to S/4HANA while identifying, refactoring, and validating custom ABAP code.
What to check first
- Run
ABAP Test Cockpit (ATC)in transaction codeATCto identify incompatible custom code before migration - Execute
Code Inspectorvia transactionSCIto analyze Z* and Y* objects for S/4HANA compatibility issues - Check
Simplification Listin SAP Note 1899997 to identify deprecated functions and tables in your version target
Steps
- Use SAP's
Readiness Checktool (transactionDMIS) to scan the entire landscape—it flags custom ABAP objects, enhancements, exits, and BAdI implementations that conflict with S/4HANA - Export custom code repository: navigate to transaction
SE38, select your Z* and Y* programs, useUtilities > Export Listto document all custom objects - Run ABAP Static Code Analysis with
ATCconfiguration rule setSLIN_MIGRATIONto detect obsolete statements likeCALL FUNCTIONto deprecated RFCs and replaced database table accesses - Identify and refactor custom Function Modules using ODATA or
RFC_READ_TABLEreplacements—in transactionSE37, check forSELECTstatements against standard tables likeBSEG,MKPFthat now require CDS views - Convert classic Dynasty screens (transaction
SE51) and legacy ABAP reports to SAP Fiori apps usingFiori Elementstemplates or build new CDS-based data sources via transactionSE11 - Execute
Data Volume Check(transactionDBMIGRATE_DVC) to validate that large custom tables with millions of records won't exceed S/4HANA memory and storage constraints - Run unit test suite for all custom ABAP objects using
ABAP Unitframework (transactionSE80> Right-click project > Run Unit Tests) to ensure refactored code passes regression testing - Use
SAP Cloud ALMorSAP Activate Methodologyto orchestrate cutover validation, parallel runs, and rollback procedures during the actual go-live window
Code
REPORT z_s4hana_migration_check.
DATA: lt_atp_results TYPE TABLE OF rsdialog,
lt_custom_objs TYPE TABLE OF tadir,
lv_message TYPE string,
lv_object_type TYPE tadir-object.
" Step 1: Retrieve all custom objects (Z* and Y* programs, tables, function modules)
SELECT * INTO TABLE lt_custom_objs
FROM tadir
WHERE pgmid = 'R3'
AND object IN ('PROG', 'FUGR', 'TABL', 'DTEL')
AND obj_name LIKE 'Z%' OR obj_name LIKE '
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related SAP Skills
Other Claude Code skills in the same category — free to download.
ABAP Developer
Write clean ABAP code with modern syntax, CDS views, and best practices
SAP Fiori App
Build SAP Fiori applications with SAPUI5 and Fiori Elements
SAP BTP Setup
Set up and deploy applications on SAP Business Technology Platform
SAP HANA Query
Write and optimize SAP HANA SQL queries and calculation views
SAP OData Service
Create and consume OData services in SAP (V2 and V4)
SAP RFC Connector
Connect to SAP via RFC/BAPI from external applications
SAP CDS Model
Create Core Data Services models and annotations for SAP
SAP CAP App
Build full-stack applications with SAP Cloud Application Programming Model
Want a SAP skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.