In 24/7 global manufacturing and financial enterprises, shutting down the SAP ERP production system for a 12-hour weekend maintenance window to convert custom tables is unacceptable. Modifying table structures via classic Data Dictionary tools (transaction SE14) locks the database catalog, invalidating active database cursors and causing widespread business transaction timeouts.
To achieve continuous business continuity, enterprise architects utilize Online Data Conversion (ODC) principles: decoupling data migration into an online background process using a Shadow Table and a Delta Buffer Log.
| Stage | Production Table (Source) | Delta Buffer Table | Shadow Table (Clean Core Target) |
|---|---|---|---|
| 1. Setup | Active (Live reads & writes) | Created (Idle) | Created with Clean Core types |
| 2. Arming | Active (Trigger mirrors CUD) | Buffering live delta operations | Ready for bulk ingestion |
| 3. Bulk Copy | Active (Live reads & writes) | Buffering ongoing changes | Ingesting in 50k row cursor chunks |
| 4. Delta Replay | Active (Trigger live) | Draining pending changes | Applying updates & deletes |
| 5. Cutover | Deprecated / Decommissioned | Purged & dropped | Active (Consuming all traffic) |
Attempting to read millions of records into memory with a standard SELECT * INTO TABLE triggers memory dumps (TSV_TNEW_PAGE_ALLOC_FAILED) or transaction timeout dumps (TIME_OUT).
The Clean Core pattern utilizes database cursors with explicit package limits:
OPEN CURSOR @DATA(lv_cursor) FOR
SELECT * FROM zcustom_order.
DO.
FETCH NEXT CURSOR @lv_cursor
INTO TABLE @DATA(lt_chunk)
PACKAGE SIZE 50000.
IF sy-subrc <> 0 AND lt_chunk IS INITIAL.
EXIT.
ENDIF.
INSERT zcustom_order_sh FROM TABLE @( CORRESPONDING #( lt_chunk ) ).
IF sy-subrc = 0.
COMMIT WORK.
ENDIF.
ENDDO.
CLOSE CURSOR @lv_cursor.
While the bulk copy is processing for 30 minutes, real users continue creating and updating orders in the source table. The database trigger logs the primary key and operation type (I=Insert, U=Update, D=Delete) into the delta buffer table.
Delta replay must always read the latest committed state from the source table rather than relying on stale before-images. Using MODIFY target FROM @latest_state guarantees that replaying multiple updates for the same primary key converges to the exact true state.
Once delta lag drops to zero, the cutover is executed cleanly:
// Prior to cutover:
define view entity ZR_CustomOrder as select from zcustom_order ...
// Cutover switch:
define view entity ZR_CustomOrder as select from zcustom_order_sh ...
Generate shadow table DDL, chunked cursor extractors, delta replay engines, and parity verifiers with our interactive tool.
Launch Migration Architect Tool âš¡ Get Architecture Suite (80% Off)