Page tree
Skip to end of metadata
Go to start of metadata

Purpose

The purpose of this page is to provide useful info on Location within the SAP Master Data context and on how to manage/maintain same.

See also Business Partner and Location integration via Core Interface.

Overview

Contents:


General

A location is a place or organizational unit at which quantities of products or resources are managed.

Location is the other essential master data element in APO planning. As well as product it is also used by all the advanced processes like location-product (or product-location), model, planning version, transportation lanes.

Every location has address data too: Address data is not stored together with APO location in the APO database layer (ADRC table) but in the SAP Basis layer. APO locations use up address data from there. Geo-coordinates are stored at /SAPAPO/LOC table on the other hand. (For Business Partners the geocoding data is stored at GEOOBJR and GEOLOC tables and Addresses at ADRC and BUT020 tables.)

If the Location is not created directly in APO but transferred via CIF from R/3 then the ERP-Vendor, ERP-Customer, ERP-Plant… will be converted to an APO-Location (with a specific Loc. Type).

Transaction for Location master data maintanance: /N/SAPAPO/LOC3

There are the following standard location types:

1001    Production Plant
1002    Distribution Center
1003    Shipping Point
1005    Transportation Zone
1006    Stock Transfer Point
1007    Storage Location MRP Area
1010    Customer
1011    Vendor
1050    Subcontractor
1020    Transportation Service Provider
1030    Terminal
1031    Geographical Area
1040    Store


The location types are defined in domain: /SAPAPO/C_LOCTYPE for transaction /N/SAPAPO/LOC3. This means that only the values defined in the domain are accepted as an entry. Related SAP KBA provides more information for /N/SCMTMS/LOC3: 2414426 - Location types in /N/SCMTMS/LOC3

S/4 Hana Locations

  • The program /SAPAPO/CREATE_LOCATION  can be used in S/4 Hana to create locations, please refer to the SAP Note: 2496856 - Restrictions and Implementation Recommendations for Production Planning and Detailed Scheduling for SAP S/4HANA 1709. CIF is not de-activated in S/4 Hana in contrary to products, but the Customer and Vendor integration is not to be used because the location type change is not implemented in the integration process.
  • In S/4Hana 1709 location type Customer and Vendor 1010 and 1011 are replaced by 1021 - Business Partner

2682360 - Deletion of Locations in S/4 HANA


Maintain Locations in APO:

There are various ways to create/maintain locations in the APO system:

  1. You can use the APO trasaction: /N/SAPAPO/LOC3. Please see the following: TEST CASE

  2. You can transfer location via the Cross Interface Function (CIF) from ECC (ERP) system. It is related to Business Partner and Location CIF transfer.
  3. You can use MASSD transaction for batch editing (creation not possible) of locations
  4. BAPIs for Location maintenance and read:
    BAPI_LOCSRVAPS_DELMULTI2               Deletion of Locations
    BAPI_LOCSRVAPS_GETLIST2                 Read Locations
    BAPI_LOCSRVAPS_REQUESTLIST2        Query: Read Locations
    BAPI_LOCSRVAPS_SAVEMULTI2            Create or Change Location Data

Location Field Mapping table between ERP and SCM:

Location

Plant / Vendor / Customer

Location in APO is differentiated by location type 1001-plant, 1002-DC, 1007-MRP Area, 1010-Customer, 1011-Vendor

Field in APO/SCM

Field in ERP

Remarks

Country

Country Key

Region

Region

The region codes per country need to be defined in APO

Other Address fields

Other Address Fields

Time Zone & Precision

Corresponsing fields

Location Master database tables:

/SAPAPO/LOC: Locations

Fields:

-          LOCID: Location ID (Primary key, cannot be changed)
-          LOCNO: Location Number
-          LVORM: Deletion Flag
-          XPOS, YPOS (Loc. Coordinates)


/SAPAPO/LOCMAP: Location mapping between ERP and APO.

This table is used for displaying the mapping between different locations (vendor, customer) raised in ECC (R/3) and sent through CIF then landed as Location inside the SCM-APO system. These locations can still be found in the /SAPAPO/LOC table.

-          EXT_LOCNO: Location Number in ECC system
-          LOCID: Location ID in APO
-          LOCNO: Location Number in APO
-          LOGSYS: Name and Client of the system where the Location is originated (ECC sys).

/SAPAPO/MODELLOC: Locations assigned to a Model

In /SAPAPO/LOC and /SAPAPO/LOCMAP there must always be the same number of entries. Inconsistencies between /SAPAPO/LOC and /SAPAPO/LOCMAP occur possibly because of customer created code or non-standard usage of the system. They can be removed with report /SAPAPO/CHECK_LOC.

SAP Note 859650 includes a report to clean inconsistent //LOCMAP entries, that do not have a pair in //LOC table.


/SAPAPO/LOCVER: Version Dependent Location data is stored


Change Documents:

You can check the change log of the locations please visit: Change Document SCM APO Master Data

Location and SCU (Supply Chain Unit):

SCU transaction: /N/SCMB/SCUMAIN

When a location is created in SAP SCM either manually or by transfer via the core interface (CIF), the system automatically creates an SCU with identical general and address data and the business character planning location.

Conversely, if you create an SCU with the business character planning location, the system automatically creates a location with identical general and address data.

Dependency with Location: If the the Supply Chain unit has a Business Attribute: Planning Location, then the SCU is dependent with its location pair (/N/SAPAPO/LOC3). The SCU cannot be deleted if the Location still exists. However if the location master is deleted, the paired SCU will be deleted as well (regardless of deletion flag is set or not). Standalone SCUs can be deleted by the deletion flag is set on the corresponding SCU (via Transaction /SCMB/SCUMAIN  > General Tab > Deletion Flag). After setting the flag the deletion background report can be scheduled from the main screen of /n/scmb/scumain transaction. Note1: Executing the report will delete all standalone SCUs which are marked for deletion.

Tables:

/SCMB/TOENTITY

/SCMB/TOENTITYMP > mapping with EXT_ENTITY (like LOCMAP)

Reorganization report for the tables: /SCMB/CHECK_SCU (can be especially useful in S/4core & EWM)


Useful Reports and User Exits

Report /SAPAPO/CHANGE_LOCTYPE for changing location type. However, this report comes with a caveat (see note 912025)

- the report proceeds with direct database action
- the report does not check if any dependency is attached to the location (that normally the Where used framework does, you can check transaction WUF)
- the report does not check if there is any concern of any planning application that the loctype is changed
- there is no performance optimization in the report. (in case of larger selections can be a problem)
- there is no block size management included in the report (in case of larger selections can be a problem)
- this report was made to handle an erroneous scenario probably, and not for regular production usage

It is only permissible to use the /SAPAPO/CHANGE_LOCTYPE to change the location type after adequate TESTING in the TEST SYSTEM and where
the following Prerequisites hold true:

  1. The customer does not use MRP
  2. If orders in the location exist the new or the old location type must not be (1010) (customer)!!
  3. it is not possible to delete the location in APO


Populating additional fields in Location

You can review the additional fields at transaction. /N/SAPAPO/LOC3 > Additional tab. ATTLO01-ATTLO05 (They are in table /SAPAPO/LOC)
To the same tab you can create more fields, if required using the Easy Enhancement Workbench tool.

Please check Badi SMOD_APOCF001 (Interface IF_EX_SMOD_APOCF001)
method EXIT_/SAPAPO/SAPLCIF_LOC_001. This BADI is called in SCM Inbound function module /SAPAPO/CIF_LOC_INBOUND. Useful parameters here include the T_LOCCUS parameter and the Include structure CI_LOCCUS.


**Change Logs for location Displayed in /SAPAPO/LOC_CD_READ

 

Deleting a location

If you wish to delete a location, first set the deletion flag before finally deleting the location in a second step. Please check SAP User Assistance.
Deletion report: /SAPAPO/DELETE_LOCATIONS
You have eliminated any still-existent dependencies involving this location. Possible dependent objects include ATP assignments or a product, model, or resource assignment, for example.
lDependency of location products
lDependency of resources
lDependency of models
lDependency of location product independent ATP orders
lDependency of setup matrixes
lDependency of external procurement
lDependency of transportation lanes
lDependency of hierarchies (transportation zones)
lDependency of  customer specific data in customer database tables (check via BADI)
lIt is not checked if the location that should be deleted is still used in integration models on R/3 side
Description how the customer should proceed to delete dependent objects: documentation in note 572579
To clarify existing dependencies, you can generate a where-used list for the location that is to be deleted (transaction WUF); when you delete a location a where-used check is done automatically
More about the use of  WUF: WUF - Where Used Framework
2718254 - Program /SAPAPO/DELETE_LOCATIONS performance
2682360 - Deletion of Locations in S/4 HANA

Related SAP Notes/KBAs

1945654 - Performance problem during deletion of locations - for /sapapo/delete_locations

912025 - Report for changing the location type - /SAPAPO/CHANGE_LOCTYPE
2085023 - Inconsistency in /SAPAPO/LOCMAP
2041937 - Supply Chain Unit with name &1 already exists
1941160 - Error - Language key not defined during CIF
1823356 - Business Partner roles CRM004 or CRM002 missing
1729139 - BP Master Data distribution to SCM/EWM
1640403 - MASSD Location Authorization Check
1294305 - Form of address key &1 is not defined



Related Topics:

USMM measurement for APO Locations: General Nuggets in SCM APO Master Data

Change Document SCM APO Master Data

Key Master Data field mapping between APO and ERP (For Location!)

WUF - Where Used Framework