SAP MDG · REPLICATION INBOUND
How do I implement and initialize an inbound key-mapping helper include in SAP MDG replication?
Use a top include to define the file-operation constants, VRM selection parameters, application-log structures, and typed internal tables that support an inbound key-mapping utility. The source shows the standard setup for upload/download mode handling, filename masking, and logging, with MDG replication context still using key mapping and service-based communication.
Use a top include to define the file-operation constants, VRM selection parameters, application-log structures, and typed internal tables that support an inbound key-mapping utility. The source shows the standard setup for upload/download mode handling, filename masking, and logging, with MDG replication context still using key mapping and service-based communication.
The source shows a standard ABAP top include for an inbound key-mapping utility: it defines upload/download constants, a filename mask, VRM selection parameters, BAL logging structures, and typed tables for object types, object ID types, Excel data, and sender lines. For the replication setup around this utility, the documented MDG settings are `Replication via Services`, `Key Mapping`, and `Active Area, but in case of error Staging Area`.
Process flow
- Define the include-level constants for upload/download modes and file masks.
- Declare `TABLES sscrfields.` for selection-screen event handling.
- Create VRM parameter IDs for object-type dropdowns.
- Set up BAL logging handles and message storage structures.
- Declare typed tables for object types, object ID types, Excel rows, and sender lines.
- Connect the include to the main program logic for upload/download and key-mapping processing.
Referenced tables
| Object | Purpose |
|---|---|
sscrfields | Selection-screen control structure used by the report/include. |
mdgi_idstc_t_bs | Object ID type lookup table used by the key-mapping utility. |
mdgi_otc_t_bs | Object type lookup table used by the key-mapping utility. |
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example
Exact relevant implementation excerpt from the knowledge document.
1*&---------------------------------------------------------------------*
2*& Include CREATE_KEY_MAPPING_TOP
3*&---------------------------------------------------------------------*
4TYPE-POOLS: vrm, slis, icon, ole2.
5CONSTANTS:
6con_max_xls_row TYPE i VALUE 50000, " Note 2514101
7gc_downld TYPE i VALUE 1,
8gc_upld TYPE i VALUE 2,
9gc_mask(20) TYPE c VALUE ',*.* ,*.*. '. "f4 filename mask
10
11TABLES sscrfields.
12DATA: gt_types TYPE vrm_values,
13 gv_param1 TYPE vrm_id VALUE 'oitc',
14 gv_param2 TYPE vrm_id VALUE 'obj_type'.
15
16DATA: gs_s_log TYPE bal_s_log,
17 gs_log_hd TYPE balloghndl,
18 gv_return TYPE sy-subrc,
19 gt_log_hd TYPE bal_t_logh,
20 gc_class_log TYPE char100 VALUE 'GHO_GIS',
21 gc_true TYPE char1 VALUE 'X',
22 gv_mode TYPE n.
23*Log structure
24DATA: BEGIN OF gt_log OCCURS 0,
25 row_index TYPE sy-tabix,
26 status TYPE string,
27 obj_type_txt TYPE string,
28 obj_id_type_txt TYPE string,
29 sys_id TYPE string,
30 id_value TYPE string,
31 ext_sys_id TYPE string,
32 ext_id_value TYPE string,
33 message TYPE char120,
34 msgid TYPE symsgid,
35 msgty TYPE symsgty,
36 msgno TYPE symsgno,
37 msgv1 TYPE symsgv,
38 msgv2 TYPE symsgv,
39 msgv3 TYPE symsgv,
40 msgv4 TYPE symsgv,
41 longtext TYPE icon_d,
42 END OF gt_log.
43
44DATA: gt_object_id_types TYPE TABLE OF mdgi_idstc_t_bs,
45 gt_object_types TYPE TABLE OF mdgi_otc_t_bs.
46
47TYPES: BEGIN OF fm_tabline,
48 row TYPE kcd_ex_row_n,
49 col TYPE kcd_ex_col_n,
50 value TYPE char50,
51 END OF fm_tabline.
52* value of excel-cell
53TYPES: ty_d_itabvalue TYPE fm_tabline-value,
54* internal table containing the excel data
55 ty_t_itab TYPE fm_tabline OCCURS 0,
56* line type of sender table
57 BEGIN OF ty_s_senderline,
58 line(4096) TYPE c,
59 END OF ty_s_senderline,
60* sender table
61 ty_t_sender TYPE ty_s_senderline OCCURS 0.
62
63CONSTANTS: gc_esc VALUE '"'.The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How do I build the top include for an inbound key-mapping program?
- What are the standard data declarations for a key-mapping upload/download utility in ABAP?
- How do I set up the file upload/download constants and log structures for key mapping?
Possible questions
- How do I implement and initialize an inbound key-mapping helper include in SAP MDG replication?
- How do I build the top include for an inbound key-mapping program?
- What are the standard data declarations for a key-mapping upload/download utility in ABAP?
- How do I set up the file upload/download constants and log structures for key mapping?
- How do I add VRM parameters and logging for a key-mapping tool?