Search Results delete_adjustments




Overview

APPS.OE_ORDER_CLOSE_UTIL is a utility package in Oracle E-Business Suite Order Management (OE) whose responsibility is the orderly closure of sales orders and their lines, together with the housekeeping that closure requires. The package body carries the identifier OEXUCLOB.pls, and the header revision noted in the source is 120.15.12020000.3, dated January 21, 2013, indicating that the version shipped with EBS 12.1.1 remains current through the 12.2.2 code line. In 12.2.2 the object is classified in ETRM as a UTIL package owned by APPS and naming the procedures CLOSE_ORDER and CLOSE_LINE as the documented entry points.

The practical business purpose is to remove an order from the open-order population once fulfilment and billing activity have completed, while simultaneously purging the residual pricing artefacts that closure leaves behind. The most frequently referenced internal routine in this context is DELETE_ADJUSTMENTS, which is documented in the package body as the procedure that "purges the unapplied adjustments from oe table." Unapplied price adjustments attached to closed orders and lines serve no further purpose and, if left in place, inflate the volume of the pricing tables and complicate subsequent reporting and repricing.

Key Procedures and Functions

  • CLOSE_ORDER — the order-level closure routine. It sets the order header into a closed state and drives the associated cleanup, including the removal of unapplied adjustments belonging to the header.
  • CLOSE_LINE — the line-level counterpart, used when individual lines are closed rather than the whole order. It performs the equivalent cleanup scoped to a single line.
  • DELETE_ADJUSTMENTS — an internal cleanup routine exposed in the package body. It deletes rows from OE_PRICE_ADJUSTMENTS that are not applied, are not automatic, are not of list line type TAX, and are not tied to a retrobill request, for a given header or line.

The cursors behind DELETE_ADJUSTMENTS embody two significant pieces of maintenance history. Bug 4099565 added the retrobill_request_id IS NULL predicate so that closure does not remove the manual modifier record corresponding to the latest price on retrobill lines. Bug 2516895 added a NOT EXISTS test against OE_PRICE_ADJ_ASSOCS so that unapplied Price Break child line adjustments are spared deletion. The procedure is guarded by the standard OE debug facility, emitting "ENTERING DELETE_ADJUSTMENTS" when oe_debug_pub.g_debug_level is greater than zero.

Tables Accessed

  • OE_ORDER_HEADERS and OE_ORDER_LINES_ALL / OE_ORDER_LINES — the order and line records whose closure status is read and updated.
  • OE_PRICE_ADJUSTMENTS — read to identify unapplied adjustment rows and the target of the DELETE performed by DELETE_ADJUSTMENTS.
  • OE_PRICE_ADJ_ASSOCS — consulted through a NOT EXISTS subquery to protect Price Break child adjustments from deletion.
  • OE_PRICE_ADJ_ATTRIBS — adjustment attribute detail associated with the pricing adjustment records.
  • OE_XML_MESSAGE_SEQ_S — the sequence supporting XML message identification generated during closure processing.
  • DUAL — used for singleton arithmetic and control checks.

Usage Notes

OE_ORDER_CLOSE_UTIL is not intended for direct end-user invocation. It is called from Order Management order and line closure flows, notably the closing actions available from the Sales Orders window and the Order Organizer, and from the concurrent processes that perform batch closure. Because it is a dependent utility, it is referenced by one other package within the EBS code base; customisations that override or wrap closure logic must account for that dependency.

Custom code should call CLOSE_ORDER and CLOSE_LINE only after confirming that the order or line has reached a genuinely closable state, since the adjustment purge cannot be undone. Developers investigating the delete_adjustments behaviour should note that rows qualifying for deletion are narrowly defined, and that retrobill adjustments and Price Break child associations are deliberately excluded from the purge.