SAP MDG · REPLICATION INBOUND
How do I implement vendor inbound validation in an SAP MDG proxy class so only eligible supplier records are accepted for BPM processing?
Vendor BPM inbound validation typically checks whether the business partner exists, is created as a supplier, has a valid supplier account group, has the required commodity code, and carries acceptable BPM status fields. In `ZCL_SI_MDG_VENDOR_INBOUND->MDG_VALIDATE_BPM_VENDOR`, invalid records are split into discarded output with structured error messages, while valid records are appended to the validated table.
Vendor BPM inbound validation typically checks whether the business partner exists, is created as a supplier, has a valid supplier account group, has the required commodity code, and carries acceptable BPM status fields. In `ZCL_SI_MDG_VENDOR_INBOUND->MDG_VALIDATE_BPM_VENDOR`, invalid records are split into discarded output with structured error messages, while valid records are appended to the validated table.
Vendor BPM inbound validation in MDG follows a strict eligibility chain: normalize the supplier number, check that the BP exists in `BUT000`, confirm supplier role existence in `BUT100` for `FLVN00` or `FLVN01`, verify the vendor account group in `LFA1`, derive the commodity code from classification data in `AUSP`, and finally validate BPM approval/status fields before accepting the record. Invalid entries are returned with structured error messages and moved to the discarded list.
Process flow
- Loop through inbound vendor records.
- Normalize the supplier account number with `CONVERSION_EXIT_ALPHA_INPUT`.
- Read BP master data from `BUT000` and supplier roles from `BUT100`.
- Check whether the supplier role is `FLVN00` or `FLVN01`.
- Read supplier account group from `LFA1` and validate allowed values.
- Resolve the classification characteristic with `CONVERSION_EXIT_ATINN_INPUT` for `VENDOR_MATERIAL_GROUP`.
- Read the commodity code from `AUSP` and verify mapping in `ZMDG_BP_COMM` with `zcom_bpm = 'X'`.
- Validate BPM application level and partner block status fields.
Referenced tables
| Object | Purpose |
|---|---|
BUT000 | Business partner existence and basic BP attributes. |
BUT100 | Business partner role assignment used to confirm supplier roles `FLVN00` and `FLVN01`. |
LFA1 | Vendor master account group validation through field `KTOKK`. |
AUSP | Classification characteristic value lookup for `VENDOR_MATERIAL_GROUP`. |
ZMDG_BP_COMM | Custom mapping table used to confirm BPM-relevant commodity codes with `zcom_bpm = 'X'`. |
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example
Exact relevant implementation excerpt from the knowledge document.
1METHOD mdg_validate_bpm_vendor.
2 TYPES: BEGIN OF ty_but000,
3 partner TYPE but000-partner,
4 bu_group TYPE but000-bu_group,
5 type TYPE but000-type,
6 partner_guid TYPE but000-partner_guid,
7 END OF ty_but000,
8
9 BEGIN OF ty_but100,
10 partner TYPE but100-partner,
11 rltyp TYPE bu_partnerrole,
12 END OF ty_but100.
13
14
15 DATA:
16 ls_vendor TYPE zdt_mdg_vendor_record,
17 ls_vendor_formated TYPE zmdg_bpm_vendor_record,
18 ls_crequest TYPE usmd_s_crequest,
19 ls_message TYPE bapiret2,
20 ls_usmd_value TYPE usmd_s_value,
21 lt_but000 TYPE TABLE OF ty_but000,
22 lt_but100 TYPE TABLE OF ty_but100,
23 lt_usmd_value TYPE usmd_ts_value,
24 lt_message TYPE bapiret2_t,
25 lt_out_message TYPE cvis_message,
26 lt_mdg_message TYPE usmd_t_message,
27 lt_crequest TYPE usmd_ts_crequest,
28 lv_app_level TYPE zmdg_de_deapprlvl,
29 lv_app_status TYPE zmdg_de_bpmappstat,
30 lv_atinn TYPE ausp-atinn,
31 lv_atwrt TYPE ausp-atwrt,
32 lv_ktokk TYPE lfa1-ktokk,
33 lv_partner TYPE bu_partner,
34 lv_sec_id TYPE zsecurim.
35
36 LOOP AT it_current_vendor INTO ls_vendor.
37 CLEAR: lt_usmd_value, lt_crequest, ls_crequest.
38
39 lv_partner = ls_vendor-partner_te_supplier_acct_nbr.
40
41 CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
42 EXPORTING
43 input = lv_partner
44 IMPORTING
45 output = lv_partner.
46
47 ls_vendor_formated-partner_te_supplier_acct_nbr = lv_partner.
48 ls_vendor_formated-partner_profile_id = ls_vendor-partner_profile_id.
49 ls_vendor_formated-bpm_app_level_code = ls_vendor-bpm_app_level_code.
50 ls_vendor_formated-partner_block_status_code = ls_vendor-partner_block_status_code.
51
52 SELECT partner bu_group type partner_guid INTO TABLE lt_but000
53 FROM but000
54 WHERE partner = lv_partner. "#EC CI_SUBRC
55
56 SELECT partner rltyp INTO TABLE lt_but100
57 FROM but100
58 WHERE partner = lv_partner. "#EC CI_SUBRC
59
60 IF lines( lt_but000 ) >= 1.
61 LOOP AT lt_but100 INTO DATA(ls_but100) WHERE rltyp = 'FLVN00' OR rltyp = 'FLVN01'.
62 DATA(lv_sup_exits) = abap_true.
63 ENDLOOP.
64
65
66 IF lv_sup_exits = abap_true.
67 SELECT SINGLE ktokk FROM lfa1 INTO lv_ktokk
68 WHERE lifnr = lv_partner.
69
70 IF sy-subrc = 0.
71
72 IF lv_ktokk IS NOT INITIAL.
73
74 IF lv_ktokk = 'Z001' OR lv_ktokk = 'Z007' OR lv_ktokk = 'Z015'.
75
76 CALL FUNCTION 'CONVERSION_EXIT_ATINN_INPUT'
77 EXPORTING
78 input = 'VENDOR_MATERIAL_GROUP'
79 IMPORTING
80 output = lv_atinn.
81
82 SELECT SINGLE atwrt FROM ausp INTO lv_atwrt
83 WHERE atinn = lv_atinn
84 AND objek = lv_partner. "#EC CI_SUBRC
85
86 IF lv_atwrt IS NOT INITIAL.
87 SELECT SINGLE zcomcode FROM zmdg_bp_comm INTO @DATA(lv_zcomcode)
88 WHERE zcomcode = @lv_atwrt
89 AND zcom_bpm = 'X'.
90
91 IF sy-subrc = 0."IS BPM
92 IF ls_vendor_formated-bpm_app_level_code NE '0'.
93 CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
94 EXPORTING
95 input = ls_vendor_formated-bpm_app_level_code
96 IMPORTING
97 output = ls_vendor_formated-bpm_app_level_code.
98
99 IF ls_vendor_formated-partner_block_status_code NE '0'.
100 CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
101 EXPORTING
102 input = ls_vendor_formated-partner_block_status_code
103 IMPORTING
104 output = ls_vendor_formated-partner_block_status_code.
105
106 APPEND ls_vendor_formated TO et_validated_vendor.
107 ELSE.
108 "& Business Partner &1, invalid Approval Level for BPM &2
109 ls_message-id = 'ZMDG_BP_BPM_INTF'.
110 ls_message-number = 019.
111 ls_message-type = 'E'.
112 ls_message-message_v1 = lv_partner.
113 ls_message-message_v2 = ls_vendor_formated-partner_block_status_code.
114 APPEND ls_message TO lt_message.
115 CLEAR ls_message.
116 lt_out_message-is_error = abap_true.
117 lt_out_message-messages = lt_message.
118 ls_vendor_formated-error_messages = lt_out_message.
119 APPEND ls_vendor_formated TO et_discarded_vendor.
120 CLEAR: lt_out_message, lt_message.The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How does `ZCL_SI_MDG_VENDOR_INBOUND->MDG_VALIDATE_BPM_VENDOR` work?
- How do I validate vendor inbound payloads before MDG processing?
- How do I reject invalid supplier records in MDG inbound validation?
Possible questions
- What checks are performed in `MDG_VALIDATE_BPM_VENDOR`?
- Which tables are read during vendor BPM validation?
- How are validation errors collected for rejected vendors?
- What are the typical supplier eligibility rules in the inbound proxy?
- Can you show the ABAP pattern for vendor inbound validation?