Product Lifecycle Management Blogs by SAP
Dive into product lifecycle management news, learn about digitalizing PLM for the digital supply chain, and stay informed with product updates from SAP.
cancel
Showing results for 
Search instead for 
Did you mean: 
Uwe_Klinger
Advisor
Advisor
This blog explains how to use the S/4HANA Migration Cockpit to mass import locations in SAP Environment, Health and Safety. It is applicable for recent versions of S/4HANA and S/4HANA Cloud, public edition and private edition. It contains a brief description how to do the import and an example.

Preface


Creating a lot of locations manually and adding them to the location hierarchy can be a tedious task using the UI. First, you have to create all locations and secondly you need to add them to the location hierarchy. This can sum up to many clicks. With the S/4HANA Migration Cockpit, you can model your locations and their hierarchy in Excel files and mass import them.

Importing Locations using the Migration Cockpit


There are two relevant migration objects: EHS - Location and EHS - Location hierarchy. Add both objects to an existing or new migration project. The prerequisite objects are not mandatory.

Importing Locations


First, download the migration template for the EHS - Location migration object and fill it with your locations. Most fields are optional. All mandatory fields are on tab Location Revision.

Each row on this tab represents a revision of a location. If your locations haven't changed over time, you need only one revision per location which in turn means one row per location. You can enter them like this:






















































Location Key Location Revision Key Default Language Name Type Status Description Revision Name Revision Start Date
location name "Initial" language ISO code location name location type from Mapping of Location Type.xml
(choose download)
status type from Mapping of Location Status.xml
(choose download)
optional description "Initial" date from which
the location is valid
Example:
Berlin Initial EN Berlin Site New Initial 1/1/2018
Berlin Building 1 Initial EN Berlin Building 1 Building New Initial 1/1/2018


Once you've filled your location template, you can upload and migrate the locations.

In the mapping step, you can upload the mapping templates to avoid manual mapping of the values for location type and status:

Importing the Location Hierarchy


Secondly, download the migration template for the EHS - Location hierarchy object.

The file contains only two tabs for data entry Location Hierarchy Revision and Location Hierarchy.

On tab Location Hierarchy Revision, you need to create exactly one row with a name for the fields Location Hierarchy Revision Key and Revision Name, for example "Initial Revision". The interesting thing here is the field Revision Start Date. The import can either add locations to an existing hierarchy revision or create a new hierarchy revision. Usually, you want to import locations into an existing revision where you already have some locations. For that, set Revision Start Date to the start date of that existing hierarchy revision. You can look it up on the Edit Location Structure screen reachable from the Manage Locations app. If you choose a Revision Start Date that does not match an existing revision, it will create a new blank hierarchy revision with just the locations you provide.

In the downloaded template goto tab Location Hierarchy and create a row for each of your locations by copying the location keys from the EHS - Location template into the columns Location Hierarchy Key and Location Key.

Fill in the Location Hierarchy Revision Key that you have used for the previous tab.

Now, you just have to specify which is the parent location for each location, by providing its location key in field Parent Location Key. If a location should be on top of the hierarchy, just leave the field blank.

You don't need to provide any values in the Location ID and Parent Location ID columns. These are alternative ways to build up the hierarchy using the numeric IDs instead of the key. Since, yo've first imported all the locations, the system already knows the mapping between the textual keys entered in the template and the technical keys in the database.










































Location Hierarchy Revision Key Location Hierarchy Key Location Key Location ID Parent Location Key Parent Location ID
from tab "Location Hierarchy Revision" location name location name leave blank location name of parent or blank leave blank
Example:
Initial Revision Berlin Berlin
Initial Revision Berlin Building 1 Berlin Building 1 Berlin


Once the template is ready, upload it and migrate the data.

After successful migration, you can view your location hierarchy in the app Manage Location.

Example Locations


You can download an example for location and location hierarchy from SAP-samples on GitHub:

https://github.com/SAP-samples/ehs-environment-management-samples/tree/main/locations

If you want to import it into your system, make sure the Revision Start Date is right.

This is the resulting location hierarchy:


 

Further Information


3 Comments