Search Results arp_cma_pkg




Overview

ARP_CMA_PKG is a PL/SQL package owned by the APPS schema in Oracle E-Business Suite Receivables (AR). It encapsulates the low-level data access logic for the AR_CREDIT_MEMO_AMOUNTS entity, which stores the individual amount lines that make up a credit memo or on-account credit transaction. The package is declared with AUTHID CURRENT_USER, meaning its SQL statements execute with the privileges of the calling session rather than the definer, so callers must themselves hold the necessary object privileges on the referenced tables. Its header revision ($Header: ARTICMAS.pls 115.5) traces to 2003, indicating it is a long-standing, stable component of the Receivables transaction data model rather than a public, versioned API. The ETRM classification for this object is OTHER, which signals that it is an internal implementation package rather than a formally supported public API. It is referenced by three other packages, placing it in the internal dependency chain that supports credit memo creation, maintenance, and deletion.

Key Procedures and Functions

The package exposes twelve documented procedures that fall into four functional groups.

  • Initialization: SET_TO_DUMMY accepts an OUT record of type ar_credit_memo_amounts%rowtype and returns an empty or placeholder record. Callers use it to initialize the row type before a fetch or before populating fields programmatically, which is important because %rowtype records carry NOT NULL constraints that must be satisfied before assignment.
  • Fetch and lock: FETCH_P retrieves a credit memo amount row by credit_memo_amount_id. LOCK_FETCH_P combines retrieval with a lock for update, and LOCK_COMPARE_P validates that a previously fetched record still matches the current database row. LOCK_P acquires a lock by credit_memo_amount_id, while LOCK_F_CTL_ID locks by customer_trx_line_id, supporting the alternate access path through the transaction line.
  • DML operations: INSERT_P populates a new credit memo amount row and returns the generated credit_memo_amount_id. UPDATE_P modifies an existing row identified by credit_memo_amount_id, and UPDATE_F_CTL_ID performs the update using the customer_trx_line_id as the key. DELETE_P removes a row by credit_memo_amount_id. DELETE_F_CTL_ID deletes by customer_trx_line_id, and DELETE_F_CT_ID deletes all credit memo amount rows associated with a given customer_trx_id.

Tables Accessed

The package operates primarily on AR_CREDIT_MEMO_AMOUNTS via the APPS synonym, together with its intersection and alternate-key views AR_CREDIT_MEMO_AMOUNTS_S. It also references RA_CUSTOMER_TRX, the header table for Receivables transactions, and RA_CUSTOMER_TRX_LINES, the line table. The foreign-key style procedures (LOCK_F_CTL_ID, UPDATE_F_CTL_ID, DELETE_F_CTL_ID, DELETE_F_CT_ID) exist because credit memo amounts can be addressed either by their own primary key or through the parent transaction and line identifiers. DUAL and DBMS_SQL appear in the metadata, the latter typically for dynamic SQL used in lock or comparison checks.

Usage Notes

ARP_CMA_PKG is an internal package. It is not intended to be called directly from customer extensions; Oracle's supported integration points for credit memo processing are the Receivables public APIs such as AR_CREDIT_MEMO_API. The package is invoked by Receivables forms and by other internal packages during credit memo entry, adjustment, and deletion, which explains the three dependent packages recorded in the metadata. Developers investigating the "set_to_dummy" search term should understand that SET_TO_DUMMY is a record-initialization helper used immediately before FETCH_P or before INSERT_P in internal calling code, not a business function. Because the package runs AUTHID CURRENT_USER and its signature is not guaranteed across patches, custom code should not bind to it; any direct invocation risks breakage on upgrade and bypasses the validation and accounting logic enforced by the public API layer.