Search Results copydoc_sql_error




Overview

APPS.PO_COPYDOC_SUB is a private PL/SQL package body in the Oracle Purchasing module that supports the document copy and submission check logic used when creating new purchasing documents from existing ones. Its primary responsibility is to assemble the data required to validate whether a purchasing document—typically a blanket purchase agreement (BPA), quotation, or standard purchase order—is eligible to be copied, submitted, or re-approved. The package encapsulates cursor definitions and private helper routines that traverse the PO_HEADERS, PO_LINES, PO_LINE_LOCATIONS, and PO_DISTRIBUTIONS hierarchy, gathering line, shipment, and distribution attributes for the copy operation.

The source header ($Header: POXCPSUB.pls 120.15.12020000.5 2013/05/30) confirms that this package is delivered as a standard Oracle Purchasing file and has been maintained across multiple releases, including the 12.1.1 and 12.2.2 code lines. Its internal cursors reflect historical bug fixes—notably Bug# 3528563, which ensures that validation of blankets excludes releases by filtering shipment_type NOT IN ('BLANKET','SCHEDULED'). This is critical because blankets and their releases share po_line_id values in PO_LINES_ALL, and incorrect filtering previously caused rejected BPAs to fail re-approval.

Key Procedures and Functions

The ETRM metadata documents a single public procedure:

  • SUBMISSION_CHECK_COPYDOC — Performs the eligibility and submission check invoked during the copy-document workflow. It determines whether the source document can be duplicated or resubmitted, and drives the validation logic against the cursors and helper routines defined in the package body. No parameter list is documented in the metadata; its signature should be confirmed from the deployed package specification before invocation from custom code.

The package body also contains private helpers. get_fsp_values populates default ship-to location, bill-to location, ship-via, and FOB lookup values from Financials system parameters. Three principal cursors—po_line_cursor, po_shipment_cursor, and po_distribution_cursor—iterate the document structure, while pa_distribution_cursor was added to handle encumbered BPA distributions (distribution_type = 'AGREEMENT').

Tables Accessed

The package reads and references the following documented tables through APPS synonyms:

Usage Notes

PO_COPYDOC_SUB is an internal supporting package rather than a published API. It is invoked indirectly by the Oracle Purchasing copy-document forms and by the submission check logic used when re-approving or duplicating blanket agreements and purchase orders. The metadata indicates the package is classified as OTHER and is referenced by one other package, which suggests it is called from a parent copy or submission routing package rather than directly from forms or concurrent programs. Customizations should avoid invoking internal procedures directly; instead, they should call the documented entry point SUBMISSION_CHECK_COPYDOC only when reproducing standard copy behavior, and should never modify this seeded package body, as patches (such as the 120.15.12020000.5 revision) may overwrite changes. For reference-report requirements, note that the package name does not correspond to an "online_report" object; any such search likely reflects an unrelated concurrent program or RTF template.