Search Results gl_get_effective_num




Overview

GL_SEL_SEG_TURNOVER_RPT_PKG is a report-support package in the Oracle E-Business Suite General Ledger module. Its name indicates that it supports a "selected segment turnover" report, a common GL reporting pattern in which the user selects a balancing segment (or ledger) and a range of accounting periods and receives a turnover/reconciliation listing for those periods. The package body combines two distinct responsibilities: it resolves an accounting period into an effective period number against the correct underlying ledger, and it reconstructs external document references for individual journal entry lines. This makes the package an integrating layer between GL journal data, GL period status, and subledger document sources such as Payables, Receivables, and Cash Management.

The parameter name most commonly associated with this object is gl_get_effective_num, a private procedure at the top of the package body. It is the mechanism by which the report converts a user-selected ledger identifier and period name into the numeric effective period used for period-ordered reporting.

Key Procedures and Functions

  • gl_get_effective_num — Resolves a period name and ledger into an effective period number. It first queries the ledger definition to determine whether the supplied identifier is a single ledger or a ledger set. If a ledger set is passed, it selects one underlying ledger from the set assignments; if a single ledger is passed, it is used directly. The effective period number is then read from the period status record for that ledger and period. Errors are surfaced through an output error buffer, using the GL_PLL_INVALID_PERIOD message when no period status row exists, or the raw SQL error otherwise.
  • int_doc_number — A function that derives a human-readable external document reference from the subledger import references associated with a journal header and line. It joins the journal import references to Cash Management statement headers and lines and formats the bank account, statement number, and statement line into a composite reference string. This allows the turnover report to show the originating source document rather than only the GL journal.

Although the package metadata lists two documented procedures, BEFOREREPORT and INT_DOC_NUMBER, the body excerpt shows that gl_get_effective_num is an equally central private procedure invoked during report execution.

Tables Accessed

Usage Notes

The package is not referenced by any other PL/SQL package, indicating that it is invoked directly as report logic rather than as a reusable API. It is typically called from a General Ledger concurrent program or a report definition whose BEFORE REPORT trigger performs parameter validation and setup; the presence of BEFOREREPORT among the documented procedures supports this. gl_get_effective_num is executed during that setup phase, and int_doc_number during the report's data fetch, once per journal line requiring a source document reference.

Because the package reads period status and ledger set assignments, behavior depends on period status being open or closed as recorded in GL_PERIOD_STATUSES. If a period name is misspelled or is not defined for the chosen ledger, the error buffer is populated with the GL_PLL_INVALID_PERIOD message and report execution should be halted by the caller. Customizations that replace or extend this package must preserve the error-buffer contract and must respect that only single ledgers are supported for effective period resolution; ledger sets are reduced to a single constituent ledger for that lookup.