Search Results balancing_segment_where
Overview
The APPS.GL_GLYRLBGE_XMLP_PKG package body supports the Oracle General Ledger Year-End Ledger Balance report in Oracle E-Business Suite 12.1.1 and 12.2.2. It is a report-support PL/SQL package generated in the standard Oracle Reports XML Publisher (_XMLP_PKG) pattern, where database-side PL/SQL encapsulates the data-fetching, security, and derived-column logic executed by the report before and during its processing phases.
The package's central responsibility is to resolve the correct ledger and accounting period context for the user's request, then build the dynamic SQL WHERE fragments that constrain the reported balances to the appropriate accounting flexfield ranges. The BeforeReport function is the primary entry point, validating the access set, resolving the first ledger from a ledger set, mapping the requested period to its first associated period, and constructing segment-level WHERE clauses. The package is owned by APPS and is classified under OTHER in the ETRM repository, reflecting its role as report infrastructure rather than a general-purpose API. It is referenced by no other packages, confirming that its scope is confined to the report definition that invokes it.
Key Procedures and Functions
The package exposes 42 documented procedures and functions. The most significant groups are:
- BEFOREREPORT — Executes prior to report data retrieval. It validates input parameters, resolves the target ledger via
gl_ledger_utils_pkg.Get_First_Ledger_Id_From_Set, obtains the first period name throughgl_get_first_period, and raisesraise_application_error(-20101, ...)when an error buffer is returned. It also assembles theACCOUNTING_SEGMENT_WHEREandBALANCING_SEGMENT_WHEREfragments used to filter balances. - GL_GET_LEDGER_INFO and GL_GET_FIRST_PERIOD — Helper functions that retrieve ledger attributes and the first period associated with a given period and ledger, supporting the report's period-beginning logic.
- NET_CRFORMULA and its context variants (COMP_NET_CRFORMULA, CL_NET_CRFORMULA, SC_NET_CRFORMULA, GR_NET_CRFORMULA, GRAND_NET_CRFORMULA) — Summary-level formula columns that compute net credit balances at company, class, subclass, group, and grand-total grouping levels.
- Group filter functions (
G_MAINGROUPFILTER,G_COMPANYGROUPFILTER,G_CLASSGROUPFILTER,G_SUB_CLASSGROUPFILTER,G_GROUPSGROUPFILTER) — Conditional formatting or data-group filters that determine which rows are displayed at each grouping tier. - Label and display helpers —
C_BAL_LPROMPTFORMULA,COMPANY_LPROMPT_NDFORMULA,ZERO_INDICATORFORMULA,GET_INDUSTRY_CODE,SET_DISPLAY_FOR_GOV, andSET_DISPLAY_FOR_COREcontrol dynamic prompts, zero-balance suppression, industry-specific behavior, and government versus core ledger display conventions.
Tables Accessed
The package reads from three documented tables through APPS synonyms:
- GL_ACCESS_SETS — Queried in
BeforeReportto obtain the access set name and chart of accounts identifier (CHART_OF_ACCOUNTS_ID), which populate theACCESS_NAMEandSTRUCT_NUMreport columns and drive accounting flexfield structure awareness. - GL_LEDGERS — Used to obtain ledger attributes such as ledger name and functional currency for the resolved target ledger.
- GL_PERIOD_STATUSES — Used by the period-resolution logic to determine the first period and its associated status for balance reporting.
Usage Notes
GL_GLYRLBGE_XMLP_PKG is invoked exclusively by the XML Publisher report definition for the General Ledger year-end ledger balance report. It is not registered as a concurrent program directly and is not called by other PL/SQL packages. Administrators encounter it when the report raises error -20101, typically caused by an invalid ledger set, an unresolvable ledger currency, or a period name with no corresponding first period. In the context of the user's search for currency_where, the package's currency handling flows through P_LEDGER_CURRENCY and the ledger-resolution utilities, which ultimately influence the currency-driven WHERE constructs applied to the balance query. Customizations should avoid modifying this generated package body, as it is regenerated by the report definition and any direct changes will be overwritten.