Search Results get_last_available_date




Overview

CTO_WORKBENCH_UTIL_PK is a utility PL/SQL package in the APPS schema that supports the Oracle E-Business Suite Configure-to-Order (CTO) workbench and change order functionality. Its role is to provide low-level helper logic used when displaying, validating, and resolving configuration data associated with "to order" items — items that carry configuration rules, option classes, and dependent assemblies. The package is classified as an OTHER API, meaning it is not a published public interface but an internal supporting utility invoked by other CTO components.

In practice, the package supplies the CTO workbench and the CTO change order process with reusable accessors for information that the user interface and business logic require: order line numbers, line status, supply type, configuration line identifiers, item names and descriptions, source document identifiers, unit of measure conversion, buyer information, workbench item type, reserved quantities, and last available dates. It exists to keep these lookups and conversions consistent across the CTO feature set rather than duplicating SQL in each calling form or package. The dependency metadata shows that APPS.CTO_CHANGE_ORDER_PK references CTO_WORKBENCH_UTIL_PK, confirming that it is a shared utility layer consumed by higher-level CTO processing. The package itself depends only on SYS.STANDARD and the PL/SQL runtime environment, which indicates that its table access is performed through dynamic or indirect means or is isolated in the package body.

Key Procedures and Functions

The documented interface exposes fifteen procedures and functions. Their purposes, based on naming and CTO domain context, are as follows.

  • GET_LINE_NUMBER — returns the order line number for a given context within the CTO workbench.
  • GET_LINE_STATUS — retrieves the current status of a configuration or order line.
  • GET_SUPPLY_TYPE — identifies the supply type associated with a configuration line, distinguishing internal versus drop-ship or external supply.
  • GET_CONFIG_LINE_ID — returns the configuration line identifier used to relate option selections to a parent configured item.
  • GET_ITEM_NAME — fetches the item name (typically the concatenated flexfield value) for display or validation.
  • GET_ITEM_DESC — fetches the item description, resolving the appropriate language row.
  • GET_SOURCE_DOCUMENT_ID — returns the identifier of the source document that generated a demand or supply line.
  • CONVERT_UOM — performs unit of measure conversion between the item's primary UOM and the transaction UOM.
  • GET_BUYER_NAME — returns the buyer name associated with a purchasing document line.
  • GET_WORKBENCH_ITEM_TYPE — determines the item type classification used by the workbench display logic.
  • GET_RSVD_ON_HAND_QTY — returns the quantity reserved against on-hand inventory for the line.
  • GET_LAST_AVAILABLE_DATE — returns the last date on which supply is expected to be available.
  • GET_RSVD_INRCV_QTY — returns the quantity reserved against incoming receipts.
  • FIND_CONFIG_LINE_AND_LEVEL — locates a configuration line and its level within the configuration hierarchy.
  • GET_ORDER_LINE_NUMBER — returns the order line number from a sales order context.

Tables Accessed

The package reads and, where applicable, writes the following tables through APPS synonyms. Order and configuration data come from OE_ORDER_HEADERS_ALL and OE_ORDER_LINES_ALL, which define the sales order and its lines. OE_DROP_SHIP_SOURCES supports drop-ship supply determination, aligning with GET_SUPPLY_TYPE. Purchasing and receiving data come from PO_LINE_LOCATIONS_ALL, PO_REQUISITION_LINES_ALL, RCV_SHIPMENT_HEADERS, and RCV_SHIPMENT_LINES, which underpin source document identification and in-transit receipt quantities used by GET_SOURCE_DOCUMENT_ID and GET_RSVD_INRCV_QTY. Manufacturing context is supplied by WIP_DISCRETE_JOBS and WIP_FLOW_SCHEDULES for work order and flow schedule references. Inventory reservation data is read from MTL_RESERVATIONS to compute reserved on-hand quantities. Item display values are resolved from MTL_SYSTEM_ITEMS_KFV and MTL_SYSTEM_ITEMS_TL, providing the concatenated item key and translated descriptions.

Usage Notes

CTO_WORKBENCH_UTIL_PK is an internal utility rather than a callable public API. It is invoked primarily by the CTO workbench user interface and by CTO_CHANGE_ORDER_PK during change order processing. Customizations that extend or replace CTO workbench behavior may call these functions to obtain consistent line, item, and reservation values; however, because no parameter lists are documented in the ETRM metadata, integrators must inspect the package specification in the target instance before depending on any signature. The package is marked VALID in both 12.1.1 and 12.2.2, and its dependence on SYS.STANDARD alone suggests that direct table SQL resides in the body. Standard Oracle support policy applies: modification of the package body invalidates support, and any wrapper or extension should be created in a custom schema with the APPS synonym referenced read-only.