SAP MDG · REPLICATION OUTBOUND

How do I implement custom IDoc outbound data modification in SAP MDG using IF_EX_USMD_IDOC_OUT?

Implement a custom BAdI class for IF_EX_USMD_IDOC_OUT and place your outbound IDoc enrichment, filtering, or suppression logic inside IF_EX_USMD_IDOC_OUT~MODIFY_IDOC_DATA. The retrieved example shows the BAdI shell in ZCL_MDG_CUS_USMD_IDOC_OUT with the method currently stubbed, so the real work is to replace the placeholder check with actual segment processing and business-rule checks.

Implement a custom BAdI class for IF_EX_USMD_IDOC_OUT and place your outbound IDoc enrichment, filtering, or suppression logic inside IF_EX_USMD_IDOC_OUT~MODIFY_IDOC_DATA. The retrieved example shows the BAdI shell in ZCL_MDG_CUS_USMD_IDOC_OUT with the method currently stubbed, so the real work is to replace the placeholder check with actual segment processing and business-rule checks.

Implement the MDG outbound enhancement in a custom BAdI class that implements IF_EX_USMD_IDOC_OUT. The retrieved example shows ZCL_MDG_CUS_USMD_IDOC_OUT with an empty MODIFY_IDOC_DATA method, which is the correct place to add your business logic for outbound IDoc adjustment, filtering, and validation before the IDoc is handed over to the sender runtime.

Process flow

  1. Create or open a custom class that implements IF_EX_USMD_IDOC_OUT.
  2. Inspect the actual method signature of IF_EX_USMD_IDOC_OUT~MODIFY_IDOC_DATA in your system.
  3. Add your outbound enrichment, overwrite, filter, or suppression logic in the method.
  4. Use helper logic for mapping or derivation where needed.
  5. Activate the class and execute an outbound replication test.
  6. Validate the resulting IDoc in the monitor and compare it with the source data.

ILLUSTRATIVE ABAP SAMPLE

Source ABAP example

Exact relevant implementation excerpt from the knowledge document.

1class ZCL_MDG_CUS_USMD_IDOC_OUT definition 2 public 3 final 4 create public . 5 6public section. 7 8 interfaces IF_BADI_INTERFACE . 9 interfaces IF_EX_USMD_IDOC_OUT . 10protected section. 11private section. 12ENDCLASS. 13 14 15 16CLASS ZCL_MDG_CUS_USMD_IDOC_OUT IMPLEMENTATION. 17 18 19 method if_ex_usmd_idoc_out~modify_idoc_data. 20 21 check 1 = 1. 22 23 endmethod. 24ENDCLASS.

The remaining configuration, implementation details, and testing guidance continue from this answer more…

Related questions and keywords

Alternative questions

  • How can I enhance MDG outbound IDoc data before it is sent?
  • What is the implementation pattern for IF_EX_USMD_IDOC_OUT~MODIFY_IDOC_DATA?
  • How do I add custom logic to MDG IDoc outbound processing?

Possible questions

  • How do I implement custom IDoc outbound data modification in SAP MDG using IF_EX_USMD_IDOC_OUT?
  • What is the method to change outbound IDoc data in MDG?
  • How do I filter or enrich outbound IDoc segments in MDG?
  • How do I add custom validation to MDG outbound IDoc creation?
  • Can you show a sample implementation of IF_EX_USMD_IDOC_OUT~MODIFY_IDOC_DATA?

Keywords

SAP MDGIDoc outboundIF_EX_USMD_IDOC_OUTmodify_idoc_dataBAdI implementationcustom outbound enhancementZCL_MDG_CUS_USMD_IDOC_OUT