SAP MDG · CONSOLIDATION
How do I stop a failed custom entity read from aborting the MDG consolidation step?
Custom entity read failure aborts the whole MDG consolidation step
The entire MDC process step fails when a read of one custom entity raises an exception (for example CX_MDC_MODEL, or a table-not-found / not-active error).
Error
The entire MDC process step fails when a read of one custom entity raises an exception (for example CX_MDC_MODEL, or a table-not-found / not-active error).
Symptoms
- Standard business partner data would have been readable, but the step ends as soon as a custom entity read fails.
- The process log may show only the custom entity error, or a generic step failure.
- Custom entities that are not in scope, or not generated, for this process still break the run.
What is the issue
A redefined READ_ALL_DATA that reads custom entities in the same method, without isolation, lets any custom-entity failure propagate and abort the step. The standard read and other custom entities never complete. From the point of view of the standard process, custom entities should be optional: a missing table, inactive entity, or read error should be written to the process log, not raised through the main read.
Where to debug
- Set an external breakpoint in the custom
READ_ALL_DATAand in the custom-entity read, for the background workflow or bgRFC user in the same client where the process runs. - Identify which entity and which exception abort the step (
GET_TEXT( ),PREVIOUS). - Confirm whether the entity is active and whether the process (PRC) table exists for this process model.
How to solve
Move custom entity reads into separate private methods, for example READ_CUST_ENTITY and IS_CUST_ENTITY_ACTIVE. Catch errors inside those methods and write them to the process log instead of raising them. Add a WRITE_PROCESS_LOG helper so read and scheduling issues are traceable.
1METHOD read_all_data.
2 super->read_all_data( iv_from_current_step = iv_from_current_step ).
3 IF is_cust_entity_active( ) = abap_true.
4 read_cust_entity( ).
5 ENDIF.
6ENDMETHOD.
7
8METHOD read_cust_entity.
9 TRY.
10 " read the custom entity / process table
11 CATCH cx_root INTO DATA(lx_error).
12 write_process_log( lx_error->get_text( ) ).
13 ENDTRY.
14ENDMETHOD.IS_CUST_ENTITY_ACTIVE should return abap_false when the entity or its process table is not in the model, without raising.
Alternate option
If the custom entity is mandatory for the process, still catch, log, and then raise a CX_MDC_MODEL with a clear text so the process log shows the real cause. Do not let an uncaught dump occur later.
The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- Should a missing custom entity raise CX_MDC_MODEL from READ_ALL_DATA?
- How can I log a custom entity read error without failing the standard BP read?
- What methods should wrap optional custom entity reads in a CL_MDC_MODEL_BP subclass?
Possible questions
- Should a missing custom entity raise CX_MDC_MODEL from READ_ALL_DATA?
- How can I log a custom entity read error without failing the standard BP read?
- What methods should wrap optional custom entity reads in a CL_MDC_MODEL_BP subclass?
- What configuration is required for Custom entity read failure aborts the whole MDG consolidation step?
- How can this SAP MDG scenario be tested?