Search Results p_where_clause_p




Overview

APPS.OKS_OKSFOSUM_XMLP_PKG is the generated PL/SQL package body that backs the Oracle Service Contracts "Forecast Summary" XML Publisher concurrent program (short name OKSFOSUM, module OKS). It belongs to the Service Contracts (OKS) reporting layer and is responsible for preparing report data and driving report-level side effects before, during, and after execution. Its principal business purpose is to compute and summarize revenue recognition and contract forecast amounts across a date range for a selected operating unit and contract group, and to present the result through the XML Publisher engine.

The package is delivered under the APPS schema and is classified as an "OTHER" API, meaning it is a report-support artifact rather than a callable public interface. It is not intended to be referenced by other packages, and the metadata confirms it is referenced by zero other packages.

Key Procedures and Functions

The package exposes five documented program units, typical of the Oracle Reports/XML Publisher SRW-compatible structure:

  • BEFOREREPORT — Executes the pre-report logic. It establishes the Multi-Org policy context for the selected operating unit via MO_GLOBAL.SET_POLICY_CONTEXT, resolves the operating unit name from HR_OPERATING_UNITS, and calls OKS_EXTWAR_UTIL_PVT.CALCULATE_REV_REC to compute revenue recognition figures for the requested date range, contract group, amounts, revenue-recognition date, and currency.
  • AFTERPFORM — Runs after the parameter form values are established. It initializes the concurrent request ID from FND_GLOBAL.CONC_REQUEST_ID, maps parameters into local package variables, formats the start and end dates, and resolves the operating unit. In particular, when no operating unit is supplied it honors the FND profile option OKC_VIEW_K_BY_ORG: if that profile returns 'Y', the operating unit defaults to the value of profile ORG_ID. It also resolves the contract group name from OKC_K_GROUPS_V when a group ID is provided.
  • AFTERREPORT — Performs post-report cleanup and finalization once the report output has been produced.
  • P_WHERE_CLAUSE_P — Supplies the dynamically assembled WHERE clause used by the report query, allowing the forecast summary to be filtered by the parameters gathered in the earlier phases.
  • CP_ORG_NAME_P — Reports or exposes the resolved operating unit (organization) name captured during the before/after form processing, used as a display value in the report layout.

Tables Accessed

The documented base/reference tables accessed by this package are:

  • OKS_STATUS_FORECAST — the Service Contracts status forecast table that provides the forecast rows summarized by the report.
  • HR_OPERATING_UNITS — referenced in the source to translate the operating unit ID into a display name.
  • OKC_K_GROUPS_V — the contract groups view, used to resolve the contract group name from the group ID.

In addition, the package invokes OKS_EXTWAR_UTIL_PVT.CALCULATE_REV_REC to persist or refresh revenue recognition calculations tied to the report run.

Usage Notes

This package is normally invoked indirectly by the XML Publisher concurrent program OKSFOSUM; users do not call it directly. It is typically run from the Service Contracts responsibility, where the user enters an operating unit, date range, contract group, currency, and amount thresholds on the parameter form. The OKC_VIEW_K_BY_ORG profile option directly governs defaulting behavior: when set to 'Y' and no operating unit is entered, the package restricts results to the session's ORG_ID. Because it is a report-support package with no dependents, it should not be used as a programmatic API; customizations should instead target OKS_EXTWAR_UTIL_PVT or the underlying report definition.