Search Results oks_k_headers




Overview

OKS_CHANGE_STATUS_PVT is a private PL/SQL package body in the Oracle E-Business Suite Service Contracts (OKS) module. Its principal business function is the controlled modification of contract and subscription status. It provides the internal logic that moves a contract header, its lines, and sub-lines from one lifecycle status to another — for example activating, terminating, or cancelling a service agreement — while keeping dependent records consistent. Because the package is classified as PVT, it is not intended as a public integration API; it is invoked by other OKS packages and by the public wrapper layers that expose status change to forms and concurrent processes. The header comment confirms its purpose: it "accepts contract_id and the new_sts_code and changes the status of the Contract, the lines and sub-lines," and for cancellation, the amount on both header and lines is adjusted to reflect the cancel action. The source for a cancellation (MANUAL versus IBTRANSFER) is passed in as a parameter.

The package depends on the FND_API framework for message handling and return status, using standard constants such as G_FALSE, G_TRUE, and G_API_VERSION. It also declares a Resource Busy exception (ORA-00054) to handle row-lock contention, an important consideration when concurrent programs and forms attempt status changes on the same contract.

Key Procedures and Functions

The metadata documents sixteen procedures and functions:

Tables Accessed

The package reads and writes the OKS and OKC contract tables through APPS synonyms. OKS_K_HEADERS_B and OKS_K_LINES_B are the primary Service Contracts header and line tables updated during a status change. OKC_K_HEADERS_ALL_B and OKC_K_HEADERS_B hold the corresponding Core Contracts header data, while OKC_K_LINES_B stores contract lines. OKC_K_VERS_NUMBERS tracks versioning of contracts. OKC_STATUSES_B supplies the valid status definitions. OKC_CLASS_OPERATIONS, OKC_OPERATION_INSTANCES, and OKC_OPERATION_LINES support the operation/action model that governs permitted transitions. DUAL is used for single-row lookups, and PLITBLM supports PL/SQL table population.

Usage Notes

OKS_CHANGE_STATUS_PVT is referenced by six other packages and is not called directly by end users. It is normally invoked from the Service Contracts forms when a user activates, terminates, or cancels an agreement, and from concurrent programs performing bulk status maintenance. Custom code should avoid calling this private package directly; instead, customizations should use the supported public OKS API layer that in turn delegates to OKS_CHANGE_STATUS_PVT. The presence of the Resource Busy exception means callers should be prepared for lock contention on the header row during concurrent status changes, and should handle the standard FND_API return status and message stack.