Search Results apply_map




Overview

GCS_LEX_MAP_API_PKG is the application programming interface for lexical mapping within the Oracle E-Business Suite Financial Consolidation and reporting foundation, which relies on the FEM (Financial Enterprise Management) and GCS (Global Consolidation System) object model. Lexical mapping provides the mechanism by which source values drawn from a source system or staging table are translated into the target values required by a consolidation or reporting model. Rather than requiring a fixed, static lookup, lexical mapping permits each mapping rule to be expressed as generated PL/SQL code, giving administrators the flexibility to encode conditional, rule-driven derivations.

The package serves two principal business functions. First, it generates the executable PL/SQL functions that embody the rules of a given lexical mapping rule set. Second, it applies those mappings and validations against staging tables, writing transformed results while honouring administrator-defined filter criteria. A final procedure supports post-refresh maintenance of the underlying mapping metadata, ensuring the object catalog and definition tables remain consistent after a FEM metadata refresh.

Key Procedures and Functions

The package exposes five documented entry points, all classified under the OTHER API classification:

  • CREATE_MAP_FUNCTIONS — Generates a PL/SQL function for each rule belonging to a lexical mapping. Each generated function contains the code required to return the appropriate target value given the input values needed by that rule. The caller supplies the rule set identifier, and the procedure returns standard concurrent-style messaging outputs.
  • APPLY_MAP — Applies a previously generated lexical mapping to a nominated staging table. Only rows that satisfy the supplied filter criteria are affected. The procedure accepts the rule set identifier, the staging table name, a debug flag controlling log output, and one or more filter column/value pairs. It is expected that mapping functions have already been created before APPLY_MAP is invoked.
  • CREATE_VALIDATION_FUNCTIONS — Produces the PL/SQL validation functions associated with a lexical mapping rule set, paralleling CREATE_MAP_FUNCTIONS for the validation side of the mapping definition.
  • APPLY_VALIDATION — Executes the generated validation logic against staged data, allowing invalid or non-conforming rows to be identified before or during consolidation processing.
  • AFTER_FEM_REFRESH — Performs post-refresh housekeeping so that lexical mapping metadata remains aligned with the FEM object catalog following a metadata refresh cycle.

The package also defines an error_record_type record structure and an associated global error_table PL/SQL table, used to capture error codes, rule identifiers, derivation numbers, and row identifiers encountered during processing.

Tables Accessed

The package reads and writes the core lexical mapping definition tables. GCS_LEX_MAP_RULE_SETS and GCS_LEX_MAP_RULES hold the rule set headers and individual rules; GCS_LEX_MAP_DERIVATIONS, GCS_LEX_MAP_DRV_DETAILS, and GCS_LEX_MAP_COLUMNS describe the target derivations and their source columns; GCS_LEX_MAP_CONDITIONS stores the filter and condition expressions; and GCS_LEX_MAP_PLSQL_FUNCS records the generated PL/SQL function bodies produced by CREATE_MAP_FUNCTIONS and CREATE_VALIDATION_FUNCTIONS.

On the FEM side, the package references FEM_OBJECT_CATALOG_B and FEM_OBJECT_CATALOG_TL, FEM_OBJECT_DEFINITION_B and FEM_OBJECT_DEFINITION_TL, together with the FEM_OBJECT_DEFINITION_ID_SEQ, FEM_OBJECT_ID_SEQ, and FEM_OBJECT_CATALOG sequences. These supply object identity and descriptive metadata for the mapping entities. FND_FLEX_VALIDATION_TABLES and FND_FLEX_VALUE_SETS are consulted to integrate with standard Flexfield validation and value set behaviour.

Usage Notes

GCS_LEX_MAP_API_PKG is normally invoked indirectly rather than from ad hoc SQL. The lexical mapping setup forms call CREATE_MAP_FUNCTIONS and CREATE_VALIDATION_FUNCTIONS when a rule set is saved or regenerated, and APPLY_MAP and APPLY_VALIDATION are driven by the mapping application process, typically as a concurrent program or as part of the broader consolidation data preparation flow. AFTER_FEM_REFRESH is scheduled as part of the FEM metadata refresh cycle.

Because the package is documented as referenced by two other packages, custom extensions should call the package only through its published procedures and should respect the ordering dependency: functions must be generated before they can be applied. The global error_table should be inspected after execution to retrieve diagnostic detail for individual failing rules.