Search Results changes_exist_for_draft




Overview

APPS.PO_DRAFTS_PVT is a private (PVT) PL/SQL package in Oracle E-Business Procurement that implements the change-management and draft infrastructure for purchasing documents. When a user edits a released or approved purchase order, agreement, or related document, the modification is not applied directly to the transactional tables. Instead, it is staged as a "draft," reviewed and accepted or rejected, and only then transferred to the live document. PO_DRAFTS_PVT encapsulates the core logic that supports this workflow: creating draft identifiers, assembling draft metadata, applying or discarding draft changes, and managing document-level locking so that two users do not concurrently modify the same document.

The package also defines a comprehensive set of named constants that act as the vocabulary for the draft lifecycle. The user's search term, g_status_COMPLETED, refers to the constant declared as g_status_COMPLETED CONSTANT PO_DRAFTS.status%TYPE := 'COMPLETED'. It is one of several status constants (g_status_DRAFT, g_status_IN_PROCESS, g_status_PDOI_PROCESSING, g_status_PDOI_ERROR, g_status_COMPLETED) typed against PO_DRAFTS.status, and is used throughout the code base to represent the terminal state of a draft once its changes have been successfully applied to the underlying document. Using anchored constants rather than literals ensures consistent behavior across the many callers of this package.

Key Procedures and Functions

The documented API surface contains 50 procedures and functions, including:

Tables Accessed

The package reads and writes PO_DRAFTS, the central table holding draft records and status values, and PO_HEADERS_ALL for the parent document. Change details are persisted through PO_ATTRIBUTE_VALUES, PO_ATTRIBUTE_VALUES_DRAFT, PO_ATTRIBUTE_VALUES_TLP, and PO_ATTRIBUTE_VALUES_TLP_DRAFT, with PO_DISTRIBUTIONS_ALL used for distribution-level changes. Document classification relies on PO_DOCUMENT_TYPES, while attachments and messaging use FND_ATTACHED_DOCUMENTS, FND_DOCUMENTS, FND_DOCUMENT_CATEGORIES, FND_NEW_MESSAGES, and EGO_FND_DSC_FLX_CTX_EXT. Approval and batch concerns reference PO_AME_APPROVALS_S and ICX_CAT_BATCH_JOBS.

Usage Notes

PO_DRAFTS_PVT is a private package: it is not intended for direct invocation by external custom code and is called internally by purchasing forms, the HTML/Java UI, the PDOI (Purchasing Document Open Interface) flow, and other Oracle packages. It is referenced by 38 other packages within the application. Because the draft and locking logic is tightly coupled to internal structures and constants such as g_status_COMPLETED, customizations should use supported public APIs rather than calling PO_DRAFTS_PVT directly.