A lightweight Python-based SAP Data Migration validation tool that validates Material Master Basic Data (MARA) before S/4HANA migration. The tool checks common migration issues and generates row-wise validation reports, Good vs Bad record segregation, and Excel summary charts.
During SAP ECC → S/4HANA migrations, source data must be validated before loading into migration templates.
This tool helps migration teams to:
- Validate Material Master Basic Data
- Identify invalid records
- Segregate Good and Bad materials
- Produce migration readiness reports
- Generate Excel validation reports with charts
sap-material-validation/
│
├── data/
│ └── MARA_export.xlsx
│
├── output/
│ └── MARA_validation_report.xlsx
│
├── validator.py
│
└── README.md
Field: Deletion Flag (LVORM)
Validation Logic:
- If material is flagged for deletion, mark the record as Invalid
Error Message:
Material flagged for deletion
Field: Material Type (MTART)
Allowed Values:
ROH
HALB
Validation Logic:
- Any material type other than ROH or HALB is invalid
Error Message:
Invalid Material Type (only ROH/HALB allowed)
Field: Material Group (MATKL)
Validation Logic:
- If Material Group is NULL or Blank
- Mark record as failed
Error Message:
Material group is mandatory
Provide the SAP MARA extract.
Example:
MARA_export.xlsx
The dataset may originate from:
- SAP ECC table MARA
- SAP Data Services extract
- SAP Migration Cockpit preparation files
Execute the Python validation script.
Example:
python validator.pyThe script performs the following steps:
- Load Excel dataset
- Identify key columns
- Apply validation rules
- Capture row-wise errors
- Assign validation status
Each record is marked as:
GOOD
or
BAD
The tool generates an Excel report:
MARA_validation_report.xlsx
Contains:
| Material | Material Type | Material Group | Validation Status | Error Message |
|---|
Example:
| MATNR | MTART | MATKL | Validation_Status | Error_Message |
|---|---|---|---|---|
| 100001 | ROH | 001 | GOOD | |
| 100002 | FERT | BAD | Invalid Material Type |
Contains aggregated results:
| Category | Count |
|---|---|
| GOOD | 44 |
| BAD | 456 |
Includes a Pie Chart showing:
Good vs Bad Records
This helps migration teams quickly understand data readiness.
This validation tool helps:
- Reduce migration errors
- Improve data quality
- Identify cleanup effort
- Provide migration readiness reports
Useful for:
- SAP Data Migration Teams
- SAP Data Governance Teams
- SAP S/4HANA Conversion Projects
Additional validations can be easily added:
Examples:
Material should contain only numeric values
MATNR duplicates detection
Check fields like:
ERSDA
LAEDA
Validate numeric fields for:
Incorrect decimal format
- Python
- Pandas
- OpenPyXL
- Excel Charts
SAP Migration Team extracts MARA table from ECC
↓
Run validation tool
↓
Tool generates Validation Report
↓
Clean bad records
↓
Proceed with S/4HANA Migration Cockpit
MIT License
SAP Data Migration Specialist Focus Areas:
- SAP Data Migration
- Data Validation
- SAP ECC → S/4HANA Conversion
- Migration Data Quality