SAP BAPIObjectBAPI_FUNCLOC_CREATEModulePM_EAM

BAPI_FUNCLOC_CREATE — BAPI for Creating a Functional Location

BAPI_FUNCLOC_CREATE creates a new functional location master record, the same object built manually in transaction IL01. It takes structure indicator, category, description and organizational data as import parameters and returns the generated functional location number plus a RETURN table of BAPIRET2 messages that must be scanned for error and abort entries before the caller trusts the result.

This page covers BAPI_FUNCLOC_CREATE, the classic BAPI used to create functional location master data programmatically, mirroring transaction IL01. It focuses on the parameters that actually matter, how RETURN is misread in practice, and the structure-indicator and hierarchy problems that account for most failed calls in integration and migration work.

Published 16 Sept 2026· 1,062 words

What it does

BAPI_FUNCLOC_CREATE creates a functional location, the hierarchical object used in Plant Maintenance and Asset Management to represent a technical location such as a plant section, production line or building. It is the programmatic equivalent of transaction IL01. Typical callers are data migration loads, interface programs feeding functional location data from an external asset register, and custom Fiori or web front ends that let planners register new locations without opening the SAP GUI transaction. The BAPI builds the functional location key according to the structure indicator's edit mask, links it into the existing hierarchy through the superior functional location, and stores the organizational and classification data attached to the object. It does not create equipment, install equipment at the location, or maintain notifications and orders against it; those are separate calls.

Important parameters

The interface is narrow compared to the order and notification BAPIs, but each parameter carries weight and a missing value produces a hard error rather than a silent default.

  • FUNCTIONALLOC - the main import structure carrying the functional location key or the segments needed to derive it, the structure indicator, category, description, superior functional location, and the core organizational fields such as maintenance plant and planning plant
  • CLASSIFICATION or a similarly named table parameter - optional classification data (class and characteristic values) to attach to the object at creation, used mainly in migration scenarios where legacy attributes are mapped to SAP classes
  • RETURN - table of BAPIRET2 structures returned by the call, carrying success confirmations, warnings, errors and the generated or confirmed functional location number in message context
  • an export field or structure holding the created functional location number when the number is system-generated rather than passed in by the caller

Commit behaviour

BAPI_FUNCLOC_CREATE follows the standard classic-BAPI pattern: it does the update-buffer work but does not commit the database change itself. The caller has to call BAPI_TRANSACTION_COMMIT afterward, or the created functional location exists only in the current LUW and disappears when the session ends without a commit. This is the single most common cause of missing objects reported after a batch load: the load program logs a successful RETURN, the developer assumes success equals persistence, and no commit call follows. A rollback call, or simply letting the program terminate abnormally before the commit, discards the created functional location with no error raised anywhere in the interface.

Return handling

RETURN is a table, not a flag, and a successful call can still carry warning or informational entries alongside the confirmation. The only safe pattern is to loop over RETURN and check the TYPE field for 'E' or 'A'; anything else, including an empty table, should be treated as success but not assumed to mean a commit already happened. The lazy pattern seen repeatedly in interface code is checking sy-subrc after the BAPI call, which is meaningless because the function module itself returns 0 regardless of business-level failure, or checking IF RETURN IS INITIAL, which misses the common case where RETURN contains only a success message and is therefore not initial at all. A second recurring bug is reading only the first line of RETURN in a loop with an early exit, which hides a later error entry describing why the functional location number was not actually generated, such as a structure indicator mismatch discovered mid-processing.

ECC vs S/4HANA

BAPI_FUNCLOC_CREATE remains in active use on S/4HANA; there is no widely adopted released successor API specifically for functional location creation that has displaced it in interface and migration work. S/4HANA does provide newer Fiori apps for managing functional locations, but the underlying create logic for custom interfaces and migration tooling still commonly goes through this BAPI. Projects should confirm current recommendations for their specific release rather than assume a newer API exists, since this is an area where SAP's roadmap for classic PM BAPIs has moved slowly compared to order and notification processing.

Common pitfalls

Most failures trace back to hierarchy and structure indicator mismatches rather than to the BAPI call itself.

  • Functional location number does not match the structure indicator's edit mask, producing a hard error even though the number looks visually plausible
  • Superior functional location referenced in the call does not exist yet, which breaks batch loads that were not sequenced parent-before-child
  • Category or structure indicator on the child conflicts with the parent's structure, an error that only surfaces at creation time even though the mismatch was set up earlier in master data configuration
  • Organizational data such as maintenance plant or planning plant omitted or inconsistent with the superior location, causing the object to be created but unusable for later equipment installation or order creation
  • Missing commit after a batch of calls, so a load reports full success but the functional locations are not present when checked in a separate session
  • Classification data passed with a class that is not assigned to the object's class type or category, which fails silently into a warning that gets ignored because RETURN was not scanned properly

Whose problem this is

A rejected create is functional configuration first: the structure indicator, category and hierarchy setup for functional locations sit in Plant Maintenance master data configuration, and most errors trace back there. Development owns the interface logic itself, specifically whether RETURN is parsed correctly and whether a commit follows success. Bring the exact RETURN table content and the structure indicator of both the new and superior functional location to whichever side is asked to investigate first.

Related SAP objects

Reviewed pages this object connects to in the ERPClimb knowledge graph.

Source: ERPClimb — https://erpclimb.com/sap-bapis/bapi-funcloc-createERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.