SAP MDG · REPLICATION INBOUND

How does the SAP MDG mass key mapping report work for download and upload processing?

The report ZCREATE_MASS_KEY_MAPPNG supports two flows: download mode to generate key-mapping output for selected IDs, and upload mode to read a file and process key-mapping rows in bulk. It dynamically switches the selection screen, resolves supported object IDs, calls MDG ID matching for mapping, and writes the run to the application log.

The report ZCREATE_MASS_KEY_MAPPNG supports two flows: download mode to generate key-mapping output for selected IDs, and upload mode to read a file and process key-mapping rows in bulk. It dynamically switches the selection screen, resolves supported object IDs, calls MDG ID matching for mapping, and writes the run to the application log.

ZCREATE_MASS_KEY_MAPPNG is the MDG mass key mapping report for two scenarios: generating key-mapping output in download mode and loading mapping data from a file in upload mode. It dynamically enables selection-screen fields based on the mode, resolves supported objects such as Material, Equipment Resource, and Business Partner, and uses the MDG ID matching framework before generating the template or processing the upload.

Process flow

  1. Initialize BAL application log with `BAL_LOG_CREATE`.
  2. Load object type and ID type texts from `mdgi_otc_t_bs` and `mdgi_idstc_t_bs`.
  3. Determine the local business system with `cl_mdg_id_matching_api_bs=>get_instance`.
  4. Default `lv_s_id` when it is initial.
  5. In download mode, normalize selected IDs using `CONVERSION_EXIT_ALPHA_RANGE_I`.
  6. Read source objects from `mara`, `equi`, or `but000` depending on `obj_type`.
  7. Call the BAdI `lr_input_val` with filter `gis_object_type = obj_type`.
  8. Generate the mapping template for the selected IDs and ID type or process the upload file in `p_path`.

Selection screen parameters: `obj_type`, `oitc`, `lt_id`, `lv_s_id`, `p_downld`, `p_upld`, `p_path`, `p_lines`

Run the report in download or upload mode and provide object IDs, system ID, file path, and row limit.

BAdI filter `gis_object_type` for `lr_input_val`

Route ID mapping logic to the correct implementation for the selected object type.

Referenced tables

ObjectPurpose
mdgi_idstc_t_bsID type text table read during initialization for selection-screen value help and descriptions.
mdgi_otc_t_bsObject type text table read during initialization for selection-screen value help and descriptions.
mdgi_idstc_bsUsed to derive `ids_type_code` from `object_type_code` in download mode when `oitc` is initial.
BUT000Business Partner source table used to resolve selected business partner IDs.
maraMaterial source table used to resolve selected material numbers.
equiEquipment source table used to resolve selected equipment numbers.

ILLUSTRATIVE ABAP SAMPLE

Source ABAP example

Exact relevant implementation excerpt from the knowledge document.

1*&---------------------------------------------------------------------* 2*& Report CREATE_MASS_KEY_MAPPING 3*& 4*&---------------------------------------------------------------------* 5*& 6*& 7*&---------------------------------------------------------------------* 8 9REPORT zcreate_mass_key_mappng. 10 11INCLUDE ZCREATE_KEY_MAPPING_TOP. 12*INCLUDE create_key_mapping_top. 13 14TYPES: 15 BEGIN OF ls_message_type, 16 msgty TYPE symsgty, 17 msgid TYPE symsgid, 18 msgno TYPE symsgno, 19 msgv1 TYPE symsgv, 20 msgv2 TYPE symsgv, 21 msgv3 TYPE symsgv, 22 msgv4 TYPE symsgv, 23 msg_index TYPE int4, 24 fieldname TYPE fieldname, 25 END OF ls_message_type . 26TYPES: 27 lt_message_type TYPE TABLE OF ls_message_type. 28 29DATA:lt_ids_codes TYPE TABLE OF mdgi_idstc_t_bs, 30 ls_id_code TYPE mdgi_idstc_t_bs, 31 ls_obj_id TYPE mdgi_otc_t_bs, 32 lv_id_type TYPE mdg_ids_type_code_bs. 33DATA lt_obj_types TYPE TABLE OF mdgi_otc_t_bs. 34DATA: lt_bus_systems TYPE lcr_t_bsysprod, 35 lt_bus_match TYPE lcr_t_bsysprod, 36 ls_bus_systems LIKE LINE OF lt_bus_systems. 37 38DATA: lr_input_val TYPE REF TO bs_gis_key_mapping. 39DATA: lt_objects TYPE TABLE OF mdg_object_id_bs. 40DATA: lv_tab TYPE char20, 41 lv_field TYPE char20, 42 lv_where TYPE string. 43DATA: lt_messages TYPE lt_message_type. 44 45DATA: l_param1 TYPE symsgv, 46 l_param2 TYPE symsgv, 47 l_param3 TYPE symsgv, 48 l_param4 TYPE symsgv, 49 l_msgid TYPE symsgid, 50 l_msgno TYPE symsgno. 51 "#EC NOTEXT 52 53DATA: ir_configuration TYPE REF TO cl_ukm_configuration, 54 lv_maching_api TYPE REF TO cl_mdg_id_matching_api_bs. 55DATA: lt_otc TYPE TABLE OF mdgi_otc_t_bs, 56 ls_otc TYPE mdgi_otc_t_bs, 57 ls_mctxt_data TYPE mdg_s_objtype_maincontext_bs, 58 es_cxt_table TYPE mdg_s_table_name, 59 et_cxt_tables TYPE TABLE OF mdg_s_table_name, 60 lv_found TYPE boole_d. 61 62DATA: lv_mctxt_id TYPE mdg_km_main_context_id. 63DATA: lt_object_id TYPE RANGE OF mdg_object_id_bs. 64DATA: lr_if_mdg_id_matching_api_bs TYPE REF TO if_mdg_id_matching_api_bs. 65DATA: lv_lcl_system TYPE sld_bskey. 66DATA: lv_dummy_num TYPE bu_partner, 67 lv_matnr TYPE matnr, 68 lv_equnr TYPE char18, 69 lt_range TYPE RANGE OF char255. 70TYPES: 71 BEGIN OF mapped_id_obj, 72 oitc TYPE mdg_ids_type_code_bs, 73 bs_key_name TYPE sld_bskey, 74 id_value TYPE mdg_object_id_bs, 75 object_type_code TYPE mdg_object_type_code_bs, 76 77 END OF mapped_id_obj . 78 79DATA: lv_fl_test TYPE dxfields-abendflag. 80DATA: lt_s_mapped_id_obj TYPE mapped_id_obj. 81DATA: lv_str1 TYPE string, 82 lv_str2 TYPE string, 83 lv_str3 TYPE string. 84 85PARAMETERS : obj_type TYPE mdg_object_type_code_desc_bs AS LISTBOX VISIBLE LENGTH 50 86 USER-COMMAND fcode MODIF ID md1, 87 oitc TYPE mdg_ids_type_code_desc_bs AS LISTBOX VISIBLE LENGTH 50 88 USER-COMMAND fcode MODIF ID md2. 89 90SELECT-OPTIONS: lt_id FOR lt_s_mapped_id_obj-id_value. 91 92PARAMETERS : lv_s_id TYPE sld_bskey. 93 94SELECTION-SCREEN SKIP. 95 96PARAMETERS: 97 p_downld RADIOBUTTON GROUP mode DEFAULT 'X' USER-COMMAND pai, 98 p_upld RADIOBUTTON GROUP mode. 99 100SELECTION-SCREEN SKIP. 101 102SELECTION-SCREEN:BEGIN OF BLOCK p_downld WITH FRAME TITLE TEXT-001. 103SELECTION-SCREEN: END OF BLOCK p_downld. 104 105SELECTION-SCREEN SKIP. 106 107SELECTION-SCREEN:BEGIN OF BLOCK p_upld WITH FRAME TITLE TEXT-002. 108 PARAMETERS: 109 p_path LIKE rlgrap-filename MODIF ID md3. 110 111 SELECTION-SCREEN PUSHBUTTON /1(10) execute USER-COMMAND exec MODIF ID md3. 112* Note 2514101 - begin 113 PARAMETERS: 114 p_lines TYPE i DEFAULT con_max_xls_row MODIF ID md3. 115* Note 2514101 - end 116SELECTION-SCREEN: END OF BLOCK p_upld. 117 118AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path. 119 CLEAR p_path.

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

Related questions and keywords

Alternative questions

  • How do I use the MDG mass key mapping report in download mode?
  • How do I use the MDG mass key mapping report in upload mode?
  • What are the main steps in ZCREATE_MASS_KEY_MAPPNG?

Possible questions

  • How do I use the MDG mass key mapping report in download mode?
  • How do I use the MDG mass key mapping report in upload mode?
  • What objects are supported by the report?
  • Which parameters control file upload and row limit?
  • How does the report call MDG ID matching?
  • What application logging does the report use?

Keywords

SAP MDGkey mappingmass key mappingdownload modeupload modeMDG ID matchingBusiness PartnerMaterialEquipment ResourceBAL application logABAP report