Conversion programs in SAP ABAP: how to build data migration that works
Conversion programs in SAP ABAP are the loaders that move legacy data into SAP: they read source files or staging tables, map and validate values, and post through BAPIs, IDocs or batch input (BDC). In S/4HANA the Migration Cockpit covers many standard objects, so custom ABAP conversion programs are now mainly for objects or rules the cockpit does not handle. This page explains the methods, when to use each and how to make loads repeatable and reconcilable.
When this makes sense
- You are migrating to S/4HANA or a new ECC company code and need to load master and open item data
- Your Migration Cockpit templates do not cover a custom object or complex rule
- Old LSMW or BDC programs fail on a new release or with new screen layouts
- Mock loads take too long or produce too many errors to finish within cutover
- Auditors want proof that migrated balances and items reconcile
What the engagement covers
Method selection per object
Choosing between the S/4HANA Migration Cockpit (staging tables or file templates), BAPIs such as BAPI_MATERIAL_SAVEDATA or BAPI_ACC_DOCUMENT_POST, IDocs and BDC recordings, based on object, volume and release.
Staging and mapping
Building staging tables or files, value mapping tables (for example legacy plants to SAP plants), and transformation rules that are documented and versioned.
Validation before posting
Pre-checks for mandatory fields, master data existence, number ranges and duplicate keys so errors surface before the load, not during it.
Loader programs
ABAP programs with test mode, parallel processing for volume, restart from failure, and detailed error logs using BAPI return tables or application logs (SLG1).
Reconciliation
Counts and value totals compared between source and SAP, with reports for open items, stock and balances signed off by business owners.
Cutover timing
Measuring load times in mock runs and designing the sequence and parallelism to fit the cutover window.
How it runs
- 1
Object inventory and design (2-4 weeks)
- List objects and volumes
- Choose method per object
- Define mapping and validation rules
- 2
Build (4-8 weeks)
- Build staging, mapping and loader programs
- Configure Migration Cockpit projects
- Unit test with sample data
- 3
Mock loads (2-3 cycles of 2-4 weeks)
- Run full loads in a copy of production
- Measure timing and error rates
- Fix data and programs between cycles
- 4
Cutover and reconciliation (1-2 weeks)
- Execute production loads in sequence
- Reconcile counts and values
- Obtain business sign-off
What you get
- Migration object inventory with method and owner per object
- Mapping and transformation specifications
- Loader programs with test mode, logs and restart
- Mock load reports with timing and error trends
- Reconciliation reports and sign-off records
- Cutover load sequence and timing plan
What drives cost and effort
| Number of objects | Each object needs mapping, loading and reconciliation; custom objects cost more than cockpit-supported ones. |
| Data quality | Dirty legacy data increases cleansing and mock cycles more than any program design. |
| Volume | High volumes need parallel processing and performance tuning to fit cutover. |
| Method | BDC recordings are fragile and slower to maintain than BAPI or cockpit loads. |
| Number of mock cycles | More cycles cost more but reduce cutover risk; two or three are common. |
Fixed price per object
Well-defined object lists with known sources and rules.
Time and materials migration team
Projects where data quality and scope are still unclear.
Migration factory
Multi-wave rollouts that reuse the same programs across countries or plants.
Questions to ask any SAP consultant
When do you use the Migration Cockpit versus custom ABAP?
Custom programs where the cockpit works add cost and maintenance.
Do your loaders have a test mode and restart?
Without them, a failure mid-load can force a full restore.
How do you reconcile, and who signs off?
Reconciliation evidence is what makes migrated data trustworthy.
Why would you use BDC for any object?
BDC is acceptable only where no BAPI or cockpit object exists, because it breaks with screen changes.
How will you meet the cutover time window?
Load timing must be measured in mock runs, not estimated.
Score candidate partners side by side with the free Implementation Partner Scorecard
Where these projects go wrong
Loads exceed the cutover window
Measure in production-sized mocks, parallelise and pre-load static master data early.
Partial loads leave inconsistent data
Use test mode, commit control and restartable programs.
Balances do not reconcile
Reconcile at each mock and involve finance owners early.
Mapping rules lost or changed informally
Keep mapping tables and rules in version control with change approval.
If your objects are all supported by the S/4HANA Migration Cockpit and data volumes are moderate, you may need little or no custom ABAP. Spending on data cleansing in the legacy system often saves more than spending on clever loader programs.
Frequently asked questions
What is a conversion program in SAP ABAP?
It is an ABAP program that reads legacy data, transforms it to SAP formats and posts it into SAP using a BAPI, IDoc or batch input. It usually includes validation, logging and reconciliation features.
Should I use BDC or BAPI for data migration?
Prefer BAPIs, IDocs or the Migration Cockpit, which use stable interfaces. BDC records screen sequences and breaks when screens change, so use it only where no other option exists.
Is LSMW still available in S/4HANA?
LSMW still exists in S/4HANA but SAP advises the Migration Cockpit instead, and LSMW use is not recommended for many objects. Check the relevant SAP notes for your release.
How many mock loads are needed?
Commonly two or three full mock loads, plus a dress rehearsal. Each cycle should show fewer errors and a load time that fits cutover.
Can AI help with data migration?
AI is useful for profiling legacy data, suggesting mappings and checking reconciliation results. Netray uses AI agents for mapping checks and reconciliation analysis, with migration leads approving every rule.