SAP ECC → S/4HANA

Audit your custom ABAP. Ship a migration dossier you can defend.

ZMIG inventories user exits, BAdIs, enhancements and standard modifications, has an LLM draft a migration verdict for each, and lets a consultant validate every card before it reaches the report.

⚠️ v0.2, early stage. The web UI has no authentication — run it locally or behind an authenticating proxy, never exposed to the internet as-is.
ZMIG · SAP ECC → S/4HANA migration auditor Audits custom ABAP code and produces a human-reviewed migration-readiness dossier. 1 ABAP · SAPExtract ZMIG_EXTRACTORZ objects + source 2 POSTGRESIngest Object graph,dead-code, impact 3 LLM EVALPipeline Claude / Grokclassify + effort 4 HUMANReview Validate / correct/ skip each card 5 HTML DOSSIERReport Prints to PDF,SHA-256 seal Human-in-the-loop by contract — no LLM assessment reaches the report unreviewed.
Five stages, one contract: nothing is published without a consultant signing off.
01 · ABAP / SAP

Extract

A self-contained report inventories Z objects, exits, BAdIs and usage, exporting JSON (optionally AES-256 encrypted).

02 · POSTGRES

Ingest

Loads the extract, builds the object graph and runs dead-code and impact-radius analyses.

03 · LLM EVAL

Pipeline

For each enhancement, an LLM classifies it, estimates effort and lists risks — strict JSON, validated against enums.

04 · HUMAN

Review

A consultant walks each draft and validates, corrects or skips it before anything ships.

05 · DOSSIER

Report

A self-contained HTML dossier (prints to PDF) with a SHA-256 integrity seal over the source.

What the tool looks like

A server-rendered FastAPI UI — no frontend framework, no build step. Upload an extract, run the evaluation, review the drafts.

ZMIG·AUDIT extracts Extracts #SYSTEMEXTRACTION EXTRACTORNODESDRAFTSREVIEWED 2PRD/1002026-05-14v0.23 48112128 open 1DEV/1002026-04-30v0.22 207094 open 0QAS/2002026-04-02v0.11 950361 open Upload extract FILE (.JSON OR ENCRYPTED)mig_extract.json PASSPHRASE (IF ENCRYPTED)optional Ingest ZMIG toolkit v0.2 · no authentication: local use only
Dashboard — loaded extracts and the upload form.
ZMIG·AUDIT extracts Extract #2 PRD/100 2026-05-14 USAGE: ST03N 140enhancements with source 140evaluated by LLM 12drafts to review 126reviewed 2errors Review drafts (12) View report Inventory by object type OBJECT TYPECOUNT Classic user exit (ZX* include)86view objects Classic BAdI implementation54view objects Z program412view objects Z class298view objects Modification of the SAP standard7view objects
Extract detail — KPIs and object inventory.
ZMIG·AUDIT extracts Review 12 PENDING ENH:ZXVVFU02 ADAPT EFFORT M CONFIDENCE 0.78 214 LOC USAGE: 1240/MONTH CLAUDE-SONNET-4-6 Summary: Pricing user exit in SAPMV45A that recalculates a custom discount field. Rationale: Logic overlaps with standard condition technique but reads a Z table; needs re-platforming to a BAdI in S/4HANA rather than removal. Risks: • Reads MV45AFZZ globals that may not exist post-migration. • Custom table ZSD_DISCOUNT not yet assessed for S/4 data model. ▸ View source code (214 LOC) ACTIONValidate as-is ▾ CLASSIFICATION (IF CORRECTING)— ▾ EFFORT (IF CORRECTING)— ▾ REVIEWERsergio NOTEreason for the correction or remark Save& next
Human review — the LLM drafts, the consultant decides. Only reviewed cards reach the report.

Built to be trusted, not just fast

Decision support, not decisions — and honest about its limits.

Human-in-the-loop by contract

Cards stay in ai_draft until a consultant promotes them. The report excludes drafts and says so on its cover.

Cryptographic integrity

Every source is hashed (SHA-256) at extraction and re-checked at report time; the dossier shows a match percentage.

Honest about sources

Usage evidence, dynamic calls and cross-reference completeness are declared as limits in the methodology section.

Provider-agnostic LLM step

Anthropic Claude by default, xAI Grok via an OpenAI-compatible client. Strict JSON, validated against enums, with one retry.

Quick start local

You need Docker Desktop (or any Postgres 14+), Python 3.10+, SAP GUI access to the audited system, and an Anthropic and/or xAI API key.

git clone https://github.com/sergio-gracia/ecc-s4h-migrator-auditor.git
cd ecc-s4h-migrator-auditor

# Python env + deps
python -m venv venv && .\venv\Scripts\activate
pip install -r requirements.txt

# Database (port 5433 if 5432 is taken)
docker run -d --name mig-db -e POSTGRES_PASSWORD=migpass \
  -e POSTGRES_DB=mig -p 5433:5432 postgres:16

# Environment
$env:DATABASE_URL="postgresql://postgres:migpass@localhost:5433/mig"
$env:ANTHROPIC_API_KEY="sk-ant-..."

# Run the web app...
uvicorn app:app --reload          # → http://localhost:8000
# ...or the whole stack
docker compose up --build

Then run ZMIG_EXTRACTOR in SAP (SE38), upload the JSON, evaluate, review and export. Full steps in the README.