SAP MDG · CONSOLIDATION
Why does CALL FUNCTION IN UPDATE TASK from SAVE_BUSINESS_PARTNER_ACTIVE not update the custom table?
Custom table updates in UPDATE TASK do not persist after MDC activation
MDG Consolidation or Mass Processing activation completes with 0 errors, but the custom table has no new or changed row.
Error
MDG Consolidation or Mass Processing activation completes with 0 errors, but the custom table has no new or changed row.
Symptoms
SAVE_BUSINESS_PARTNER_ACTIVEran and the process shows the record as activated.- A function module scheduled with
CALL FUNCTION ... IN UPDATE TASKfrom the redefined save method does not persist data. - A Data Dictionary browser (for example SE16) shows no row on the custom table for the business partner. There may be no update-task error in SM13.
What is the issue
A custom subclass of CL_MDC_MODEL_BP redefines SAVE_BUSINESS_PARTNER_ACTIVE, calls SUPER->SAVE_BUSINESS_PARTNER_ACTIVE, and then schedules a custom update function module IN UPDATE TASK. MDC activation runs in a framework-controlled LUW, often in a bgRFC or background workflow context. In that context the registered update task may not be executed, or the pass that registered it may be discarded or rolled back by the framework. The activation step still reports success because the standard save finished and the custom call only registered an update — it did not run in the same LUW the framework commits.
Where to debug
- Set an external breakpoint in the redefined
SAVE_BUSINESS_PARTNER_ACTIVEand at the start of the update function module, for the background workflow or bgRFC user in the same client where the process runs. - Confirm whether the function module is entered at all after activation. If the breakpoint in the function module never stops, the update task was not executed.
- Watch the work area passed to the function module, and whether control returns from
SUPER->SAVE_BUSINESS_PARTNER_ACTIVE. - Do not add
COMMIT WORKto test this; that is unsafe in this context.
How to solve
Call the update function module directly (synchronously) after the super save, and let the MDC framework commit. Never execute COMMIT WORK inside the update function module or in the model class.
1METHOD save_business_partner_active.
2 super->save_business_partner_active( ).
3
4 CALL FUNCTION 'ZZ_CUST_ENTITY_UPDATE'
5 EXPORTING
6 is_data = ls_cust_data
7 iv_delete = lv_delete.
8ENDMETHOD.Alternate option
If the custom data must be handed over into a change request rather than written directly, use the BAdI for handing over to change requests and let the change-request process persist the data. Do not mix an update-task write with that handover.
The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- MDC activation completes with 0 errors but the custom table has no row — why?
- Can I use IN UPDATE TASK in a redefined SAVE_BUSINESS_PARTNER_ACTIVE?
- Should I COMMIT WORK in an MDC model or in a custom update function module?
Possible questions
- MDC activation completes with 0 errors but the custom table has no row — why?
- Can I use IN UPDATE TASK in a redefined SAVE_BUSINESS_PARTNER_ACTIVE?
- Should I COMMIT WORK in an MDC model or in a custom update function module?
- What configuration is required for Custom table updates in UPDATE TASK do not persist after MDC activation?
- How can this SAP MDG scenario be tested?