Search Results find_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:
- DRAFT_ID_NEXTVAL — Generates the next unique draft identifier for a new draft record.
- POPULATE_DRAFT_INFO — Fills the DRAFT_INFO_REC_TYPE record (draft id, header id, document type/subtype, global agreement flag, and change flags for headers, lines, line locations, distributions, org assignments, and price differences) describing the scope of a draft.
- TRANSFER_DRAFT_TO_TXN — Moves accepted draft changes into the transactional purchasing tables.
- REMOVE_DRAFT_CHANGES — Discards staged changes for a draft.
- APPLY_CHANGES — Drives application of approved changes against the document.
- FIND_DRAFT — Locates an existing draft for a given document.
- GET_REQUEST_ID — Retrieves the concurrent request identifier associated with a draft operation.
- GET_LOCK_OWNER_INFO / SET_LOCK_OWNER_INFO — Read and write lock ownership details for a document.
- UPDATE_PERMISSION_CHECK — Validates whether the current user may modify a draft.
- LOCK_DOCUMENT / UNLOCK_DOCUMENT / LOCK_DOCUMENT_WITH_VALIDATE / IS_LOCKING_APPLICABLE — Acquire, release, and conditionally validate document locks.
- IS_DRAFT_APPLICABLE — Determines whether the draft mechanism applies to a given document.
- UPDATE_DRAFT_STATUS — Sets the draft status, typically to values such as g_status_COMPLETED.
- PENDING_CHANGES_EXIST / CHANGES_EXIST_FOR_DRAFT — Test for outstanding changes on a draft.
- LOCK_MERGE_VIEW_RECORDS / IS_PENDING_BUYER_ACCEPTANCE — Support merged-view locking and buyer acceptance checks.
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.
-
PACKAGE: APPS.PO_DRAFTS_PVT
12.1.1
-
PACKAGE: APPS.PO_DRAFTS_PVT
12.2.2
-
PACKAGE BODY: APPS.PO_DRAFTS_PVT
12.1.1
-
PACKAGE BODY: APPS.PO_DRAFTS_PVT
12.2.2
-
APPS.PO_DRAFTS_PVT dependencies on DUAL
12.2.2
-
APPS.PO_DRAFTS_PVT dependencies on PO_DRAFTS_S
12.2.2
-
APPS.PO_DRAFTS_PVT dependencies on PO_DRAFTS_S
12.1.1
-
APPS.PO_DRAFTS_PVT dependencies on PO_LOG
12.1.1
-
APPS.PO_DRAFTS_PVT dependencies on PO_DRAFTS
12.1.1
-
APPS.PO_DRAFTS_PVT dependencies on PO_LOG
12.2.2
-
APPS.PO_DRAFTS_PVT dependencies on PO_DRAFTS
12.2.2
-
APPS.PO_DRAFTS_PVT dependencies on FND_API
12.2.2