Search Results init_account_hierarchy
Overview
JE_GR_TRIAL_BALANCE is an Oracle EBS General Ledger package owned by the APPS schema and classified as OTHER in the E-Business Suite Technical Reference Manual for 12.2.2. Its header, identified by the source tag jegrftbs.pls and last shipped at version 115.2 (2002/11/12), declares the package with AUTHID CURRENT_USER, meaning that execution privileges resolve to the invoking schema rather than to the package owner. The name and structure indicate that the package supports a trial balance reporting process, most likely the generating component of a General Ledger trial balance report executed as a concurrent program. Its primary responsibility is to resolve and cache the hierarchical ancestry of accounting flexfield accounts so that report rows can be grouped, subtotaled, or rolled up from child accounts to their L1 through L9 parents. The package maintains a global, session-scoped PL/SQL table of account records and exposes two public entry points for initializing that cache and for retrieving a parent value at a given level.
Key Procedures and Functions
- INIT_ACCOUNT_HIERARCHY — A function that initializes the account hierarchy structure used by the remainder of the package. It accepts a request identifier, a delimiter used to parse hierarchical account segment values, and two IN OUT NOCOPY parameters carrying return code and error message. It returns a numeric status. Its purpose is to populate the package global
g_account_tab, which stores each account together with its delimitated form, a count of resolved levels, and parent values in fields L1 through L9. Where an account has no parent at a given level, the corresponding element is set to 0. - GET_LEVEL_VALUE — A function that accepts a level number and an account and returns a VARCHAR2. This is the object associated with the search term "get_level_value". Its purpose is to return the parent account value at the requested hierarchy level for the supplied account. The package declares a
pragma restrict_references (get_level_value, WNDS, WNPS)on this function, asserting that it writes neither database state nor package state, which qualifies it for use in SQL statements, as well as in PL/SQL contexts where purity is required. The function is therefore safe to invoke from a SELECT statement within the trial balance report query.
Tables Accessed
The ETRM metadata records two referenced tables, both accessed through APPS synonyms:
- FND_FLEX_VALUES — The flexfield value table that stores valid segment values and their hierarchy attributes. The package reads it to resolve the parent-child relationships of accounting flexfield values when building the L1 through L9 ancestry structure for each account.
- GL_RX_TRIAL_BALANCE_ITF — A General Ledger interface table associated with trial balance report processing, used as the destination or staging structure for account-level trial balance data.
Usage Notes
JE_GR_TRIAL_BALANCE is invoked during execution of the trial balance reporting flow, typically after the request identifier is known. INIT_ACCOUNT_HIERARCHY is called first to load the hierarchy cache from FND_FLEX_VALUES, using the delimiter to split account segment values. GET_LEVEL_VALUE is then called repeatedly, and may be called directly from SQL because of its WNDS/WNPS purity assertion, to obtain the parent value for a specified level. Because the hierarchy is held in package global variables, the cache persists for the duration of the database session and must be initialized before retrieval calls are effective. The package is not referenced by any other documented package, so callers are the report program itself or custom code that reproduces the trial balance rollup. The AUTHID CURRENT_USER directive requires that the invoking user hold appropriate privileges on the referenced synonym objects. The $Header stamp indicates the source has been stable since release 11.5.10-era maintenance, and the documented parameter signatures should be treated as authoritative.