Create a Mapping Project

Parent Previous Next

Overview


We must simultaneously reduce complexity and increase the speed of achieving repeatable results while recognizing and managing data models that are fundamentally different across the data migration landscape.



The shape of data -- the technical definition of data -- changes with each step.



One source of complexity is identifying and accommodating one-to-many relationships that are the nature of some business objects. For example, a customer may have multiple telephone numbers, multiple shipping addresses, multiple associated contact persons, and more.


Beyond the complexity represented by the business object itself, it's important to recognize that components of the data migration landscape represent one-to-many relationships in fundamentally different ways. For example, one-to-many relationships may be expressed differently by relational database tables (i.e. Staging Tables) versus the same data in a structured document (i.e. an IDoc). What's more, there's a third consideration, which is the data model assumed by conversion programs (i.e. Legacy System Migration Workbench, LSMW). What are the key differences demanding our attention?






Deftly managing the above complexity, simplifying the process for every functional resource, and increasing the speed of achieving predictable results is the comprehensive challenge.



Mapping Project


Here are the high-level steps for creating a mapping project for one data migration object object:


1. Open an existing project or create a new project.


There are several ways to create a new mapping project or to open an existing mapping project file.


Once the mapping project file is open, take note of (and maintain, if needed) the Project ID, which is found in the Left Work Area on the Map tab. This Project ID is used for file naming when producing deliverables.



2. Select IDoc segments, and indicate which segments are to be merged.


In this step you're indicating which segments of the IDoc are relevant, and you do this by marking the segment as Active. You're also identifying one-to-many relationships. Completing both of these activities will define the number of Staging Tables that will be created to supply data (as Load-Ready data files) to the LSMW Project.


The IDoc segments are displayed in the Main Work Area, including two indicators for each segment: Active and Merged.


Merging of segments is a key concept. Each segment represents the possibility of a one-to-many relationship. One-to-many relationships can be reduced by using the Merge functionality. When two or more segments are merged, that means that there will always be – without exception – a one-to-one relationship between these segments.  


Each segment in an IDoc usually represents the possibility of a one-to-many relationship, and this possibility remains if you choose not merge segments. When a segment is not merged, then a separate staging table is created for that segment. If the data transformation team puts one record in the staging table, then one segment is created in the IDoc. If the data transformation team puts two (or more) records in the staging table, then two (or more) of the segment is created in the IDoc.  


One "gotcha" that you need to be aware of -- and that you must to attend to -- is that primary key fields must be available in both the parent and child (not-merged) segments. In some IDocs, the primary key fields(s) exist in both the parent and child segments. In some IDocs, the primary key field(s) exist only in the parent segment. If the primary key field(s) do not exist in both the parent and child segments, then you must copy primary key fields from the parent segment to the child segment so that they will be available when defining primary key fields for each Staging Table. In some extreme cases, you may have to add primary key fields in both the parent segment and child segments.


An IDoc is a structured document, like an XML document, and parent-child relationships (one-to-many relationships) between IDoc segments are defined by the IDoc structure and definition. Staging Stables are defined by the IDoc segments and fields that will be used (i.e. Segments and Fields are flagged as Active). Our goal is to reduce the number of database Staging Tables when possible, which is accomplished by reducing the number of one-to-many relationships when possible (i.e. merging segments).


For example, consider Customer Master and the possible one-to-many relationship between Customer and Company Codes. The relevant segments in this example are:



If our requirement is for only one company code, then there isn't a need for a separate Staging Table to represent a one-to-many relationship between Customer and Company Codes. Any Active fields from E1KNB1M (Master Customer Master Company Code KNB1) could be merged with Active fields from E1KNA1M (Master customer master basic data KNA1) into a single Staging Table. And that is the purpose of the Merge indicator.





3. Select IDoc fields.


Field Properties: Active and LSMW Active


Mark the relevant fields as either Active or LSMW Active.  The difference is straightforward:






Using LSMW Active


Lets take a closer look at using LSMW Active and the options for LSMW Rule.



Field Property: LSMW Not Initial


This field property is only relevant when an LSMW Rule of Transfer is used.


When the option for Only If Source Field Not Initial is used then a value will be transferred from Load-Ready file to the IDoc field only if a non-blank value is supplied in the Load-Ready file.


For most IDoc messages, this has implications, both when a record is created and also when a record is changed.


Create Record:


Change Record:


Consider that there is an application option that can be set to True:  Options > Publish: LSMW Project > LSMW Rule: Not Initial


For the IDoc field, there is a property named LSMW Not Initial, and there are two options for this IDoc field property:


If the application option LSMW Rule: Not Initial is set to True, or if the IDoc field property LSMW Not Initial is maintained as Only If Source Field Not Initial, then the field will be treated as Only If Source Field Not Initial when creating the LSMW Project.



4. Maintain Primary Key(s).


An IDoc is a structured document, like an XML document, and parent-child relationships (one-to-many relationships) between IDoc segments are defined by the IDoc structure and definition. In contrast, database Staging Tables require explicit definition of primary key fields. Every staging table must have Primary Key field(s) defined. The fields flagged as Primary Key indicate the one or more fields that uniquely identify a row in the database.


Because IDoc structure defines relationships, you'll find that some IDoc segments don't even include primary key fields. For example, E1KNB1M (Master Customer Master Company Code KNB1) does not include the field KUNNR (Customer Number). If our requirement is to support multiple company codes then E1KNB1M (Master Customer Master Company Code KNB1) would not be flagged as merged, thus permitting data for multiple company codes in a separate database Staging Table.


If E1KNB1M (Master Customer Master Company Code KNB1) is not merged and will create a separate Staging Table, then that staging table must include both KUNNR (Customer Number) and BUKRS (Company Code). To accomplish this, copy KUNNR (Customer Number) from segment E1KNA1M (Master customer master basic data KNA1) to segment E1KNB1M (Master Customer Master Company Code KNB1), inserting it just above BUKRS (Company Code).


Clicking the Primary Key button on the Toolbar opens a form that displays a tab for each Staging Table that will be created. You should visit each tab and designate the Primary Key field(s) for each Staging Table.


In the case of an IDoc, the structure of parent – child relationships can define a one-to-many relationship without including primary keys. In the case of relational database tables, primary keys are an absolute requirement.  Some IDocs include primary key fields in both the parent and child segments, and this is the simple case. But some IDocs do not include primary key fields in child segments (in a structured document, the key fields are implied by the structure) and in this case further attention is required.  


If the key field(s) do not exist in both the parent and the child segments, then you must copy key fields from the parent to the child segment so they will be available when defining Primary Key fields for each Staging Table.



5. Create a Local System Database with Key Values.


This step is optional, but will help with accurately maintaining sample data for a specific system and target, if one is available.




6. Create validation tests.


It's optional to Create Validation Tests at this point, but it will help with the validation of Load-Ready files when they become available.


Validation tests are also helpful for Working With Sample Data, which is the very next step.  With the Validation Engine running in real-time while maintaining Sample Data, especially performing validation based on Value Tables, you can be confident that you're creating sample data that aligns with the master data and configuration of the target SAP system and client.



7. Maintain sample data.


Sample data should be provided to the conversion program developer so that the conversion program can be unit tested.


Clicking the Maintain button on the Toolbar opens a form that displays a tab for each Staging Table that will be created. You should visit each tab and enter rows of sample data.



8. Publish deliverables.


Clicking the individual buttons on the Toolbar group named Execute enables discrete creation of deliverables:



Clicking the Export button on the Toolbar group named Sample Data enables creation of sample data files:



Clicking the Publish button creates all of the above deliverables with the click of one button. The deliverables are created in a new folder below the location of the project file (.mdawb project file), and the folder name includes the creation time and date. For example, for a project named FI_GL, a folder named FI_GL_20150109-165204 would be created with the following files:


File

File Description

FI_GL_20150109-165204.MDAWB

A backup copy of the MDA Workbench project file that was used to create the Published deliverables.

FI_GL_20150109-165204.XLSX

Field-Level Mapping Workbook

FI_GL_LSMW_PROJECT_20150109-165204.TXT

LSMW Project File

FI_GL_SQL_20150109-165204.TXT

Database script to create Staging Tables in the Staging Database.  These tables will be populated with legacy data and used to product Load-Ready files.

FI_GL01_DATA_20150109-165204.TXT

Sample data for Load-Ready File 01.

FI_GL01_LSMW_20150109-165204.TXT

LSMW Field Definition file for Load-Ready File 01 (i.e for LSMW Source Structure 01)

FI_GL02_DATA_20150109-165204.TXT

Sample data for Load-Ready File 02.

FI_GL02_LSMW_20150109-165204.TXT

LSMW Field Definition file for Load-Ready File 02 (i.e for LSMW Source Structure 02)