SAP MDG · CONSOLIDATION
How can CL_MDC_DATA_BP be enhanced to support custom Business Partner consolidation tables in SAP MDG?
Example Code: Consolidation Custom Table BP Customer Supplier
This document describes two custom SAP MDG Business Partner consolidation classes:
SAP MDG Consolidation – Custom BP Data and Model Classes
Scope
This document describes two custom SAP MDG Business Partner consolidation classes:
ZCL_MDC_DATA_BP– data-layer extension for custom BP consolidation objects.ZCL_MDC_MODEL_BP– model-layer extension for reading, mapping, validating, and saving custom BP data.
The source has been cleaned so that comments contain only functional information. Personal names, project/change-history metadata, transport references, and defect identifiers have been removed.
Technical note: DDIC fields and framework attributes namedCLIENT,MANDT,active_client_field, orclient_fieldare retained because they are executable technical elements of the implementation, not documentary references to an implementation customer.
1. Class ZCL_MDC_DATA_BP
1.1 Purpose
ZCL_MDC_DATA_BP extends SAP standard class CL_MDC_DATA_BP to provide data-layer metadata and active-record handling for custom Business Partner consolidation objects.
The class primarily supports:
- Custom supplier tax-classification data.
- Custom address-remark data.
- Custom duplicate-detection data.
- Mapping between active tables, source tables, process tables, key structures, attribute structures, and DDIC table types.
1.2 Inheritance
- Superclass:
CL_MDC_DATA_BP - Redefined interface:
IF_MDC_DATA
The standard superclass behavior is retained as the fallback for objects that are not explicitly handled by the custom class.
1.3 Main Methods
IF_MDC_DATA~APPEND_ACTIVE_RECORDS
Appends active-area records for source keys participating in the consolidation process.
Current explicit routing:
ZMDG_T_IDPLBPTAX→APPEND_SUPPLIER_DATAZMDG_T_ADRT→APPEND_ADDRESS_DATA- Other objects → standard superclass implementation
APPEND_ZNPSCDUP_DATA
Reads duplicate-related active data by Business Partner number and appends corresponding records to the generic MDC record buffer.
The method joins:
- BUT000
- ZMDG_BP_ZNPSCDUP
using PARTNER, and maps the Business Partner number to SOURCE_ID.
Implementation note: the method is defined and implemented, but the current APPEND_ACTIVE_RECORDS method does not contain an explicit ZMDG_BP_ZNPSCDUP branch calling it.
IF_MDC_DATA~ATTRIBUTE_STRUCTURE_NAME
Returns the custom attribute structure associated with a custom consolidation object.
Custom mappings include:
ZMDG_T_IDPLBPTAX→ZMDC_ZMDG_T_IDPLBPTAX_ATTRIBUTZMDG_BP_ZNPSCDUP→ZMDC_ZMDG_BP_ZNPSCDUP_ATTR
IF_MDC_DATA~KEY_STRUCTURE_NAME
Returns the corresponding DDIC key structure.
Custom mappings include:
ZMDG_T_IDPLBPTAX→ZMDC_ZMDG_T_IDPLBPTAX_KEYZMDG_BP_ZNPSCDUP→ZMDC_ZMDG_BP_ZNPSCDUP_KEY
IF_MDC_DATA~TABLE_NAME_BY_TYPE
Defines source/process persistence tables and key-field metadata for custom MDC objects.
For ZMDG_T_IDPLBPTAX:
- Source table:
ZZMDG_T_IDPL_SRC - Process table:
ZZMDG_T_IDPL_PRC - Source identifier:
LIFNR
For ZMDG_BP_ZNPSCDUP:
- Source table:
ZMDG_BP_DUP_SRC - Process table:
ZMDG_BP_DUP_PRC - Source identifier:
PARTNER
IF_MDC_DATA~TABLE_TYPE_NAME_BY_TYPE
Provides the DDIC table-type names corresponding to source and process tables.
1.4 Functional Flow
1Source Keys
2 |
3 v
4IF_MDC_DATA~APPEND_ACTIVE_RECORDS
5 |
6 +-- Tax Classification --> APPEND_SUPPLIER_DATA
7 |
8 +-- Address Remarks -----> APPEND_ADDRESS_DATA
9 |
10 +-- Other Objects -------> Standard CL_MDC_DATA_BPThe metadata methods independently resolve the DDIC structures and persistence objects required by the MDC framework.
1.5 Complete Cleaned Code – ZCL_MDC_DATA_BP
1CLASS zcl_mdc_data_bp DEFINITION
2 PUBLIC
3 INHERITING FROM cl_mdc_data_bp
4 CREATE PUBLIC.
5
6 PUBLIC SECTION.
7
8 METHODS if_mdc_data~append_active_records
9 REDEFINITION.
10 METHODS if_mdc_data~attribute_structure_name
11 REDEFINITION.
12 METHODS if_mdc_data~key_structure_name
13 REDEFINITION.
14 METHODS if_mdc_data~table_name_by_type
15 REDEFINITION.
16 METHODS if_mdc_data~table_type_name_by_type
17 REDEFINITION.
18
19 PROTECTED SECTION.
20
21 METHODS append_znpscdup_data
22 IMPORTING
23 !it_bp_source_keys TYPE tt_bp_source_keys.
24
25 PRIVATE SECTION.
26
27ENDCLASS.
28
29
30CLASS zcl_mdc_data_bp IMPLEMENTATION.
31
32 METHOD append_znpscdup_data.
33
34 FIELD-SYMBOLS <fss_records> TYPE STANDARD TABLE.
35 FIELD-SYMBOLS <fss_znpscdup> TYPE zmdc_tt_zmdg_bp_znpscdup_prc.
36
37 ASSIGN me->records->* TO <fss_records>.
38
39 IF <fss_records> IS ASSIGNED.
40 SELECT a~partner AS source_id,
41 b~*
42 APPENDING CORRESPONDING FIELDS OF TABLE @<fss_records>
43 FROM but000 AS a
44 INNER JOIN zmdg_bp_znpscdup AS b
45 ON b~partner = a~partner
46 FOR ALL ENTRIES IN @it_bp_source_keys
47 WHERE a~partner = @it_bp_source_keys-source_id.
48 ENDIF.
49
50 ASSIGN me->records->* TO <fss_znpscdup>.
51
52 ENDMETHOD.
53
54
55 METHOD if_mdc_data~append_active_records.
56
57 DATA lt_bp_source_keys TYPE tt_bp_source_keys.
58
59 CHECK me->process_relevant = abap_true.
60 CHECK it_source_keys IS NOT INITIAL.
61
62 lt_bp_source_keys = CONV #( it_source_keys ).
63
64 CASE me->table_name.
65 WHEN 'ZMDG_T_IDPLBPTAX'.
66 me->append_supplier_data( lt_bp_source_keys ).
67
68 WHEN 'ZMDG_T_ADRT'.
69 me->append_address_data( lt_bp_source_keys ).
70
71 WHEN OTHERS.
72 super->if_mdc_data~append_active_records( it_source_keys ).
73 ENDCASE.
74
75 ENDMETHOD.
76
77
78 METHOD if_mdc_data~attribute_structure_name.
79
80 CALL METHOD super->if_mdc_data~attribute_structure_name
81 EXPORTING
82 iv_name_prefixing = iv_name_prefixing
83 RECEIVING
84 rv_structure_name = rv_structure_name.
85
86 CASE me->table_name.
87 WHEN 'ZMDG_T_IDPLBPTAX'.
88 rv_structure_name = 'ZMDC_ZMDG_T_IDPLBPTAX_ATTRIBUT'.
89
90 WHEN 'ZMDG_BP_ZNPSCDUP'.
91 rv_structure_name = 'ZMDC_ZMDG_BP_ZNPSCDUP_ATTR'.
92
93 WHEN OTHERS.
94 ENDCASE.
95
96 ENDMETHOD.
97
98
99 METHOD if_mdc_data~key_structure_name.
100
101 CALL METHOD super->if_mdc_data~key_structure_name
102 EXPORTING
103 iv_name_prefixing = iv_name_prefixing
104 RECEIVING
105 rv_structure_name = rv_structure_name.
106
107 CASE me->table_name.
108 WHEN 'ZMDG_T_IDPLBPTAX'.
109 rv_structure_name = 'ZMDC_ZMDG_T_IDPLBPTAX_KEY'.
110
111 WHEN 'ZMDG_BP_ZNPSCDUP'.
112 rv_structure_name = 'ZMDC_ZMDG_BP_ZNPSCDUP_KEY'.
113
114 WHEN OTHERS.
115 ENDCASE.
116
117 ENDMETHOD.
118
119
120 METHOD if_mdc_data~table_name_by_type.
121
122 CALL METHOD super->if_mdc_data~table_name_by_type
123 EXPORTING
124 iv_type = iv_type
125 RECEIVING
126 rv_table_name = rv_table_name.
127
128 CASE me->table_name.
129
130 WHEN 'ZMDG_T_IDPLBPTAX'.
131 me->active_client_field = 'MANDT'.
132 me->client_field = 'CLIENT'.
133 me->source_id_field = 'LIFNR'.
134
135 CASE iv_type.
136 WHEN if_mdc_data=>gc_type-source.
137 rv_table_name = 'ZZMDG_T_IDPL_SRC'.
138
139 WHEN if_mdc_data=>gc_type-process.
140 rv_table_name = 'ZZMDG_T_IDPL_PRC'.
141 ENDCASE.
142
143 WHEN 'ZMDG_BP_ZNPSCDUP'.
144 me->active_client_field = 'CLIENT'.
145 me->client_field = 'CLIENT'.
146 me->source_id_field = 'PARTNER'.
147
148 CASE iv_type.
149 WHEN if_mdc_data=>gc_type-source.
150 rv_table_name = 'ZMDG_BP_DUP_SRC'.
151
152 WHEN if_mdc_data=>gc_type-process.
153 rv_table_name = 'ZMDG_BP_DUP_PRC'.
154 ENDCASE.
155
156 ENDCASE.
157
158 ENDMETHOD.
159
160
161 METHOD if_mdc_data~table_type_name_by_type.
162
163 CALL METHOD super->if_mdc_data~table_type_name_by_type
164 EXPORTING
165 iv_type = iv_type
166 RECEIVING
167 rv_table_type_name = rv_table_type_name.
168
169 CASE me->table_name.
170
171 WHEN 'ZMDG_T_IDPLBPTAX'.
172 CASE iv_type.
173 WHEN if_mdc_data=>gc_type-source.
174 rv_table_type_name = 'ZMDC_TT_ZZMDG_T_IDPL_SRC'.
175
176 WHEN if_mdc_data=>gc_type-process.
177 rv_table_type_name = 'ZMDC_TT_ZZMDG_T_IDPL_PRC'.
178 ENDCASE.
179
180 WHEN 'ZMDG_BP_ZNPSCDUP'.
181 CASE iv_type.
182 WHEN if_mdc_data=>gc_type-source.
183 rv_table_type_name = 'ZMDC_TT_ZMDG_BP_ZNPSCDUP_SRC'.
184
185 WHEN if_mdc_data=>gc_type-process.
186 rv_table_type_name = 'ZMDC_TT_ZMDG_BP_ZNPSCDUP_PRC'.
187 ENDCASE.
188
189 ENDCASE.
190
191 ENDMETHOD.
192
193ENDCLASS.2. Class ZCL_MDC_MODEL_BP
2.1 Purpose
ZCL_MDC_MODEL_BP extends SAP standard class CL_MDC_MODEL_BP and adds model-level handling for custom Business Partner consolidation data.
The class performs five main responsibilities:
- Reads custom process data into model references.
- Exposes MDC data objects to the model.
- Maps custom consolidation data into the CVI external API structure.
- Performs configurable processing before standard model validation.
- Saves custom active-area data after Business Partner activation.
2.2 Inheritance
- Superclass:
CL_MDC_MODEL_BP - Redefined interface method:
IF_MDC_MODEL~CHECK
The class also redefines several protected framework methods used by BP consolidation processing.
2.3 Main Data References
The model keeps process-data references for:
- ZMDG_T_IDPLBPTAX
- ZMDG_T_ADRT
- BUT020
- ZMDG_BP_ZNPSCDUP
These references are populated by READ_ALL_DATA and subsequently consumed during API mapping and active-data persistence.
2.4 Main Methods
EXPOSE_DATA_OBJECT
Calls the standard model implementation first.
For custom objects that are managed explicitly by this class, dynamic member exposure is bypassed. Other data objects continue through the generic superclass-compatible dynamic member assignment.
IF_MDC_MODEL~CHECK
Performs a configurable VIES-check decision before delegating to the SAP standard model check.
Functional sequence:
- Determine the current master-data-change process type.
- Check configuration in
ZMDG_C_UTILITY. - If the process type is configured to skip VIES validation, call
BUPA_SKIP_VIES_CHECK. - Execute the standard
CL_MDC_MODEL_BPvalidation.
The standard model check remains the primary validation routine.
READ_ALL_DATA
Executes the standard read and explicitly loads process data for:
- Supplier tax classification
- Address remarks
- BP address mapping
- Duplicate-related custom data
MAP_EXTENSIONS_2API
Extends the CVI API payload generated by the superclass.
It handles three custom areas:
Supplier Tax Classification
- Filters process records for the current process key.
- Matches supplier company-code data.
- Maps validity dates and payment type.
- Sets API insert/modify tasks.
- Sets change indicators.
Communication Remarks
Maps address communication remarks using:
- Address number from custom remark data.
- Address GUID relationship from
BUT020. - CVI address communication nodes.
Supported communication types include:
- Telephone
- Fax
The method inserts or updates the first remark record and sets the corresponding DATAX indicators.
Duplicate-Related BP Extension
Maps custom duplicate data into the BP API extension structure.
Mapped values include:
- Master identifier
- Duplicate flag
- Additional duplicate-related indicators
- Business Partner number
The API task is derived from the BP object task.
SAVE_BUSINESS_PARTNER_ACTIVE
Executes the standard BP active save and then synchronizes custom active data.
Its main responsibilities are:
- Optionally suppress BP replication for configured process types.
- Collect successful CVI target records.
- Resolve BP/vendor keys.
- Read the current tax-classification database state.
- Apply insert, update, delete, and modify semantics.
- Call
Z_MDG_UPDATE_TAX_TYPE. - Invoke
SAVE_ZNPSCDUP_ACTIVE.
SAVE_ZNPSCDUP_ACTIVE
Synchronizes custom duplicate data to ZMDG_BP_ZNPSCDUP.
Functional sequence:
- Collect successfully processed CVI BP records.
- Read current duplicate data from the database.
- Resolve the active Business Partner number.
- Read process records for the current source ID.
- Build the desired active-state records.
- Merge new/changed records into the current state.
- Call
ZMDG_UPDATE_ZNPSCDUPwith current and database states.
2.5 External Dependencies
The implementation directly depends on the following custom or SAP objects:
Custom Tables / Views / Structures
ZMDG_T_IDPLBPTAXZMDG_T_ADRTZMDG_BP_ZNPSCDUPZMDG_BP_DUP_PRCZMDG_C_UTILITYZZMDG_T_IDPL_PRC- Custom MDC table types and CVI extension structures
SAP Objects
BUT000BUT020C_MASTERDATACHANGEPROCESSCL_MDC_MODEL_BP- CVI external BP structures
BUPA_NUMBERS_GETBUPA_SKIP_VIES_CHECK
Custom Function Modules / Classes
- Z_MDG_UPDATE_TAX_TYPE
- ZMDG_UPDATE_ZNPSCDUP
- ZCL_MDG_REPL_CONTROL_FRMWORK
2.6 High-Level Processing Flow
1READ_ALL_DATA
2 |
3 v
4Custom process-data references
5 |
6 v
7MAP_EXTENSIONS_2API
8 |
9 +--> Tax classification
10 +--> Communication remarks
11 +--> Duplicate extension
12 |
13 v
14Standard / configurable validation
15 |
16 v
17SAVE_BUSINESS_PARTNER_ACTIVE
18 |
19 +--> Standard BP activation
20 +--> Custom tax synchronization
21 +--> Duplicate-data synchronization2.7 Complete Cleaned Code – ZCL_MDC_MODEL_BP
1class ZCL_MDC_MODEL_BP definition
2
3 public
4
5 inheriting from CL_MDC_MODEL_BP
6
7 create public .
8
9
10public section.
11
12
13 methods IF_MDC_MODEL~CHECK
14
15 redefinition .
16
17protected section.
18
19
20 data GR_ZMDG_T_IDPLBPTAX_PRC type ref to ZMDC_TT_ZZMDG_T_IDPL_PRC .
21
22 data GR_ZMDG_T_ADRT_PRC type ref to ZMDC_TT_ZZMDG_T_ADRT_PRC .
23
24 data GR_BUT020_PRC type ref to MDC_TT_BUT020_PRC .
25
26 data GR_ZMDG_BP_ZNPSCDUP_PRC type ref to ZMDC_TT_ZMDG_BP_ZNPSCDUP_PRC .
27
28
29 methods SAVE_ZNPSCDUP_ACTIVE .
30
31
32 methods EXPOSE_DATA_OBJECT
33
34 redefinition .
35
36 methods MAP_EXTENSIONS_2API
37
38 redefinition .
39
40 methods READ_ALL_DATA
41
42 redefinition .
43
44 methods SAVE_BUSINESS_PARTNER_ACTIVE
45
46 redefinition .
47
48private section.
49
50ENDCLASS.
51
52
53CLASS ZCL_MDC_MODEL_BP IMPLEMENTATION.
54
55
56 METHOD expose_data_object.
57
58
59* Content / Description / Remarks:
60
61* Expose Data Object
62
63
64* Title: CHECK
65
66
67 " 1. Determine whether VIES should be skipped based on config table
68
69 DATA(lv_skip_vies) = abap_false. " Default: Not to skip
70
71
72 " 2. Resolve the process template from the current process
73
74 SELECT SINGLE mdchgprocesstypeid
75
76 FROM c_masterdatachangeprocess
77
78 WHERE masterdatachangeprocess = @me->process_id
79
80 INTO @DATA(lv_process_type).
81
82
83 IF sy-subrc = 0.
84
85
86 SELECT SINGLE @abap_true
87
88 FROM zmdg_c_utility
89
90 WHERE data_model = 'BP'
91
92 AND req_type = 'VIES_CHECK'
93
94 AND req_id = 'SKIP_TEMPLATE'
95
96 AND low = @lv_process_type
97
98 INTO @DATA(lv_found).
99
100
101 IF sy-subrc = 0.
102
103 " Template found so skip the VIES Online Check
104
105 lv_skip_vies = abap_true.
106
107 ENDIF.
108
109 ENDIF.
110
111
112 " 3. Conditionally skip VIES
113
114 IF lv_skip_vies = abap_true.
115
116 CALL FUNCTION 'BUPA_SKIP_VIES_CHECK'
117
118 EXPORTING
119
120 iv_skip_vies_check = abap_true.
121
122 ENDIF.
123
124
125 " 4. Delegate to parent check (triggers VIES if not skipped)
126
127 TRY.
128
129 super->if_mdc_model~check( ).
130
131 CATCH cx_mdc_model. "#EC EMPTY_CATCH
132
133 ENDTRY.
134
135
136 ENDMETHOD.
137
138
139 METHOD map_extensions_2api.
140
141
142* Content / Description / Remarks:
143
144* Map BP Extensions to API
145
146
147* Title: READ_ALL_DATA
148
149
150 CALL METHOD super->read_all_data
151
152 EXPORTING
153
154 it_source_keys = it_source_keys
155
156 iv_package_number = iv_package_number
157
158 iv_from_current_step = abap_false.
159
160
161 me->gr_zmdg_t_idplbptax_prc = CAST #( me->object( 'ZMDG_T_IDPLBPTAX' )->read( it_source_keys = it_source_keys iv_package_number = iv_package_number ) ).
162
163 me->gr_zmdg_t_adrt_prc = CAST #( me->object( 'ZMDG_T_ADRT' )->read( it_source_keys = it_source_keys iv_package_number = iv_package_number ) ).
164
165 me->gr_but020_prc = CAST #( me->object( 'BUT020' )->read( it_source_keys = it_source_keys iv_package_number = iv_package_number ) ).
166
167 me->gr_zmdg_bp_znpscdup_prc = CAST #( me->object( 'ZMDG_BP_ZNPSCDUP' )->read( it_source_keys = it_source_keys iv_package_number = iv_package_number ) ).
168
169 ENDMETHOD.
170
171
172 METHOD save_business_partner_active.
173
174
175* Content / Description / Remarks:
176
177* Save Business Partner to Active Area
178
179
180* activation
181
182
183* Title: SAVE_ZNPSCDUP_ACTIVE
184
185
186 DATA:
187
188 lt_cvi_ei_extern TYPE cvis_ei_extern_t,
189
190 lv_partner TYPE bu_partner,
191
192 lt_current_znpscdup TYPE TABLE OF zmdg_bp_znpscdup,
193
194 lt_db_znpscdup_all TYPE TABLE OF zmdg_bp_znpscdup,
195
196 lt_db_znpscdup TYPE TABLE OF zmdg_bp_znpscdup,
197
198 ls_znpscdup_data TYPE zmdg_bp_znpscdup,
199
200 lt_znpscdup_ins TYPE TABLE OF zmdg_bp_znpscdup,
201
202 lt_znpscdup_upd TYPE TABLE OF zmdg_bp_znpscdup,
203
204 lt_znpscdup_del TYPE TABLE OF zmdg_bp_znpscdup,
205
206 lt_znpscdup_mod TYPE TABLE OF zmdg_bp_znpscdup.
207
208
209 FIELD-SYMBOLS:
210
211 \<fss_cvi_extern> LIKE LINE OF mt_cvi_ei_extern,
212
213 \<fss_cvi_ext> TYPE cvis_ei_extern,
214
215 \<fss_bp_keys> LIKE LINE OF mt_bp_keys,
216
217 \<fss_znpscdup> TYPE zmdg_bp_dup_prc,
218
219 \<fss_znpscdup_data> TYPE zmdg_bp_znpscdup,
220
221 \<fss_znpscdup_db> TYPE zmdg_bp_znpscdup.
222
223
224 " Get CVI external data
225
226 LOOP AT me->mt_cvi_ei_extern ASSIGNING \<fss_cvi_extern> WHERE target = '1'.
227
228 APPEND \<fss_cvi_extern>-data TO lt_cvi_ei_extern.
229
230 ENDLOOP.
231
232 IF lt_cvi_ei_extern IS INITIAL.
233
234 RETURN.
235
236 ENDIF.
237
238
239 " Get existing ZNPSCDUP data from database
240
241 IF me->mt_bp_keys IS NOT INITIAL.
242
243 SELECT * FROM zmdg_bp_znpscdup
244
245 INTO TABLE lt_db_znpscdup_all
246
247 FOR ALL ENTRIES IN me->mt_bp_keys
248
249 WHERE partner = me->mt_bp_keys-partner.
250
251 ENDIF.
252
253
254 " Process each BP
255
256 LOOP AT lt_cvi_ei_extern ASSIGNING \<fss_cvi_ext>.
257
258 CLEAR:lt_znpscdup_mod, lv_partner.
259
260 READ TABLE me->mt_bp_keys ASSIGNING \<fss_bp_keys>
261
262 WITH KEY partner_guid = CONV bu_partner_guid( \<fss_cvi_ext>-partner-header-object_instance-bpartnerguid ).
263
264 CHECK sy-subrc = 0.
265
266 IF \<fss_bp_keys>-partner IS INITIAL.
267
268 CALL FUNCTION 'BUPA_NUMBERS_GET'
269
270 EXPORTING
271
272 iv_partner_guid = CONV bu_partner_guid( \<fss_cvi_ext>-partner-header-object_instance-bpartnerguid )
273
274 IMPORTING
275
276 ev_partner = lv_partner.
277
278 ELSE.
279
280 lv_partner = \<fss_bp_keys>-partner.
281
282 ENDIF.
283
284
285 " Get DB-state before update
286
287 MOVE-CORRESPONDING lt_db_znpscdup_all TO lt_db_znpscdup.
288
289 DELETE lt_db_znpscdup WHERE partner <> lv_partner.
290
291 " Get current process data for this BP
292
293 DATA(lt_znpscdup_prc) = VALUE zmdc_tt_zmdg_bp_znpscdup_prc( FOR ls_znps IN me->gr_zmdg_bp_znpscdup_prc->*
294
295 WHERE ( source_id = \<fss_bp_keys>-source_id ) ( ls_znps ) ).
296
297
298 " Build current data from process records
299
300 LOOP AT lt_znpscdup_prc ASSIGNING \<fss_znpscdup>.
301
302 APPEND VALUE #( client = sy-mandt
303
304 partner = lv_partner
305
306 zmastid = \<fss_znpscdup>-zmastid
307
308 zisdupflg = \<fss_znpscdup>-zisdupflg
309
310 zrisechon = \<fss_znpscdup>-zrisechon
311
312 zriseext = \<fss_znpscdup>-zriseext ) TO lt_znpscdup_mod.
313
314 ENDLOOP.
315
316
317 " Merge current and DB data
318
319 APPEND LINES OF lt_db_znpscdup TO lt_current_znpscdup.
320
321
322 " Apply modifications
323
324 LOOP AT lt_znpscdup_mod ASSIGNING \<fss_znpscdup_data>. "#EC CI_NESTED
325
326 READ TABLE lt_current_znpscdup WITH KEY partner = \<fss_znpscdup_data>-partner
327
328 zmastid = \<fss_znpscdup_data>-zmastid
329
330 ASSIGNING \<fss_znpscdup_db>.
331
332 IF sy-subrc = 0.
333
334 \<fss_znpscdup_db> = \<fss_znpscdup_data>.
335
336 ELSE.
337
338 INSERT \<fss_znpscdup_data> INTO TABLE lt_current_znpscdup.
339
340 ENDIF.
341
342 ENDLOOP.
343
344 ENDLOOP.
345
346
347 " Call function module to update database
348
349 IF lt_current_znpscdup IS NOT INITIAL OR lt_db_znpscdup IS NOT INITIAL.
350
351 CALL FUNCTION 'ZMDG_UPDATE_ZNPSCDUP'
352
353 EXPORTING
354
355 it_current_znpscdup = lt_current_znpscdup
356
357 it_database_znpscdup = lt_db_znpscdup_all
358
359 EXCEPTIONS
360
361 OTHERS = 0.
362
363 ENDIF.
364
365 ENDMETHOD.
366
367ENDCLASS.Referenced tables
| Object | Purpose |
|---|---|
LT_DB_ZNPSCDUP_ALL | Open table LT_DB_ZNPSCDUP_ALL. |
LT_CURRENT_ZNPSCDUP | Open table LT_CURRENT_ZNPSCDUP. |
The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- What is the example code for extending CL_MDC_MODEL_BP to handle custom BP data during consolidation and activation?
- How can custom source tables, process tables, key structures, and attribute structures be mapped in an MDC data class?
- How can custom Business Partner fields and entities be mapped into the CVI API structure during MDG consolidation?
- How can custom BP data be read from the consolidation process and saved back to active custom tables after activation?
- Example code for CL_MDC_DATA_BP enhancement for custom consolidation entities
- Example code for CL_MDC_MODEL_BP enhancement in SAP MDG consolidation
Possible questions
- What is the example code for extending CL_MDC_MODEL_BP to handle custom BP data during consolidation and activation?
- How can custom source tables, process tables, key structures, and attribute structures be mapped in an MDC data class?
- How can custom Business Partner fields and entities be mapped into the CVI API structure during MDG consolidation?
- What configuration is required for Example Code: Consolidation Custom Table BP Customer Supplier?
- How can this SAP MDG scenario be tested?