SAP MDG · REPLICATION INBOUND
How do I create or upload mass key mappings in SAP MDG/BP using a custom ABAP report?
Use the custom ABAP report ZCREATE_MASS_KEY_MAPPNG to either generate a key-mapping template in download mode or upload and validate key-mapping rows in bulk in upload mode. It supports Material, Equipment Resource, and Business Partner object types and writes application log messages for the run.
Use the custom ABAP report ZCREATE_MASS_KEY_MAPPNG to either generate a key-mapping template in download mode or upload and validate key-mapping rows in bulk in upload mode. It supports Material, Equipment Resource, and Business Partner object types and writes application log messages for the run.
`ZCREATE_MASS_KEY_MAPPNG` is an ABAP report for mass key mapping creation in the MDG/BP area. It has two operating modes: Download mode for generating key-mapping output for selected business objects, and Upload mode for reading an external file and processing key-mapping input in bulk. The report supports Material, Equipment Resource, and Business Partner object types, and it writes application log messages for the mapping run.
Process flow
- Choose Download or Upload mode.
- Select the object type and ID object type code.
- In Download mode, enter one or more object IDs and a source system ID.
- In Upload mode, provide the file path and maximum row count.
- Execute the report.
- Review the application log for validation and save messages.
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example: ZCL_PROFIT_CENTER_KEYMAP_FULL.abap
Exact relevant implementation excerpt from the knowledge document set.
1class ZCL_PROFIT_CENTER_KEYMAP definition
2 public
3 final
4 create public .
5
6public section.
7*"* public components of class CL_USMD_SE_PC_RPLCTN_BADI
8*"* do not include other source files here!!!
9
10 interfaces IF_BADI_INTERFACE .
11 interfaces IF_EX_USMD_PC_RPLCTN .
12protected section.
13*"* protected components of class CL_USMD_SE_PC_RPLCTN_BADI
14*"* do not include other source files here!!!
15private section.
16*"* private components of class CL_USMD_SE_PC_RPLCTN_BADI
17*"* do not include other source files here!!!
18ENDCLASS.
19
20
21
22CLASS ZCL_PROFIT_CENTER_KEYMAP IMPLEMENTATION.
23
24
25method IF_EX_USMD_PC_RPLCTN~INBOUND_PROCESSING.
26*
27* Method can be used for redefinition (or enhancement) of the incoming processing status data that belongs to a corresponding
28* replication request message for profit centre (confirmation message is sent back to MDGF).
29*
30* In case of an active BAdI implementation, this method would be called during inbound processing from standard service
31* implementation class CL_USMD_CO_PC_IN, method MAPPING_IN.
32*--------------------------------------------------------------------------------------------------------------------
33
34
35 data:
36 lt_log_item type mdgf_log_item_tab,
37 ls_log_item type mdgf_log_item,
38 lt_message type usmd_t_message,
39 ls_message type usmd_s_message,
40 ls_message_header type mdgf_business_document_messag3.
41
42
43
44* Get processing result code of original replication request message (will be used for status update in MDGF)
45 cs_data-usmd_resultcode = is_proxy_data-log-business_document_processing_r(1).
46
47* Get target system of original replication request message (will be used for status update)
48 cs_data-usmd_dis_system = is_proxy_data-message_header-sender_business_system_id.
49
50* Message header includes message GUIDs (will be also used for status update)
51 ls_message_header = is_proxy_data-message_header.
52
53
54* Inbound conversion of message GUIDs:
55 try.
56 call method cl_gdt_conversion=>guid_inbound
57 exporting
58 im_value = ls_message_header-reference_uuid-content
59 importing
60 ex_guid_c = cs_data-usmd_msg_rqguid.
61
62 catch cx_gdt_conversion. "#EC NO_HANDLER
63
64 endtry.
65
66 try.
67 call method cl_gdt_conversion=>guid_inbound
68 exporting
69 im_value = ls_message_header-uuid-content
70 importing
71 ex_guid_c = cs_data-usmd_msg_coguid.
72
73 catch cx_gdt_conversion. "#EC NO_HANDLER
74
75 endtry.
76
77
78* analyze messages (to be stored in application log)
79 lt_log_item = is_proxy_data-log-item.
80
81* conversion of lt_log_item into message table of cs_data (type: BAPIRET2_TAB)
82 lt_message = ct_message.
83 loop at lt_log_item into ls_log_item.
84 if 1 = 2.
85* for finding message usage
86 message i010(usmd_xi_proxy) with space space space space.
87 endif.
88
89 clear ls_message.
90 case ls_log_item-severity_code.
91 when '3'. ls_message-msgty = 'E'.
92 when '2'. ls_message-msgty = 'W'.
93 when '1'. ls_message-msgty = 'I'.
94 endcase.
95 ls_message-msgid = 'USMD_XI_PROXY'.
96 ls_message-msgno = '010'.
97 ls_message-msgv1 = ls_log_item-note.
98 insert ls_message into table lt_message.
99 endloop.
100
101 ct_message = lt_message.
102
103
104endmethod.
105
106
107METHOD if_ex_usmd_pc_rplctn~outbound_processing.
108*
109* Method for redefinition/enhancement or creation of message data for outbound replication bulk request of
110* Profit center (in CS_PROXY_DATA which contains the bulk message).
111*
112* In case that method is called with initial CS_PROXY_DATA, it can be also used for message creation from scratch (by analysis
113* of the importing parameters). This would be necessary, if no SMT-Mapping is available that transforms the selected
114* MDGF data (in IT_DATA) into the message type data (CS_PROXY_DATA).
115*
116* In case of an active BAdI implementation, this method would be called during outbound processing from standard service implementation
117* class CL_USMD_RQ_PC_OUT, method IF_DRF_OUTBOUND~SEND_MESSAGE.
118*--------------------------------------------------------------------------------------------------------------------
119*&---------------------------------------------------------------------*
120*& Class : ZCL_PROFIT_CENTER_KEYMAPThe remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How can I generate a key-mapping template for MDG business objects?
- How do I upload mass key mapping data from a file in SAP MDG?
- Which parameters does the ZCREATE_MASS_KEY_MAPPNG report use?
Possible questions
- How do I generate a key-mapping template for Material IDs?
- How do I process uploaded key-mapping rows in bulk?
- How does the report validate existing mappings before save?
- What application logging is used by the key-mapping report?
- Which included source units support the report?