Search Results get_atp_result




Overview

CZ_ATP_UTIL is a utility PL/SQL package owned by the APPS schema that supports Available-to-Promise (ATP) availability checking for configured items and order lines in Oracle E-Business Suite. It is a component of the Oracle Configurator and advanced supply chain ATP functionality, providing the integration layer between callers such as the Configurator user interface and the standard Oracle Inventory ATP engine. The package exposes a small, focused API whose purpose is to stage ATP demand records, trigger the Oracle Inventory ATP calculation, and return the resulting availability dates and quantities to the calling application.

The package is defined with AUTHID CURRENT_USER, meaning that its SQL statements execute with the privileges of the invoking user rather than the definer, which is significant because the ATP calculation routines it drives rely on the caller's Inventory operating unit context. Two global constants — G_RET_STS_SUCCESS, G_RET_STS_ERROR, and G_RET_STS_UNEXP_ERROR, with values 'S', 'E', and 'U' — define the standard return status values used across all procedures. Per the package comments, item quantities must always be supplied in the item's primary unit of measure, and, because the "read-only" Java client does not manage transactions, both INSERT_ATP_REQUEST and GET_ATP_RESULT issue commits internally.

Key Procedures and Functions

The ETRM documentation records three procedures in the package, corresponding directly to a three-step usage pattern.

  • INSERT_ATP_REQUEST — Inserts a single ATP inquiry record into the MTL_DEMAND_INTERFACE table for an item and organization, supplying the requested quantity, an optional ATP rule, and a sequence number. The p_atp_group_id parameter is an IN OUT parameter: when passed as NULL, the procedure creates a new ATP group identifier and returns it; subsequent calls may reuse that group identifier to associate multiple item lines with the same ATP check. Each call within a group must supply a distinct sequence number. This procedure must be called before RUN_ATP_CHECK, and it commits after inserting the record.
  • RUN_ATP_CHECK — Executes the ATP check for all demand interface records belonging to the ATP group identified by p_atp_group_id. It does so by submitting the standard Oracle Inventory demand interface program, INXATP, which calculates ATP dates for the staged items. It is typically called from the Configurator screen after demand rows have been inserted.
  • GET_ATP_RESULT — Retrieves the ATP results produced by the INXATP run for the given ATP group, returning availability information to the caller. This is the procedure most directly associated with the search term "get_atp_result," as it is the retrieval endpoint of the ATP check cycle. Like INSERT_ATP_REQUEST, it commits transactions because the read-only Java client does not manage transactional state.

Tables Accessed

The package operates against a small set of standard Oracle Inventory tables, referenced through APPS synonyms:

  • MTL_DEMAND_INTERFACE_S (and its interface table) — the staging table into which ATP demand records are inserted by INSERT_ATP_REQUEST and from which the INXATP program reads demand for processing.
  • MTL_ATP_RULES — holds the ATP rule definitions that determine how availability is calculated, referenced when an ATP rule identifier is supplied to the request.
  • MTL_SYSTEM_ITEMS — the item master, used to resolve and validate the inventory item being checked, including its unit of measure.
  • MTL_PARAMETERS — the organization parameters table, used to derive default ATP and planning behavior for the organization context in which the check runs.
  • DUAL — used for simple expression evaluation and sequence or constant retrieval within the PL/SQL logic.

Usage Notes

CZ_ATP_UTIL is normally invoked programmatically rather than from a concurrent program request window. The canonical call sequence is: call INSERT_ATP_REQUEST one or more times with a shared ATP group identifier (letting the first call create it), call RUN_ATP_CHECK to submit the INXATP demand interface program for that group, and then call GET_ATP_RESULT to obtain the calculated availability for the group. Callers are typically Oracle Configurator screens, the read-only Java-side ATP client referenced in the package comments, and custom PL/SQL integrations that require an availability check for configured items.

Several constraints should be observed. Quantities must be expressed in the item's primary unit of measure. Each request within an ATP group requires a unique sequence number, and the group identifier returned by the first insert must be retained and passed on subsequent calls. Because INSERT_ATP_REQUEST and GET_ATP_RESULT commit, callers must not invoke them inside a transaction that must remain atomic with surrounding DML. The package is classified as a UTIL API, referenced by zero other packages in the ETRM metadata, which indicates it is a leaf-level utility consumed directly by external callers rather than a shared dependency of the EBS codebase. In 12.1.1 and 12.2.2 the behavior is consistent, with the ETRM documentation reflecting a stable, long-standing interface.