Technical Articles
Add customers to customer hierarchy using LTMC – Migration Cockpit
This blog post is about how to add customers ( SD ) to a customer hierarchy in a mass mode.
A user can add it individually using the transaction VDH1N – Display/Maintain Customer Hierarchy, but for mass processing Migration Cockpit can be proposed as the best-fit solution.
S/4HANA migration cockpit assists with uploading and processing the data required for migration or updating existing business objects in SAP systems. It provides the possibility to arrange the process into simple steps to prepare, verify, simulate and process the data. A few migration objects are already available for use, but not all. With the migration cockpit modeler, it is the possibility to create its own migration object with its own or standard function to manage the migration similarly to the standard migration objects. The focus of this post will be only on creating a new migration object.
To fulfill our goal for adding customers to the customer hierarchy levels in mass mode, we need to carry out the following steps in SAP S4/HANA (up to rel. 1909):
- Create a project for migration with the transaction LTMC – Migration Cockpit
- Go to the transaction LTMOM – Migration Object Modeler to create a new object
- Create a source structure with the mandatory fields as below
-
- As the function, we will use FM BAPI_CUSTOMER_HIERARCHIE_INS
-
- Map the source structure to the inputs of the FM with the following settings
- HEADER<< KNVH_PROCESS
- Map the source structure to the inputs of the FM with the following settings
-
-
- R_NODE_LIST << KNVH_PROCESS
-
-
- In the field mapping assign the fields to the target structure:
Please, note that for the field Customer we need to prepare a rule for conversion to the internal format:
3. Generate the migration object.
Executing the steps above, it is ready for loading with the transaction LTMC.
With LTMC it is easier to execute mass change for customer hierarchy than using LSMW as it is more user-friendly and easier for comprehension.
Thank you. It is just a brief description and overview but very useful. For a better flexibility I added Hierarchy Type field (we use more hierarchy types) and pricing relevancy field.
There is not visible your conversion rule assignment screen for customer number. How it was possible to use CVT_CUSTOMER conversion rule definition when I am allowed to use only Z* prefix for my conversion rule?
Anyway, I used a different logic with ABAP source code where I am reading legacy customer number from BP master data. This is a project specific but just for some inspiration of potential readers.
IF NOT iv_customer IS INITIAL.
SELECT SINGLE partner FROM but000 INTO ev_customer WHERE bu_sort2 = iv_customer.
IF sy-subrc NE 0.
ev_customer = iv_customer.
ENDIF.
ENDIF.
Josef Piňos