SAP MDG · REPLICATION OUTBOUND

How do I implement the MDG Business Partner outbound BAdI to enrich the bulk replication request?

Implement `IF_MDG_SE_BP_BULK_REPLRQ_OUT~OUTBOUND_PROCESSING` in a public class that implements `IF_BADI_INTERFACE` and `IF_MDG_SE_BP_BULK_REPLRQ_OUT`. The sample pattern enriches the outbound BP proxy by copying custom customer fields, sales-area data from `KNVV`, permit-payee data from `KNZA`, license data from `KNVL`, Thailand branch data, Brazil append fields, and target-system-specific bank ID adjustments.

Implement `IF_MDG_SE_BP_BULK_REPLRQ_OUT~OUTBOUND_PROCESSING` in a public class that implements `IF_BADI_INTERFACE` and `IF_MDG_SE_BP_BULK_REPLRQ_OUT`. The sample pattern enriches the outbound BP proxy by copying custom customer fields, sales-area data from `KNVV`, permit-payee data from `KNZA`, license data from `KNVL`, Thailand branch data, Brazil append fields, and target-system-specific bank ID adjustments.

`IF_MDG_SE_BP_BULK_REPLRQ_OUT` is the outbound proxy BAdI for Business Partner bulk replication. In the sample class `ZCL_MDG_BP_BULKREQ_OUT`, the `OUTBOUND_PROCESSING` method copies customer central-data append fields, sales-area extensions, permit-payee and license tables, Thailand branch data, Brazil-specific append values, and target-system-dependent bank IDs into the outbound proxy structure.

Process flow

  1. Implement a public final class for the outbound BAdI.
  2. Add interfaces IF_BADI_INTERFACE and IF_MDG_SE_BP_BULK_REPLRQ_OUT.
  3. Code the logic in IF_MDG_SE_BP_BULK_REPLRQ_OUT~OUTBOUND_PROCESSING.
  4. Copy customer central data into the outbound proxy fields.
  5. Read KNVV for sales-area custom fields and assign them to sales arrangement rows.
  6. Read KNZA and append permit-payee rows to the proxy table.
  7. Read KNVL and move license rows into the sales arrangement extension.
  8. Call ZMDG_GET_THAILAND_BRANCH for Thailand branch data and append the result rows to the outbound proxy structure of the customer node.

TVARVC: ZMDGS_BUSINESS_SYSTEM (TYPE = 'S', HIGH = 'DHS')

Drive the target-system-specific bank account external ID rewrite logic.

Referenced tables

ObjectPurpose
KNVVSales-area customer data source for custom outbound mapping.
KNZAPermit-payee customer data source appended to the outbound proxy.
KNVLCustomer license data source copied into the outbound sales-arrangement extension.
KNA1Source for Brazil-specific append fields copied dynamically into the outbound common extension.
TVARVCStores the business-system filter used to decide whether bank account IDs are rewritten.

ILLUSTRATIVE ABAP SAMPLE

Source ABAP example

Exact relevant implementation excerpt from the knowledge document.

1class ZCL_MDG_BP_BULKREQ_OUT definition 2 public 3 final 4 create public . 5 6public section. 7 8 interfaces IF_BADI_INTERFACE . 9 interfaces IF_MDG_SE_BP_BULK_REPLRQ_OUT . 10protected section. 11private section. 12ENDCLASS. 13 14 15 16CLASS ZCL_MDG_BP_BULKREQ_OUT IMPLEMENTATION. 17 18 19 METHOD if_mdg_se_bp_bulk_replrq_out~outbound_processing. 20 DATA:ls_zknza TYPE zzmdgproxy_zknza, 21 lv_bp_nummr TYPE wt_acno, 22 ls_branch_data TYPE zzmdgproxy_zmdg_thailand_bran3, 23 lt_thai TYPE STANDARD TABLE OF zmdg_thailand_update_str, 24 ls_knvl TYPE zzmdgproxy_zmdg_knvl_license1, 25 lt_knvl1 TYPE zzmdgproxy_zmdg_knvl_licen_tab. 26 27 DATA: r_descr TYPE REF TO cl_abap_structdescr, 28 ls_comp TYPE abap_compdescr, 29 ls_brazil_ext TYPE LINE OF zmdg_sup_zaddl_attr_tab, 30 lt_addr_attr LIKE LINE OF out-business_partner-common, 31 ls_brazil TYPE kna1brazil. 32 33 CLEAR:lt_knvl1,ls_knvl,ls_branch_data,lt_thai,ls_zknza,lv_bp_nummr. 34 35* Map the customer kna1 custom fields. 36 37 out-business_partner-customer-zzmdgproxy_apprlevel = in-customer-central_data-central-data-zzapprlevel. 38 out-business_partner-customer-zzmdgproxy_apprwithres = in-customer-central_data-central-data-zzappwithres. 39 out-business_partner-customer-zzmdgproxy_bpmappstat = in-customer-central_data-central-data-zzbpmappstat. 40 out-business_partner-customer-zzmdgproxy_bpmsecurid = in-customer-central_data-central-data-zzbpmsecurid. 41 out-business_partner-customer-zzmdgproxy_dualgrpcd = in-customer-central_data-central-data-zzdualgrpcd. 42 out-business_partner-customer-zzmdgproxy_eori = in-customer-central_data-central-data-zzeori. 43 out-business_partner-customer-zzmdgproxy_eucb = in-customer-central_data-central-data-zzeucb. 44 out-business_partner-customer-zzmdgproxy_ftzepz = in-customer-central_data-central-data-zzftz_epz. 45 out-business_partner-customer-zzmdgproxy_guestacct = in-customer-central_data-central-data-zzguestacct. 46 out-business_partner-customer-zzmdgproxy_ind_bus_code = in-customer-central_data-central-data-zzwwibc. 47 out-business_partner-customer-zzmdgproxy_orgid = in-customer-central_data-central-data-zzorgid. 48 out-business_partner-customer-zzmdgproxy_salesman = in-customer-central_data-central-data-zzsmn. 49 out-business_partner-customer-zzmdgproxy_trdscrn = in-customer-central_data-central-data-zztrdscrn. 50 out-business_partner-customer-zzmdgproxy_cu_txin = in-customer-central_data-central-data-zzcu_txin. 51*** BOC S4 Field Mapping Kabil Gandhi 52 out-business_partner-customer-zzmdgproxy_cusbp = in-customer-central_data-central-data-zzcusbp. 53 out-business_partner-customer-zzmdgproxy_gcmapst = in-customer-central_data-central-data-zzgcmapst. 54*** EOC S4 Field Mapping Kabil Gandhi 55****Customer Pan No Enhancement Kabil Gandhi 56 IF in-customer-central_data-central-data-j_1ipanno IS NOT INITIAL. 57 out-business_partner-customer-zzmdgproxy_j_1ipanno = in-customer-central_data-central-data-j_1ipanno. 58 ENDIF. 59****Customer Pan No Enhancement Kabil Gandhi 60 IF in-customer-header-object_instance-kunnr IS NOT INITIAL. 61* Map Customer Master knvv custom fields. 62 IF out-business_partner-customer-sales_arrangement[] IS NOT INITIAL. 63 SELECT * 64 INTO TABLE @DATA(lt_knvv) 65 FROM knvv 66 FOR ALL ENTRIES IN @out-business_partner-customer-sales_arrangement 67 WHERE kunnr EQ @in-customer-header-object_instance-kunnr 68 AND vkorg EQ @out-business_partner-customer-sales_arrangement-sales_organisation_id(4). 69 IF sy-subrc = 0. 70 LOOP AT out-business_partner-customer-sales_arrangement[] ASSIGNING FIELD-SYMBOL(<lfs_s_sales_org>). 71 72 DATA(lv_vtweg) = <lfs_s_sales_org>-distribution_channel_code. 73 DATA(lv_spart) = <lfs_s_sales_org>-division_code. 74 75 READ TABLE lt_knvv INTO DATA(ls_knvv) WITH KEY 76 vkorg = <lfs_s_sales_org>-sales_organisation_id. 77* VTWEG = lv_vtweg Check mapping. 78* spart = lv_spart. 79 <lfs_s_sales_org>-zzmdgproxy_agrmntdl = ls_knvv-zzagrmntdl. 80 <lfs_s_sales_org>-zzmdgproxy_allowesqty = ls_knvv-zzallowesqty. 81 <lfs_s_sales_org>-zzmdgproxy_altacct = ls_knvv-zzaltacct. 82 <lfs_s_sales_org>-zzmdgproxy_atp_res = ls_knvv-zzatp_res. 83 <lfs_s_sales_org>-zzmdgproxy_bkg_wndw = ls_knvv-zzbkg_wndw. 84 <lfs_s_sales_org>-zzmdgproxy_bkprdetermn = ls_knvv-zzbkprdetermine. 85 <lfs_s_sales_org>-zzmdgproxy_blocksa = ls_knvv-zzblocksa. 86 <lfs_s_sales_org>-zzmdgproxy_chgorder = ls_knvv-zzchgorder. 87 <lfs_s_sales_org>-zzmdgproxy_cntrlprtcert = ls_knvv-zzcntrlprt_cert. 88 <lfs_s_sales_org>-zzmdgproxy_cntrlval = ls_knvv-zzcntrlval. 89 <lfs_s_sales_org>-zzmdgproxy_cutoff = ls_knvv-zzcutoff. 90 <lfs_s_sales_org>-zzmdgproxy_delays = ls_knvv-zzdeldays. 91 <lfs_s_sales_org>-zzmdgproxy_drp_sur = ls_knvv-zz_drp_sur. 92 <lfs_s_sales_org>-zzmdgproxy_ediaccpt = ls_knvv-zzediaccpt. 93 <lfs_s_sales_org>-zzmdgproxy_ewpship = ls_knvv-zzewpship. 94 <lfs_s_sales_org>-zzmdgproxy_ewreqd = ls_knvv-zzewreqd. 95 <lfs_s_sales_org>-zzmdgproxy_exclgrp = ls_knvv-zzexclgrp. 96 <lfs_s_sales_org>-zzmdgproxy_expcode = ls_knvv-zzexpcode. 97 <lfs_s_sales_org>-zzmdgproxy_fisorders = ls_knvv-zzfis_orders. 98 <lfs_s_sales_org>-zzmdgproxy_forhorizon = ls_knvv-zzforhorizon. 99 <lfs_s_sales_org>-zzmdgproxy_frtmin = ls_knvv-zzfrtmin. 100 <lfs_s_sales_org>-zzmdgproxy_frweks = ls_knvv-zzfrweks. 101 <lfs_s_sales_org>-zzmdgproxy_hndcharg = ls_knvv-zzhndcharg. 102 <lfs_s_sales_org>-zzmdgproxy_inscst = ls_knvv-zzinscst. 103 <lfs_s_sales_org>-zzmdgproxy_invgrp = ls_knvv-zzinvgrp. 104 <lfs_s_sales_org>-zzmdgproxy_leadfree = ls_knvv-zzl

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

Related questions and keywords

Alternative questions

  • Which class and interface are used for MDG BP outbound bulk replication request enhancement?
  • How do I map custom customer fields, sales-area data, permit-payee data, and country-specific extensions in IF_MDG_SE_BP_BULK_REPLRQ_OUT?
  • How do I rewrite outbound business partner bank IDs and copy Thailand or Brazil-specific extension data in MDG outbound processing?

Possible questions

  • What sample class implements the outbound BAdI?
  • Which interface is used?
  • How do I map custom customer fields in outbound_processing?
  • How do I copy KNVV, KNZA, and KNVL data into the outbound payload?
  • How do I adjust outbound bank account IDs based on target system?
  • How do I transfer Brazil extension fields to the outbound proxy?

Keywords

IF_MDG_SE_BP_BULK_REPLRQ_OUTIF_BADI_INTERFACEZCL_MDG_BP_BULKREQ_OUToutbound_processingKNVVKNZAKNVLKNA1TVARVCCL_ABAP_STRUCTDESCRZMDG_GET_THAILAND_BRANCH