In this blog, I will explain how we can add custom fields in migration co*ckpit using migration object modeler.
The SAP S/4HANA Migration Object Modeler is an application that can be used to adjust the migration objects that are used in the SAP S/4HANA Migration co*ckpit. In the SAP S/4HANA Migration co*ckpit, you use templates that specify the relevant data for each migration object. SAP provides templates (Microsoft Excel XML files) that you can use for each migration object.
If a template does not meet your business requirements (for example if the relevant Microsoft Excel XML file does not contain all the fields that you need for the target structure), you can use the SAP S/4HANA Migration Object Modeler to adjust the relevant migration object.
Opening Migration Object
In the initial screen of the application, you can open a migration object. You can do this by choosing the Input Help button under the Migration Object field, and specifying the name of the migration object, and the name of the project.
For each migration object, the following areas are available:
To open an area for your migration object, double-click the relevant area and screen will open on the left-hand side of the screen. The system displays the relevant information for the area on the right-hand side of the screen.
Requirement
The business requirement is to upload custom fields (assuming these fields are available in the material master data) using S/4HANA Migration co*ckpit. To achieve this, we have to enhance the material master object using LTMOM transaction.
Solution
Following the below snapshot, I have double-clicked on TARGET Structure to find the BAPI used for material master migration object (refer the highlighted option in the below snapshot).
When you open this BAPI (using SE37 transaction), you will find the structure list under the tab TABLES. Scroll the list down and find the structure name (BAPIE1PAREX) for EXTENSIONIN/EXTENSIONOUT BAPI parameter. Similarly, you will find another structure name (BAPIE1PAREXX) to pass X value to the BAPI parameter EXTENSIONIN/EXTENSIONOUT to update the values in the database.
The Customer-defined fields may be passed using EXTENSIONIN and EXTENSIONOUT parameters of the BAPI function module and it helps to load & store the value of the custom fields in the material master relevant tables.
LTMOM – Source structure
To achieve this, I have created two source structure (as shown below) named ‘custom fields’ and ‘custom fields – X’ to pass the values to both structures using EXTENSIONIN/EXTENSIONOUT parameter in BAPI.
Here, you can see the field name (i.e. STRUCTURE and CUSTOM_field) added to the both source structures created. Now, it’s important to understand how these field names will work in order to upload material master custom fields.
The below is the snapshot of the template having two separate sheets for the above created source structures and each sheet in template will have set of fields that are created in each source structure.
How to fill the template for custom fields
- Column A – Material Number: Fill the material number for which you need to upload custom fields.
- Column B – Structure: We need to pass the SAP standard delivered structure to upload the customer-defined material master fields. Below are some examples if you wish to upload custom field in MARA, MARC & MVKE table.
- BAPI_TE_E1MARA – To upload fields in MARA table (this you can see in snapshot)
- BAPI_TE_E1MARC – To upload fields in MARC table
- BAPI_TE_E1MVKE – To upload fields in MVKE table
- Column C – Custom fields: This is the field where you will be filling the actual custom field values. The format to be used to fill the value in this column is as follows:
- concatenate of (material number + custom field 1 + custom field 2 + customer field 3 + ……).
- Note: We need to add additional zero’s as prefix to material number. The total length of material number should be 18 + custom fields.
- The example shown in above snapshot, we have entered the material number along with 2 custom fields value. There should not be any space while filling the value in column C.
Similarly, we have to fill the other sheet to pass the X values to the filled structure. Refer below snapshot.
NOTE:
- Column B – The structure value to be passed here is the X structure of the value entered in the earlier sheet. Below are some examples:
- BAPI_TE_E1MARAX – To upload fields in MARA table (this you can see in snapshot)
- BAPI_TE_E1MARCX – To upload fields in MARC table
- BAPI_TE_E1MVKEX – To upload fields in MVKE table
- As you can follow the above snapshot, we have to pass the X value for each custom field along with material number.
To ensure system accepts the custom values while uploading data via Migration co*ckpit, we have to enhance the relevant SAP standard delivered structure that we want to use. In the example used in this blog, we have enhanced the BAPI_TE_MARA & BAPI_TE_MARAX structures to load the custom fields in the basic data of material master. With the help of technical consultant, you can append these structures to include the custom fields available in material master table (in this example, we have added custom fields available in MARA table).
LTMOM - Structure mapping
Once the source structure is created successfully, we have to map these structures with the target structures. Find the below snapshot to illustrate how it will look like:
Since, the material number is the key field information in the source structure so we have to map the ‘Basic Data’ source structure first while performing this activity.
LTMOM - Field Mapping
Find the below snapshot of the field mapping done for EXTENSIONIN/EXTENSIONOUT parameter of BAPI.
Source structure – S_CUSTOM
Source structure – S_CUSTOMX
After doing all these changes please generate the migration object and make sure the traffic light should be GREEN.
Please feel free to add missing information, if any.
Thanks,
Ravinder Chawla