Transferring Location Data

Use

To transfer incidents from a target to a source system, you must transfer the location data first. This ensures the correct handling of locations and preserving the existing relations during the transfer of incidents.

The location data consists of location entries and a location structure (hierarchy) that organizes these entries. When you transfer location data, you must transfer the location entries first, and then the location structure.

Procedure

Exporting Location Data

To export the location entries from Component Extension for SAP EHS Management to a CSV data file, you can use the R_EHFND_LOC_TO_CSV report. To export the location structure, you can use the R_EHFND_LHR_STRUCTURE_TO_CSV report.

  1. Start transaction SE38.

  2. Execute one of the following reports to export the corresponding data:

    • Location entries: R_EHFND_LOC_TO_CSV

    • Location structure: R_EHFND_LHR_STRUCTURE_TO_CSV

  3. Enter a name for the CSV file.

    Optionally, if you export locations, you can select the entries you want to export.

  4. Execute the program.

The location data is taken from the BO nodes and then organized in the CSV files. For more information about the location BO nodes and the stored data, see SAP Note 1733565 Information published on SAP site.

Importing Location Data

  • Locations

    To import the locations in Component Extension for SAP EHS Management, you can use the LSMW. When you import locations, you can use the same data file for multiple imports in the same system. Note that the workbench performs a check and does not import again already imported locations. However, if an error occurs with any of the locations, you can fix the error and use the same file to import that location.

  • Location Structures

    After you import the locations, you can import the location structure using the LSMW. If another location structure exists in the target system, the system merges both location structures.

  • Location Data Revisions

    When you update the location data, you can create revisions of a location or a location structure that include the updated data. The revisions are stored in the system and tagged with the date on which they are created. The consecutive date tags of the location data revisions span a time interval for the specific revision.

    When you export location data, all revisions are exported to the CSV file. Then, when you import the location structure, the revisions of the location structure are merged into the target system. If the revisions (time intervals) of the imported structure overlap the revisions of an existing structure, the system merges the structures and creates narrower revisions. Note that in this case the system merges only the locations that are revised within the newly created interval. Thus, the imported locations may be transferred into a revision that is different from the original.

  1. Start transaction LSMW and open one of the following project and object, depending on the data you want to import.

    • Locations

      Project: LOC_MIGRATION

      Object: LOC_IMPORT

    • Location Structure

      Project: LOC_STR_MIGR

      Object: LOC_STR_IMPORT

  2. Open the Maintain Fixed Values, Translations, User-Defined Routines process step and enable, or disable a test data transfer. By setting TEST_RUN you can execute test import into the target system and error proof the real import at a later stage. Enter X in the Value field to enable test run.

  3. Open the Specify Files process step and provide the import data file.

  4. Execute the rest of the import steps in the following order:

    1. Assign Files

    2. Read Data

    3. Display Read Data

    4. Convert Data

    5. Display Converted Data

    6. Start IDoc Generation

    7. Start IDoc Processing

    8. Create IDoc Overview

    9. Start IDoc Follow-Up

  5. After executing LSMW project LOC_STR_MIGR, you need to rebuild the location paths as follows:

    1. Start transaction SE38.

    2. Open report R_EHFND_LHR_BUILD_PATH.

    3. Select all checkboxes and execute the report.

For more information about the LSMW, see the SAP Library for SAP NetWeaver 7.31 at http://help.sap.com/nw731Information published on SAP site Start of the navigation pathSAP NetWeaver Library: Function-Oriented View Next navigation step Application Server Next navigation step Application Server ABAP Next navigation step Other Services Next navigation step Services for Administrators Next navigation step Legacy System Migration WorkbenchEnd of the navigation path.