Search Results import_retroprice_adjustments
Overview
APPS.AP_RETRO_PRICING_PKG is a server-side PL/SQL package in Oracle Payables that supports retroactive (retro) pricing adjustments for supplier invoices. Retroactive pricing occurs when a supplier changes the price of an item after invoices have already been entered and matched against purchase orders. The package identifies the affected payables invoice lines and drives the creation of adjustment instructions that flow through the Payables Open Interface so the corrected amounts can be applied.
The package body identifies itself through a set of standard constants used for message and logging control, including G_PKG_NAME ('AP_RETRO_PRICING_PKG'), FND message-level constants, FND logging level constants, and G_MODULE_NAME ('AP.PLSQL.AP_RETRO_PRICING_PKG.'). The fetch constant G_LINES_PER_FETCH (1000) indicates that the package processes invoice lines in bulk batches rather than row by row, which is a deliberate design choice for performance when many lines are affected by a single price change. The header reference apretrob.pls 120.44 confirms this is the body of the public Payables retro pricing API.
Two private/public procedures are documented: CREATE_INSTRUCTIONS and IMPORT_RETROPRICING_ADJUSTMENTS. Together they represent a two-phase pattern — first generating instructions, then importing and applying the resulting adjustment records.
Key Procedures and Functions
- CREATE_INSTRUCTIONS — Generates the retro price adjustment instructions. According to the inline documentation in the package body, this procedure identifies PO suppliers listed in the PO view within the report parameters and populates the Payables Open Interface table with one instruction record per supplier. Each interface header record includes a source of 'PPA', the supplier ID, the user ID of the PO user, and a unique group_id used by the concurrent adjustment import process (CADIP). It is invoked with parameters including a group identifier, operating unit org ID, PO user ID, vendor ID, vendor site ID, and PO header ID, all of which scope the set of invoices that are eligible for the retro adjustment.
- IMPORT_RETROPRICING_ADJUSTMENTS — Performs the import side of the retro pricing flow. This is the procedure most often referenced in custom integrations and the one users typically search for when they need to programmatically load retro price adjustments. It consumes the instruction records created by CREATE_INSTRUCTIONS (or supplied by an external source) and applies them against the live Payables invoice tables, creating or updating invoices, distributions, and lines so the retro price delta is reflected.
Tables Accessed
- AP_PPA_INVOICES_GT, AP_PPA_INVOICE_DISTS_GT, AP_PPA_INVOICE_LINES_GT — Global temporary tables that stage the invoices, distributions, and lines identified as requiring retro adjustment.
- AP_INVOICES_INTERFACE, AP_INVOICE_LINES_INTERFACE (and their _S sequences) — Receiving tables for the Payables Open Interface, populated by CREATE_INSTRUCTIONS with source 'PPA'.
- AP_INVOICES_ALL, AP_INVOICE_DISTRIBUTIONS_ALL, AP_INVOICE_LINES_ALL — The live Payables invoice tables that IMPORT_RETROPRICING_ADJUSTMENTS reads and updates when the adjustments are applied.
- AP_BATCHES_S, FND_DOCUMENT_SEQUENCES, FND_DOC_SEQUENCE_ASSIGNMENTS — Used to obtain the next batch and invoice/document sequence numbers.
- AP_SYSTEM_PARAMETERS, AP_SYSTEM_PARAMETERS_ALL — Provide Payables setup defaults (accounting, matching, and Open Interface options) required to construct valid interface records.
Usage Notes
AP_RETRO_PRICING_PKG is typically invoked from the Retroactive Price Adjustments concurrent program in Oracle Payables, or from custom code that reproduces that flow. The standard sequence is: call CREATE_INSTRUCTIONS to seed the Open Interface tables for the target supplier and PO scope, then submit or call the Payables Open Interface Import that consumes those records, and finally call IMPORT_RETROPRICING_ADJUSTMENTS to apply the retro deltas to the invoice tables. Because the package is referenced by two other packages, custom developers should be cautious about dependencies when modifying or wrapping it. Logging and message handling is driven through FND_LOG and FND_MSG_PUB using the runtime-level constants declared in the body, so diagnostic information can be obtained by enabling FND debug logging for the AP module. Always run the procedures in the correct group_id scope and ensure the Payables accounting period is open before importing adjustments.
-
APPS.AP_RETRO_PRICING_PKG SQL Statements
12.1.1
-
PACKAGE BODY: APPS.AP_RETRO_PRICING_PKG
12.2.2
-
PACKAGE BODY: APPS.AP_RETRO_PRICING_PKG
12.1.1
-
APPS.AP_RETRO_PRICING_PKG SQL Statements
12.2.2
-
PACKAGE: APPS.AP_RETRO_PRICING_PKG
12.1.1
-
PACKAGE: APPS.AP_RETRO_PRICING_PKG
12.2.2
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_PPA_INVOICE_LINES_GT
12.1.1
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_IMPORT_INVOICES_PKG
12.2.2
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_PPA_INVOICES_GT
12.1.1
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_IMPORT_UTILITIES_PKG
12.2.2
-
APPS.AP_IMPORT_INVOICES_PKG SQL Statements
12.1.1
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_IMPORT_INVOICES_PKG
12.1.1
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_IMPORT_INVOICES_PKG
12.2.2
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_PPA_INVOICES_GT
12.2.2
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_IMPORT_UTILITIES_PKG
12.1.1
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_IMPORT_INVOICES_PKG
12.1.1
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_PPA_INVOICE_LINES_GT
12.2.2
-
APPS.AP_IMPORT_INVOICES_PKG SQL Statements
12.2.2
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_PPA_INVOICE_DISTS_GT
12.1.1
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_PPA_INVOICE_DISTS_GT
12.2.2
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_INVOICE_DISTRIBUTIONS_ALL
12.2.2
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_INVOICE_DISTRIBUTIONS_ALL
12.1.1
-
PACKAGE BODY: APPS.AP_IMPORT_INVOICES_PKG
12.1.1
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_RETRO_PRICING_PKG
12.1.1
-
APPS.AP_RETRO_PRICING_PKG dependencies on AP_RETRO_PRICING_PKG
12.2.2
-
PACKAGE BODY: APPS.AP_IMPORT_INVOICES_PKG
12.2.2
-
APPS.AP_IMPORT_INVOICES_PKG dependencies on AP_IMPORT_INVOICES_PKG
12.1.1
-
APPS.AP_IMPORT_INVOICES_PKG dependencies on AP_IMPORT_UTILITIES_PKG
12.1.1
-
APPS.AP_IMPORT_INVOICES_PKG dependencies on AP_IMPORT_UTILITIES_PKG
12.2.2
-
APPS.AP_IMPORT_INVOICES_PKG dependencies on AP_IMPORT_INVOICES_PKG
12.2.2