We’re migrating change orders from our legacy PLM to SAP PLM 2020 using LSMW. The change number migration completes but many records show missing object links in the error log. The migration sequencing follows: materials first, then BOMs, finally change orders.
Error pattern from log:
Change Order CO-2024-1523: Object link missing
Referenced Material M-45678 not found
Link type: AFFECTED_ITEM
We’ve verified the materials exist in SAP after their migration batch. The object link consistency checks are failing during change order import. About 40% of change orders are affected, disrupting the entire change process timeline. Has anyone resolved similar object link issues during change management migration?
Here’s the complete solution addressing all three focus areas:
Object Link Consistency: The root cause is LSMW’s direct table update bypassing SAP’s object linking framework. You must use BAPI_ENGINEERINGCHANGE_CREATE which maintains the CDHDR/CDPOS change document tables and establishes proper object relationships.
Migration Sequencing Enhancement: Implement this improved sequence:
Migrate materials (existing step)
Run validation program to confirm all materials in target system
Migrate change orders using BAPI with mapping table lookup
Execute consistency check: RSVTPROT or custom validation
Error Log Analysis Solution: The error log shows ‘Material not found’ but the real issue is the link creation timing. Implement this ABAP wrapper:
CALL FUNCTION 'BAPI_ENGINEERINGCHANGE_CREATE'
EXPORTING
engineeringchange = lv_eco_data
TABLES
objectlinks = lt_links
return = lt_return.
IF sy-subrc = 0.
COMMIT WORK AND WAIT.
ENDIF.
The COMMIT WORK AND WAIT is critical - it ensures database consistency before the next batch. For the affected 40% of change orders, you’ll need to:
Extract the failed change orders from error log
Re-map affected item references using Z_MIGRATION_KEYS table
Re-run migration using BAPI approach
Validate object links using transaction SE16 on tables CDHDR (change document header) and CDPOS (change document items)
For ongoing validation, create a reconciliation report comparing legacy system’s change-to-material relationships against SAP’s CDPOS entries. This ensures 100% object link consistency post-migration.
The BAPI approach adds processing time (about 30% slower than direct LSMW) but guarantees data integrity. With 40% failure rate, the rework cost far exceeds the additional migration time. Budget an extra 2-3 days for the BAPI conversion and mapping table setup, but you’ll eliminate the object link failures completely.
I’d recommend a two-phase approach. First, create the change orders without affected items using LSMW. Second, run a separate program to establish the object links using FM ‘CALO_INIT_API’ followed by ‘CALO_OBJECT_LINK_CREATE’. This gives you better control over error handling and lets you validate each link before creation. The migration sequencing should include a validation step between phases to confirm all referenced objects are accessible.
Add intermediate logging between your migration phases. Create a custom Z-table to track which materials completed migration with their new SAP keys. Reference this mapping table during change order migration to ensure accurate object linking.
Good point about the COMMIT timing. I checked and materials ARE in MARA table. The issue seems specific to the object link table (CDHDR/CDPOS). The affected item relationships aren’t being established even though both objects exist.
The migration sequencing looks correct, but there’s likely a timing issue. Even though materials migrate first, the COMMIT might not be happening before the change order batch starts. Try adding explicit COMMIT WORK statements between migration phases. Also verify your error log analysis - are the ‘missing’ materials actually committed to database or just in buffer? Run a quick SELECT on MARA table to confirm the referenced materials are physically present before starting change order migration.