Search Results test_build_doc_ins_audit_sql
Overview
ARP_MAINTAIN_PS is an Oracle Receivables server-side PL/SQL package owned by the APPS schema. It provides the application logic that supports the Maintain Payment Schedules functionality within Oracle E-Business Suite Release 12.1.1 and 12.2.2. The package is declared with AUTHID CURRENT_USER, meaning that its database objects are resolved using the privileges of the invoking user rather than the definer, which is consistent with the standard Oracle EBS approach for packages that participate in the Receivables transaction and adjustment flows.
Its primary responsibility is to create, modify, and delete rows in the AR_PAYMENT_SCHEDULES table for a given customer transaction, handling the associated adjustment, distribution, and audit-trail side effects. Because payment schedules represent the receivable balances and installment structure of a transaction, the package is central to credit memo, debit memo, adjustment, and reversal processing. The header comment identifies g_error_buffer as a global error buffer, and the package raises App_exception for fatal errors while also populating that buffer, so callers can retrieve diagnostic text after a failure.
Key Procedures and Functions
ETRM documents six procedures and functions in the package:
- MAINTAIN_PAYMENT_SCHEDULES — The main server-side entry point for Maintain Payment Schedules. It accepts a mode of Insert, Delete, or Update, a customer transaction identifier, and an optional payment schedule identifier, along with the new line, tax, freight, and charge amounts for credit memo processing. It also accepts an in/out applied commitment amount and an optional reversed cash receipt identifier used for debit memo reversals. It drives document combination, adjustment, and audit processing.
- TEST_BUILD_DOC_COMBO_SQL — A diagnostic routine used to construct and validate the SQL that selects document combination values. It is the routine associated with the user's search term context, paralleling the audit SQL test routines below.
- TEST_BUILD_DOC_UPDATE_ADJ_SQL — A diagnostic routine that builds the SQL used when an adjustment document number must be updated.
- TEST_BUILD_DOC_INS_AUDIT_SQL — The routine referenced by the search "test_build_doc_ins_audit_sql". It builds the SQL used to insert the document audit record, allowing developers to inspect or test the generated statement in isolation.
- TEST_UPDATE_ADJ_DOC_NUMBER — A test/diagnostic procedure that exercises the update of an adjustment document number, verifying that the corresponding SQL behaves as expected.
- INIT — An initialization routine that prepares package-level state, such as opening the public cursors declared at the top of the specification (document combination select, adjustment update, and audit insert).
Tables Accessed
The package operates across the core Receivables and Subledger Accounting tables, resolved through APPS synonyms:
- AR_PAYMENT_SCHEDULES — the primary target, holding the receivable installments and balances being maintained.
- AR_ADJUSTMENTS and AR_ADJUSTMENTS_S — adjustment records and their sequence, with AR_ADJUSTMENT_NUMBER_S supplying adjustment document numbers.
- AR_DISTRIBUTIONS and AR_RECEIVABLE_APPLICATIONS — accounting distributions and cash/credit application linkages affected by schedule changes.
- RA_CUSTOMER_TRX, RA_CUSTOMER_TRX_LINES, and RA_CUST_TRX_TYPES — the transaction header, lines, and transaction type definitions that determine processing rules.
- AR_SYSTEM_PARAMETERS — system option values that govern numbering and accounting behavior.
- XLA_EVENTS and XLA_TRANSACTION_ENTITIES — Subledger Accounting event and entity records generated for the affected transaction.
- DBMS_SQL and DUAL — used for dynamic SQL construction in the test routines and for single-row expression evaluation.
Usage Notes
ARP_MAINTAIN_PS is not an end-user-facing API in the conventional sense; it is invoked internally by Receivables forms, concurrent programs, and other PL/SQL packages during adjustment and reversal processing. ETRM records that it is referenced by four other packages, confirming its role as a shared utility within the Receivables stack. The TEST_BUILD_* procedures and TEST_UPDATE_ADJ_DOC_NUMBER are diagnostic in nature, intended for development and support use to validate the dynamically built SQL associated with document combination, adjustment update, and audit insert operations. Custom code should avoid calling the test routines in production and should invoke MAINTAIN_PAYMENT_SCHEDULES only through supported Receivables flows, handling App_exception and inspecting g_error_buffer for error diagnostics.