Search Results accrue_offers




Overview

OZF_ACCRUAL_ENGINE is the core PL/SQL package within the Oracle E-Business Suite Trade Management (formerly Oracle Trade Management / OZF) module responsible for accrual processing across trade promotion and customer rebate activities. In EBS 12.1.1 and 12.2.2 it is owned by the APPS schema, is declared AUTHID CURRENT_USER, and is classified under the ETRM API classification "OTHER." Its principal business purpose is to compute, record, and post accrual amounts arising from offers, customer accrual budgets, funds utilization, and associated accounting events, and to move those accruals into Oracle General Ledger or budget tables with correct accounting treatment.

The package header (ozfacres.pls, version 120.7, last shipped 2010/12/09) exposes the GL post flag constants used throughout the utilization tables: G_GL_FLAG_YES ('Y', posted to GL successfully), G_GL_FLAG_NO ('N', awaiting GL posting), G_GL_FLAG_FAIL ('F', failed GL posting), G_GL_FLAG_NOLIAB ('X', do not post to GL — used where "Create GL for off invoice" is off for customer accrual budgets with liability disabled), and G_GL_FLAG_NULL (NULL, no GL posting for REQUEST/TRANSFER events, off-invoice utilized offers, or marketing objects where utilized, earned, and paid update simultaneously). A global G_FAE_START_DATE holds the FAE run date for multi-day Factored Accrual Engine executions (ER 8399134).

Controlling these flags is critical: checkbook and claim processing read the same Y/N/F/NULL values directly, so application code must never alter them.

Key Procedures and Functions

  • GET_MESSAGE — Collects order updates from the Order Capture Notification API. It is launched by a concurrent process and runs as an infinite loop that dequeues the latest notification from the queue, accepting exception and debug flags.
  • ADJUST_ACCRUAL — Accepts line adjustment table types (new and old) and calculates the accrual difference for an offer, tracing backwards to identify the associated fund and updating the accrued amount accordingly.
  • CALCULATE_ACCRUAL_AMOUNT — Computes the accrual amount for a given offer/fund context.
  • ACCRUE_OFFERS — Drives the accrual of eligible offers, applying the calculated amounts to fund and utilization records.
  • POST_ACCRUAL_TO_BUDGET — Posts accrual figures to the budget tables (OZF_ACT_BUDGETS family).
  • POST_ACCRUAL_TO_GL — Posts accrual accounting entries to Oracle General Ledger, setting the GL post flag on success or failure.
  • POST_RELATED_ACCRUAL_TO_GL — Handles GL posting for related accrual records tied to the primary accrual transaction.
  • PROCESS_ORDER_QUEUE — Processes queued order messages resulting from order capture notifications.
  • INCREASE_ORDER_MESSAGE_COUNTER — Maintains the order message counter used to track queue throughput.
  • EVENT_SUBSCRIPTION — Manages the business event subscription mechanism that feeds order updates into the accrual engine.

Tables Accessed

The package reads and writes the OZF trade management tables OZF_OFFERS, OZF_FUNDS_ALL_B, OZF_FUNDS_UTILIZED_ALL_B/TL, OZF_FUNDS_UTILIZED_S, OZF_ACT_BUDGETS/_S, and OZF_OBJECT_FUND_SUMMARY, which store offers, fund balances, utilization detail, and summary accrual data. Order data comes from OE_ORDER_HEADERS_ALL, OE_ORDER_LINES_ALL, and OE_PRICE_ADJUSTMENTS; customer data from HZ_CUST_ACCOUNTS, HZ_CUST_ACCT_SITES_ALL, and HZ_CUST_SITE_USES_ALL; and language lookup from FND_LANGUAGES.

Usage Notes

OZF_ACCRUAL_ENGINE is invoked primarily by concurrent programs (order queue processing and the Factored Accrual Engine run), by Oracle Trade Management forms and UI actions that recalculate offer accruals, and by custom extensions requiring programmatic accrual adjustment or GL posting. It is referenced by four other Oracle packages. Because it is AUTHID CURRENT_USER, callers must have appropriate privileges on the underlying objects.