SAP MDG · REPLICATION OUTBOUND

How does a custom MDG customer outbound DRF class determine IDs, key mappings, and send customer IDocs?

The class `ZCL_MDG_BS_CUST_ALE_DRF` resolves hub/client customer IDs through MDG matching and CVI services, reads customer/contact key mappings, applies DRF sales-area or company-code filters, and then sends customer-related IDocs such as `CLFMAS`, `ZDEBMAS`, `ADRMAS`, `ADR2MAS`, `ADR3MAS`, and `DOLMAS`.

The class `ZCL_MDG_BS_CUST_ALE_DRF` resolves hub/client customer IDs through MDG matching and CVI services, reads customer/contact key mappings, applies DRF sales-area or company-code filters, and then sends customer-related IDocs such as `CLFMAS`, `ZDEBMAS`, `ADRMAS`, `ADR2MAS`, `ADR3MAS`, and `DOLMAS`.

`ZCL_MDG_BS_CUST_ALE_DRF` is the custom outbound class for MDG customer replication. It caches the local business system in the constructor, uses MDG/CVI services for BP-to-customer and customer-to-BP mapping, and contains dedicated helpers for filters, key mapping, contact persons, assignments, and IDoc sending.

Process flow

  1. Check the constructor to capture the local business system in `MV_HUB_BUS_SYSTEM`.
  2. Review `GET_CUST_ID_AND_KTOKD_OF_CLNT` for customer ID and account-group derivation.
  3. Trace `GET_CUST_ID_FROM_BP_ID` and `GET_BP_ID_FROM_CUST_ID` for BP/customer translation.
  4. Inspect `READ_KEY_MAPPING`, `WRITE_KEY_MAPPING`, `READ_KEY_MAPPING_4PARNR`, and `WRITE_KEY_MAPPING_4PARNR` for MDG matching behavior.
  5. Validate `GET_CUST_CONTACT_PERSONS`, `GET_CLNT_PARNR`, and `GET_CLNT_PARNR_FROM_NUMBRANGE` for contact person replication.
  6. Check `GET_VKORG_FILTER` and `GET_BURKS_FILTER` to confirm DRF selection scope.
  7. Review `SEND_DEBMAS_IDOC` and the related `SEND_*` helpers for outbound status handling and IDoc creation.

Referenced tables

ObjectPurpose
MDG_BS_ECC_CUSNRCustomizing table used to derive client customer IDs and client account groups from hub account-group context.
MDG_BS_ECC_CUSCPCustomizing table used to determine number-range settings for client contact partner numbers.
KNVKCustomer contact person table read by `GET_CUST_CONTACT_PERSONS`.

ILLUSTRATIVE ABAP SAMPLE

Source ABAP example

Exact relevant implementation excerpt from the knowledge document.

1class ZCL_MDG_BS_CUST_ALE_DRF definition 2 public 3 inheriting from CL_MDG_BS_BP_SUPER_DRF 4 final 5 create public . 6 7public section. 8 9 interfaces IF_DRF_OUTBOUND . 10 11 constants SC_MSGID type SYMSGID value 'MDG_BS_ECC_CUSTOMER' ##NO_TEXT. 12 13 methods CONSTRUCTOR . 14 methods GET_CUST_ID_AND_KTOKD_OF_CLNT 15 importing 16 !IV_CLIENT_SYSTEM type MDG_BUSINESS_SYSTEM 17 !IV_HUB_KTOKD type KTOKD optional 18 exporting 19 !EV_CUSTOMER_ID type MDG_OBJECT_ID_BS 20 !EV_CLIENT_KTOKD type KTOKD . 21protected section. 22 23 types: 24 begin of ty_parnr_hc, 25 parnr_hub type parnr, 26 parnr_clnt type parnr, 27 end of ty_parnr_hc . 28 types: 29 tt_mdg_bs_ecc_cusnr type table of mdg_bs_ecc_cusnr . 30 types: 31 tt_knvkadr type standard table of knvkadrfeld . 32 types: 33 tt_parnr_hc type standard table of ty_parnr_hc . 34 types: 35 tt_mdg_bs_bp_knvv type sorted table of mdg_bs_bp_s_knvv with unique key vkorg vtweg spart . 36 37 data MV_HUB_BUS_SYSTEM type SLD_BSKEY . 38 constants SC_S_DRF_CUST type STRING value 'MDG_BS_BP_S_CUSTOMER_OTC' ##NO_TEXT. 39 constants SC_TT_DRF_CUST type DRF_REL_OBJECT_TYPE value 'MDG_BS_BP_TT_CUSTOMER' ##NO_TEXT. 40 class-data GT_ECC_CLIENT_CUST type TT_MDG_BS_ECC_CUSNR . 41private section. 42 43 types: 44 tt_obj_id type table of mdg_bp_object_id . 45 types: 46 tt_mdg_bs_bp_knb1 type sorted table of mdg_bs_bp_s_knb1 with unique key bukrs . 47 48 data GC_ASSIGN_CAT type MDG_BP_ASSIGNMENT_CAT . 49 data GS_ECC_CLIENT_CUSP type MDG_BS_ECC_CUSCP . 50 constants: 51 begin of gc_msg_type, 52 clfmas type tbdme-mestyp value 'CLFMAS' ##NO_TEXT, 53 debmas type tbdme-mestyp value 'ZDEBMAS' ##NO_TEXT, 54 end of gc_msg_type . 55 class-data GS_ECC_CLIENT_CUST type MDG_BS_ECC_CUSNR . 56 57 methods GET_VKORG_FILTER 58 importing 59 !IS_RUNTIME_PARAM type DRF_S_RUNTIME_PARAMETER_EXT 60 exporting 61 !ET_FILTERED_KNVV type TT_MDG_BS_BP_KNVV . 62 methods PREPARE_GOV_SCOPE . 63 methods SEND_CLFMAS_IDOC 64 importing 65 !IS_BUS_SYS_TECH type MDG_S_BUS_SYS_TECH 66 !IS_CUSTOMER_SEND_DATA type BDIKNA1KEY 67 changing 68 !CV_APPEND_REP_ENTRY type ABAP_BOOL 69 !CT_OBJ_REP_STA type DRF_T_OBJ_REP_STA_FULL . 70 methods GET_CUST_CONTACT_PERSONS 71 importing 72 !IV_KUNNR_HUB type KUNNR 73 !IV_CLNT_BUS_SYSTEM type MDG_BUSINESS_SYSTEM 74 exporting 75 !ET_KNVKADR_HUB type TT_KNVKADR 76 !ET_PARNR_HUB_CLNT type TT_PARNR_HC . 77 methods GET_KUNNR_RECEIVER_IDS 78 importing 79 !IV_KUNNR type KUNNR 80 exporting 81 !ET_FOREIGN_OBJECTS type MDG_T_MATCHING_OBJ_DATA_BS . 82 methods SEND_ADR2MAS_ADR3MAS_IDOC 83 importing 84 !IS_BUS_SYS_TECH type MDG_S_BUS_SYS_TECH 85 !IS_CUSTOMER_SEND_DATA type BDIKNA1KEY 86 !IT_KNVKADR type TT_KNVKADR . 87 methods SEND_ADRMAS_IDOC 88 importing 89 !IS_BUS_SYS_TECH type MDG_S_BUS_SYS_TECH 90 !IS_CUSTOMER_SEND_DATA type BDIKNA1KEY . 91 methods SEND_DEBMAS_IDOC 92 importing 93 !IS_BUS_SYS_TECH type MDG_S_BUS_SYS_TECH 94 !IS_CUSTOMER_SEND_DATA type BDIKNA1KEY 95 !IV_APPEND_REP_ENTRY type ABAP_BOOL 96 !IS_CUST_DRF type MDG_BS_BP_S_CUSTOMER_OTC 97 changing 98 !CT_OBJ_REP_STA type DRF_T_OBJ_REP_STA_FULL . 99 methods SEND_DOLMAS_IDOC 100 importing 101 !IS_BUS_SYS_TECH type MDG_S_BUS_SYS_TECH 102 !IS_CUSTOMER_SEND_DATA type BDIKNA1KEY . 103 methods READ_KEY_MAPPING 104 importing 105 !IV_HUB_BP_ID type MDG_OBJECT_ID_BS 106 !IV_HUB_SYSTEM type MDG_BUSINESS_SYSTEM 107 !IV_CLNT_SYSTEM type MDG_BUSINESS_SYSTEM 108 exporting 109 !ET_HUB_CUST_IDENT type MDG_T_IDENTIFIER_DATA_BS . 110 methods GET_CUST_ID_FROM_BP_ID 111 importing 112 !IV_PARTNER type BU_PARTNER 113 exporting 114 !EV_KUNNR type KUNNR . 115 methods GET_BP_ID_FROM_CUST_ID 116 importing 117 !IV_KUNNR type KUNNR 118 exporting 119 !EV_PARTNER type BU_PARTNER . 120 methods GET_IDENT_FROM_BP_ID

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

Related questions and keywords

Alternative questions

  • How do I implement customer outbound replication in MDG DRF with key mapping and IDoc sending?
  • Which methods are used in a custom MDG customer outbound class for BP-to-customer mapping?
  • How does ZCL_MDG_BS_CUST_ALE_DRF handle customer replication outbound?

Possible questions

  • How does the class determine the outbound customer ID?
  • Which helper builds the IDoc payload for a specific object type?
  • Which methods depend on DRF filter objects or MDG matching services?
  • Where is key mapping read or written?
  • Which outbound methods are relevant for customer master replication?

Keywords

SAP MDGDRF outboundcustomer replicationIDockey mappingIF_MDG_ID_MATCHING_API_BSCVI_KA_BP_CUSTOMERCL_MDG_CA_GET_OWN_BUS_SYSMDG_BS_ECC_CUSCPMDG_BS_ECC_CUSNR