SAP MDG · REPLICATION OUTBOUND
How do I implement target-system-specific outbound adjustments in SAP MDG Business Partner replication?
Use the MDG BP outbound proxy BAdI to enrich the outbound payload before it is sent, and control the adjustment with a TVARVC switch keyed by the target business system. In the documented pattern, the logic rewrites the outbound bank detail ID from the bank account external ID only for the configured destination.
Use the MDG BP outbound proxy BAdI to enrich the outbound payload before it is sent, and control the adjustment with a TVARVC switch keyed by the target business system. In the documented pattern, the logic rewrites the outbound bank detail ID from the bank account external ID only for the configured destination.
Use the MDG BP outbound proxy BAdI to apply destination-specific logic before replication. The documented pattern reads a TVARVC switch (`ZMDGS_BUSINESS_SYSTEM`) and, when the recipient business system matches the configured entry, copies the bank account external ID into the outbound bank detail ID.
Process flow
- Implement the outbound BAdI `IF_MDG_SE_BP_BULK_REPLRQ_OUT` in a customer class.
- Read `out-message_header-recipient_business_system_id` from the outbound proxy header.
- Read the switch `ZMDGS_BUSINESS_SYSTEM` from `TVARVC`.
- Check whether the current recipient business system is listed in the configured values.
- Loop through `out-business_partner-bank_details`.
- If `bank_account_external_id` is filled, assign it to `id`.
- Return the updated outbound proxy structure to the framework.
Referenced tables
| Object | Purpose |
|---|---|
TVARVC | Stores the runtime switch that activates target-system-specific outbound adjustments. |
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example
Exact relevant implementation excerpt from the knowledge document.
1"Generic skill: apply target-system-specific outbound adjustments.
2"Use this pattern when the outbound payload changes by destination, country, or wave/availability check.
3
4SELECT SINGLE low
5 FROM tvarvc
6 INTO @DATA(ls_switch)
7 WHERE name = 'ZMDGS_BUSINESS_SYSTEM'
8 AND type = 'S'
9 AND high = 'DHS'.
10
11IF sy-subrc IS INITIAL.
12 READ TABLE lt_tvarvc TRANSPORTING NO FIELDS WITH KEY low = out-message_header-recipient_business_system_id.
13 IF sy-subrc IS INITIAL.
14 LOOP AT out-business_partner-bank_details ASSIGNING FIELD-SYMBOL(<fs_bank_details>).
15 IF <fs_bank_details>-bank_account_external_id IS NOT INITIAL.
16 <fs_bank_details>-id = <fs_bank_details>-bank_account_external_id.
17 ENDIF.
18 ENDLOOP.
19 ENDIF.
20ENDIF.The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How do I rewrite outbound Business Partner bank IDs based on the target system in MDG?
- How do I add destination-based logic in an MDG BP outbound proxy BAdI?
- How do I suppress or change outbound payload fields depending on the recipient business system?
Possible questions
- How can I use TVARVC to control outbound BP replication logic by destination system?
- Which MDG outbound BAdI is used for Business Partner bulk replication request generation?
- How do I adjust bank details in the outbound BP proxy structure before replication?
- How do I implement country- or target-specific rules in MDG outbound payload enrichment?
- How do I debug outbound payload changes in BP replication?