SAP MDG · REPLICATION OUTBOUND

How do I implement MDG Business Partner supplier outbound enrichment in IF_MDG_SE_BP_BULK_REPLRQ_OUT?

Implement the supplier outbound BAdI method by reading active BP entity data from model BP, mapping custom fields from BP_VENGEN, BP_COMPNY, and BP_PORG into the proxy structure, copying LFZA and Thailand branch extensions, and clearing supplying plant data when the SNP wave check fails for configured target systems.

Implement the supplier outbound BAdI method by reading active BP entity data from model BP, mapping custom fields from BP_VENGEN, BP_COMPNY, and BP_PORG into the proxy structure, copying LFZA and Thailand branch extensions, and clearing supplying plant data when the SNP wave check fails for configured target systems.

`ZCL_BP_SUPPL_OUT` implements `IF_MDG_SE_BP_BULK_REPLRQ_OUT~OUTBOUND_PROCESSING` for supplier outbound enrichment. The method reads active BP entity data from model `BP`, copies custom supplier fields into the outbound proxy, transfers permit-payee and Thailand branch extensions, and applies a target-system check to clear the supplying plant when the SNP wave is not valid.

Process flow

  1. Implement or enhance `IF_MDG_SE_BP_BULK_REPLRQ_OUT~OUTBOUND_PROCESSING` in `ZCL_BP_SUPPL_OUT`.
  2. Create the MDG model instance with `CL_USMD_MODEL_EXT=>GET_INSTANCE` for model `BP`.
  3. Read active entity data with `READ_ENTITY_DATA_ALL` for `BP_HEADER` using the outbound internal ID converted with `ALPHA = IN`.
  4. Extract custom rows from `ZBP_SUPPL` and append them to the outbound common extension table.
  5. Map supplier general custom fields from `BP_VENGEN` to the outbound supplier node.
  6. Map company-code fields from `BP_COMPNY` into matching rows in `SUPPLIER-ACCOUNTING_INFORMATION`.
  7. Map procurement fields from `BP_PORG` into matching rows in `SUPPLIER-PROCUREMENT_ARRANGEMENT`.
  8. Read `LFZA` permit-payee records and append them to the supplier outbound permit-payee table.

Referenced tables

ObjectPurpose
LFZAPermit-payee vendor data selected and copied into the outbound supplier payload.
TVARVCStores the target-system control entry `ZMDG_STO_VENDOR_REP` used before suppressing supplying plant output.

ILLUSTRATIVE ABAP SAMPLE

Source ABAP example

Exact relevant implementation excerpt from the knowledge document.

1class ZCL_BP_SUPPL_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_BP_SUPPL_OUT IMPLEMENTATION. 17 18 19 METHOD if_mdg_se_bp_bulk_replrq_out~outbound_processing. 20 21 DATA:ls_zlfza TYPE zzmdgproxy_zlfza, 22 lv_bp_nummr TYPE wt_acno, 23 ls_branch_data TYPE zzmdgproxy_zmdg_thailand_bran1, 24 lt_thai TYPE STANDARD TABLE OF zmdg_thailand_update_str, 25 lv_bp_num TYPE lfa1-lifnr, 26 lt_sel TYPE usmd_ts_sel, 27 ls_sel TYPE LINE OF usmd_ts_sel, 28 ls_lfa1m TYPE e1lfa1m, 29 lt_addr_attr LIKE LINE OF out-business_partner-common, 30 r_descr TYPE REF TO cl_abap_structdescr, 31 wa_comp TYPE abap_compdescr, 32 lv_dest TYPE rfcdest, 33 ls_zfields TYPE zmdgbp_s_bp_pp_zbp_suppl, 34 wa_zlfa1_ext3 TYPE LINE OF zmdg_sup_zaddl_attr_tab, 35 lt_wave TYPE zmdg_snp_wave_tt, 36 lt_werks TYPE table_werks, 37 ls_werks TYPE werks. 38 39 40 FIELD-SYMBOLS:<ft_data> TYPE ANY TABLE. 41 42 cl_usmd_model_ext=>get_instance( 43 EXPORTING 44 i_usmd_model = 'BP' 45 IMPORTING 46 eo_instance = DATA(lo_model_ext) 47 et_message = DATA(lt_message1) ). 48 49 50 wa_zlfa1_ext3-f_name = 'LIFNR'. 51 wa_zlfa1_ext3-f_value = ls_lfa1m-lifnr. 52 CLEAR:ls_sel, lt_sel. 53 54 55* lv_bp_num = in-vendor-header-object_instance."commented by kabil 56 lv_bp_num = out-business_partner-internal_id."Added By kabil 05/24/2026 57 lv_bp_num = |{ lv_bp_num ALPHA = IN }|. 58 ls_sel-fieldname = 'BP_HEADER'. 59 ls_sel-low = lv_bp_num. 60 ls_sel-sign = 'I'. 61 ls_sel-option = 'EQ'. 62 APPEND ls_sel TO lt_sel. 63 64 CALL METHOD lo_model_ext->read_entity_data_all 65 EXPORTING 66 i_fieldname = 'BP_HEADER' 67 if_active = 'X' 68 it_sel = lt_sel 69 IMPORTING 70 et_message = DATA(lt_message) 71 et_data_entity = DATA(lt_active_data). 72 73 74 r_descr ?= cl_abap_typedescr=>describe_by_data( ls_zfields ). 75 76 READ TABLE lt_active_data INTO DATA(ls_active_data) WITH KEY usmd_entity_cont = 'ZBP_SUPPL'. "#EC CI_SORTSEQ 77 ASSIGN ls_active_data-r_t_data->* TO <ft_data>. 78 IF <ft_data> IS ASSIGNED. 79 LOOP AT <ft_data> ASSIGNING FIELD-SYMBOL(<fs_data>). 80 LOOP AT r_descr->components INTO wa_comp. 81 ASSIGN: COMPONENT wa_comp-name OF STRUCTURE <fs_data> TO FIELD-SYMBOL(<fs_val>). 82 IF sy-subrc EQ 0 AND <fs_val> IS ASSIGNED. 83 wa_zlfa1_ext3-f_name = wa_comp-name. 84 wa_zlfa1_ext3-f_value = <fs_val>. 85* ls_idoc_data-sdata = wa_zlfa1_ext3. 86 APPEND wa_zlfa1_ext3 TO lt_addr_attr-zmdg_sup_zaddl_attr_tab. 87 ENDIF. 88 ENDLOOP. 89 ENDLOOP. 90 ENDIF. 91 92 93 READ TABLE out-business_partner-common ASSIGNING FIELD-SYMBOL(<fs_common>) INDEX 1. 94 IF sy-subrc EQ 0. 95 <fs_common>-zmdg_sup_zaddl_attr_tab = lt_addr_attr-zmdg_sup_zaddl_attr_tab. 96 ENDIF. 97 98* Begin, 15/07/24 Samar, TE579309 99 """""""""LFA1 data""""""""""""" 100 READ TABLE lt_active_data INTO ls_active_data WITH KEY usmd_entity_cont = 'BP_VENGEN'. "#EC CI_SORTSEQ 101 ASSIGN ls_active_data-r_t_data->* TO <ft_data>. 102 IF <ft_data> IS ASSIGNED. 103 LOOP AT <ft_data> ASSIGNING <fs_data>. 104 ASSIGN COMPONENT 'ZZAPPRLEV' OF STRUCTURE <fs_data> TO FIELD-SYMBOL(<fs_zzapprlev>). 105 IF <fs_zzapprlev> IS ASSIGNED. 106 out-business_partner-supplier-zmdg_sup_zzapprlevel = <fs_zzapprlev>. 107 ENDIF. 108 ASSIGN COMPONENT 'ZZBPMST' OF STRUCTURE <fs_data> TO FIELD-SYMBOL(<fs_zzbpmst>). 109 IF <fs_zzbpmst> IS ASSIGNED. 110 out-business_partner-supplier-zmdg_sup_zzbpmst = <fs_zzbpmst>. 111 ENDIF. 112 ASSIGN COMPONENT 'ZZSECM_ID' OF STRUCTURE <fs_data> TO FIELD-SYMBOL(<fs_zzsecm_id>). 113 IF <fs_zzsecm_id> IS ASSIGNED. 114 out-business_partner-supplier-zmdg_sup_zzsecm_id = <fs_zzsecm_id>. 115 ENDIF. 116 ASSIGN COMPONENT 'ZZTARESP' OF STRUCTURE <fs_data> TO FIELD-SYMBOL(<fs_zztaresp>). 117 IF <fs_zztaresp> IS ASSIGNED. 118 out-business_partner-supplier-zmdg_sup_zztaresp = <fs_zztaresp>. 119 ENDIF. 120 ENDLOOP.

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

Related questions and keywords

Alternative questions

  • How do I fill custom supplier fields in MDG BP outbound replication?
  • How do I enhance BP supplier outbound payload before replication?
  • How do I copy supplier custom fields into the MDG outbound proxy structure?

Possible questions

  • How can I map custom supplier fields from BP entities to the outbound proxy?
  • How do I add Thailand branch, permit payee, PAN, accounting, and procurement fields to supplier outbound?
  • How do I suppress invalid supplying plant data based on SNP wave and target system?
  • Which MDG entities are read in supplier bulk outbound processing?
  • How do I adapt a customer outbound enrichment pattern for suppliers?

Keywords

MDGBusiness Partnersupplier outboundbulk replicationIF_MDG_SE_BP_BULK_REPLRQ_OUToutbound_processingCL_USMD_MODEL_EXTBP_HEADERBP_VENGENBP_COMPNYBP_PORGLFZATVARVCSNP waveThailand branchpermit payeeABAP