Search Results build_txn_accum




Overview

PA_PROJ_ACCUM_MAIN is the principal PL/SQL driver package within the Oracle Projects (PA) module responsible for project-level accumulation processing. Accumulation is the mechanism by which Oracle Projects consolidates transactional detail — expenditures, commitments, budgets, draft revenue, and allocations — into summarized periodic balances that feed downstream costing, revenue generation, and reporting routines. The package orchestrates a full accumulation run for a given period or range of periods, managing period validation, project eligibility, record locking, and the population of temporary staging tables used during the summarization cycle.

Declared with AUTHID CURRENT_USER, the package executes with the privileges of the invoking schema. Its public variables capture standard "Who" audit columns (last updated by, created by, last update login, concurrent request, program application, and program identifiers) sourced from FND_GLOBAL. It also defines module-level state for the implementation's accumulation period type, current PA and GL accounting periods, period start and end dates, current year, and prior/current accumulation period tracking — all read once per installation to govern the run. A dedicated RECORD_ALREADY_LOCKED exception, initialized against ORA-00054, is declared to handle concurrent access contention on project header records.

Key Procedures and Functions

  • INITIALIZE — Establishes the package-level runtime context: implementation options, current PA and GL periods, and associated period boundary dates. This is the entry point that primes all subsequent processing for a run.
  • INITIALIZE_PROJECT — Performs per-project setup before accumulation, resetting project-scoped variables and prior/current accumulation period holders.
  • PROJ_ACCUM — The central accumulation routine that processes a single project's transactions into summarized balances.
  • PROJ_REFRESH — Refreshes accumulated project data, typically to realign summary results after underlying detail changes.
  • REF_RL_ACCUM — Handles accumulation related to reference and revenue/ledger summarization.
  • BUILD_TXN_ACCUM — Constructs the transaction accumulation set from source detail records.
  • LOCK_PROJ_LEVEL_HEADER_RECORD — Acquires a lock on the project-level accumulation header, raising RECORD_ALREADY_LOCKED on contention.
  • ACTION_EXISTS — Determines whether a defined accumulation action is applicable for a given context.
  • CHECK_PERIOD_FLAGS — Validates period status flags to ensure periods are open/eligible for accumulation.
  • GET_CURR_END_DATE — Returns the applicable end date for the current accumulation period.
  • POPULATE_CMT_TMP_TABLE — Populates the commitment temporary tables used during commitment accumulation.

Tables Accessed

The package reads implementation and period configuration from PA_IMPLEMENTATIONS, PA_PERIODS, PA_PERIODS_V, and PA_BUDGET_VERSIONS. Project master data comes from PA_PROJECTS and the driver set PA_PROJECTS_FOR_ACCUM. Transactional sources include PA_COST_DISTRIBUTION_LINES_ALL, PA_ALLOC_TXN_DETAILS, PA_DRAFT_REVENUES, and PA_ACCUM_TXN_TIME. Commitment staging uses PA_COMMITMENT_TXNS_TMP, PA_PJM_PO_COMMITMENTS_TMP, and PA_PJM_REQ_COMMITMENTS_TMP. Output headers are written to PA_PROJECT_ACCUM_HEADERS, with intermediate staging in PA_PROJ_REFRESH_TMP and PA_PROJ_SUMM_TMP.

Usage Notes

PA_PROJ_ACCUM_MAIN is invoked primarily by Oracle Projects concurrent programs that execute periodic accumulation and summarization runs, and it is referenced by eighteen other packages across the module. It is not intended as a public integration API; custom code should call supported Project APIs rather than this package directly, given its reliance on global state and header locking.