Search Results get_segment_number




Overview

XLA_FLEX_UTIL is a utility package in the Application Object Library schema (APPS) that provides shared services for interrogating the Accounting Flexfield (key flexfield code GL#) structure of a given chart of accounts. The package ships as part of the Subledger Accounting (XLA) infrastructure introduced in Oracle E-Business Suite 12.1.1 and carried forward into 12.2.2, and it is classified in the ETRM repository as a UTIL package. Its principal business purpose is to answer structural questions about a chart of accounts — which segments are enabled, in what order they appear, which segment carries the natural account, and how segments relate to one another — so that higher-level accounting programs can build, parse, and validate accounting flexfield combinations without hard-coding segment metadata.

The package is a low-level building block rather than an end-user feature. Callers pass an identifying value such as p_chart_of_accounts_id (the id_flex_num of the GL accounting flexfield) and receive back segment numbering, ordering, and application column information derived from the flexfield definition tables.

Key Procedures and Functions

Six documented entry points are exposed by the package body:

  • GETSEGMENTINFO — Populates the package collection type t_segmentinfo with one entry per enabled GL# segment, assigning each segment its segment number and a sequential order number. It is the foundational routine used when callers need the complete ordered segment map for a chart of accounts.
  • GET_ACCOUNT_FLEX_INFO — Returns accounting flexfield information for the chart of accounts passed in, including the segment delimiter, the count of enabled segments, the ordering expression, and the segment number and application column name of the natural account segment.
  • GET_ORDERED_ACCOUNT — Produces an account value assembled in the correct segment order for the chart of accounts, allowing callers to normalize or reconstruct a concatenated accounting flexfield string.
  • IS_SEGMENT_DEPENDENT — Determines whether one accounting flexfield segment is dependent on another, based on the flexfield validation rules defined for the structure.
  • GET_PARENT_SEGMENT — Returns the parent segment associated with a given segment, supporting dependent and hierarchical segment relationships.
  • GET_SEGMENT_NUMBER — Resolves the segment number for a specified segment within a chart of accounts.

Tables Accessed

The package reads the following flexfield definition and validation tables through APPS synonyms:

  • FND_ID_FLEX_SEGMENTS — Supplies segment_num and application_column_name for enabled segments where application_id = 101 and id_flex_code = 'GL#', filtered by id_flex_num equal to the chart of accounts identifier and ordered by segment_num. The _VL view is also referenced for segment number lookups.
  • FND_ID_FLEXS — Provides header-level key flexfield definition data for the GL# structure.
  • FND_FLEX_VALUE_SETS — Identifies the value set attached to each segment, which is required to evaluate dependencies and hierarchies.
  • FND_FLEX_VALIDATION_TABLES — Supplies the validation table bindings used to determine segment dependency relationships.

All access is read-only; the package does not maintain or update flexfield metadata.

Usage Notes

XLA_FLEX_UTIL is invoked programmatically rather than through a form or concurrent program of its own. It is referenced by at least one other package in the ETRM inventory, and is typically called by Subledger Accounting and General Ledger processing code, by custom extensions that must derive segment order or the natural account segment dynamically, and by validation routines that need to confirm segment dependencies before posting. Because it depends on the current flexfield definition, any change to the chart of accounts structure is reflected automatically at the next invocation. Developers should treat p_chart_of_accounts_id as the mandatory entry point parameter and expect the OUT NOCOPY collection and scalar parameters documented above to be returned in the caller's session.