Search Results p_flex_low




Overview

FV_GTAS_TBAL_TRX_PKG is an APPS-owned PL/SQL package in Oracle E-Business Suite that supports trial balance reporting for federal government treasury symbols (GTAS, the Governmentwide Treasury Account Symbol Adjusted Trial Balance System). The package is declared with AUTHID CURRENT_USER, meaning its SQL executes under the privileges of the invoking session rather than the package owner, which is appropriate for a reporting utility that must honor the caller's data access. Its logic bridges Oracle General Ledger account balances with federal Treasury Account Symbol (TAS) attributes, allowing agencies to extract and format trial balance data required for GTAS submission. The package exposes package-level global variables—including ledger and chart of accounts identifiers, flexfield low/high ranges, agency identifier (AID) ranges, main account ranges, and single TAS, currency, and period values—that carry report parameter state across procedure calls.

Key Procedures and Functions

  • BEFOREREPORT — A Boolean function conventionally invoked as the BeforeReport trigger in Oracle Reports. It initializes the package globals and validates or prepares the reporting context before the report's main query executes.
  • BUILD_SEGS_WHERE_CLAUSE — Constructs the SQL WHERE clause fragment used to restrict general ledger account combinations to the requested flexfield range. It accepts the low and high flexfield values and the set of books identifier, and returns the assembled clause through an OUT NOCOPY parameter. This procedure is the direct consumer of the p_flex_low and p_flex_high parameters that appear throughout the package.
  • TRIAL_BALANCE_MAIN — The principal driver procedure. It accepts the ledger identifier, chart of accounts identifier, flexfield low/high range, accounting period, agency identifier low/high range, main account low/high range, and a TAS value, and produces the trial balance data for the requested combination.

Tables Accessed

The package reads from both General Ledger and federal treasury structures. GL_BALANCES and GL_PERIOD_STATUSES supply the underlying account balances and period open/close state; GL_LEDGERS and GL_CODE_COMBINATIONS provide ledger and account combination context, consistent with the P_LEDGER_ID and P_CHART_OF_ACCOUNTS_ID variables. FND_ID_FLEX_SEGMENTS and FND_ID_FLEX_STRUCTURES are consulted to resolve the key flexfield structure and segment definitions required by BUILD_SEGS_WHERE_CLAUSE. FV_TREASURY_SYMBOLS maps the treasury symbol (TAS) used in federal reporting, and FV_GTAS1_REPORT_T2 is the GTAS-specific reporting table that holds intermediate or formatted trial balance output.

Usage Notes

Because its entry points are a BeforeReport trigger and Oracle Reports–style OUT parameters, this package is normally invoked from an Oracle Reports executable or a concurrent program that runs GTAS trial balance output, rather than from a data-entry form. The p_flex_low parameter is supplied by the report's parameter form and consumed by BUILD_SEGS_WHERE_CLAUSE to constrain the account combination range. The package is referenced by one other package in the ETRM inventory, and customers extending GTAS reporting can call TRIAL_BALANCE_MAIN directly from custom PL/SQL when a programmatic extraction is required. As an OTHER-classified API rather than a supported public interface, it should be treated as internal and subject to change between patch levels.