Search Results pa_sweeper




Overview

PA_SWEEPER is an Oracle Projects (PA) database package owned by the APPS schema that supports budgetary control and period-based balance calculation for projects and tasks. Its principal responsibility is to resolve the correct start and end dates for budgetary control balances based on the time phase code (TPC) configured for a project, and to maintain the actual and encumbrance balance records that Oracle Projects uses for funds checking and budget validation.

The package bridges the GL and PA period calendars: when the time phase code is GL, dates are derived from the GL period that the supplied GL date falls within; when the time phase code is PA, dates are derived from the corresponding PA period; and when the time phase code is 'N' (not period-based), the start and end dates are read directly from the existing pa_bc_balances rows. This date resolution logic is central to ensuring that commitment and actual balances are grouped into the correct budgetary control buckets.

Key Procedures and Functions

The package exposes three documented program units:

  • GetBCBalStartDate — A function that returns the start date of the budgetary control balance period for a given project, expenditure item date, budget version, set of books, organization, task, top task, RLMI, GL date and PA date. The returned value depends on the time phase code passed in, following the GL, PA or 'N' logic described above.
  • GetBCBalEndDate — A function that returns the corresponding end date for the same budgetary control balance period, using the same time phase code rules and the same set of identifying parameters. Together with GetBCBalStartDate it defines the date window within which balances are measured.
  • update_act_enc_balance — A procedure, identified in the source header as the target of the search term "update_act_enc_balance," that updates actual and encumbrance balances. It returns a return status and an error message code through OUT parameters and accepts a project identifier as an optional input (defaulting to NULL). This procedure is the entry point invoked when project balances must be refreshed or recalculated.

Tables Accessed

PA_SWEEPER references a set of APPS synonyms spanning both Projects and General Ledger schemas:

  • PA_BC_BALANCES — the budgetary control balance table that stores actual and encumbrance balances by project, task, budget version and RLMI; it is both read (for date resolution when TPC = 'N') and written by update_act_enc_balance.
  • PA_BC_COMMITMENTS_ALL / PA_BC_COMMITMENTS_S — commitment balance records used in the encumbrance side of the update.
  • PA_BC_PACKETS / PA_BC_PACKETS_HIST — budgetary control packet and history tables that track balance processing runs.
  • PA_BUDGET_VERSIONS / PA_BUDGET_ENTRY_METHODS — budget version and entry method definitions used to identify the correct budget version for balance updates.
  • PA_PERIODS_ALL / GL_PERIOD_STATUSES — period definitions from the Projects and General Ledger calendars, used to resolve start and end dates by time phase code.
  • PA_PROJECTS_ALL — project master information supplying project attributes such as time phase code.
  • XLA_EVENTS — Subledger Accounting events associated with project transactions.
  • DUAL, PLITBLM, V$SESSION — utility references; PLITBLM is the standard PL/SQL index-by table type definition, and V$SESSION may be used for session-level context in concurrent processing.

Usage Notes

PA_SWEEPER is an internal Oracle Projects utility rather than a public integration API. It is referenced by three other packages and is typically invoked indirectly from budgetary control and funds-checking flows, concurrent programs that sweep or refresh actual and encumbrance balances, and Oracle Projects forms that trigger balance recalculation for a project.

Because the update procedure returns a status and error message code, calling code is expected to interrogate x_return_status and x_error_message_code and handle failures accordingly. The optional project identifier allows either a single-project update or, when omitted, a broader sweep. Customizations should call PA_SWEEPER only through its declared interface, avoid direct DML against pa_bc_balances, and be aware that behavior is governed by the project's time phase code and the underlying GL and PA period calendars.