Search Results get_account_id




Overview

APPS.CSTPAPHK is a lightweight PL/SQL hook package that belongs to the Oracle E-Business Suite Cost Management (CST) module. Its single stated purpose, as documented in the package header comment, is to provide a cover routine that allows implementers to determine the accounting flexfield combination to which an inventory transaction is posted. In the standard Cost Management posting flow, the Cost Processor (such as the periodic costing and receipt accounting programs) must assign a distribution account to each transaction line. Oracle ships a default account derivation, but customers sometimes require a different account based on attributes of the transaction — for example, a specific subinventory, cost element, resource, or legal entity. CSTPAPHK exists as the designated extension point where that decision can be injected without modifying Oracle-owned posting code.

The package body carries the RCS header identifier $Header: CSTAPHKB.pls 115.3 2002/11/08 02:34:46 awwang ship $, indicating that the shipped body has been stable since release 11.5.3. The same stub is retained in Oracle EBS 12.1.1 and 12.2.2 under the APPS schema. Because the body is deliberately empty of business logic, its behaviour in a stock installation is purely to signal "use the standard account" and to return cleanly without raising an error.

Key Procedures and Functions

The ETRM metadata documents a single procedure entry for this package:

  • GET_ACCOUNT_ID — The only routine defined in the package body. Its documented return-value contract is: an integer greater than zero indicates the user-selected account number (that is, an CODE_COMBINATION_ID chosen by the implementer), while a return of -1 instructs the caller to use the default account for the distribution. As shipped, the body initialises the three OUT error parameters to null defaults and unconditionally returns -1, so the standard default account is always used. An exception handler traps WHEN OTHERS, populates the error OUT parameters with the SQL error code and a message prefixed CSTPAPHK.GET_ACCOUNT_ID: (truncated with SUBSTRB to 150 characters), and still returns -1 so that posting can continue. This fail-safe design means that a defect in customer extensions can never abort the posting run.

Tables Accessed

The documented metadata for CSTPAPHK lists no tables referenced through APPS synonyms. This is consistent with the shipped body, which performs no SQL at all: it only assigns the OUT parameters and returns a constant. Any table access would be introduced solely by a customer's customised version of the routine. The package therefore imposes no I/O cost and no locking behaviour on the posting process, and it cannot be the source of a table-level performance issue in the Cost Management flow.

Usage Notes

CSTPAPHK is not invoked directly by end users or by concurrent program parameters. It is called internally by the Cost Management posting engine — the metadata records that it is referenced by two other packages — at the point where a distribution account must be determined for an inventory transaction. Typical callers are the cost processor and related accounting packages in the CST schema family.

Implementers who need non-standard account derivation customise the body of GET_ACCOUNT_ID in a customer-owned layer (for example via a customised copy or a wrapper strategy supported by the EBS extension guidelines), returning a valid CODE_COMBINATION_ID for the cases of interest and -1 for all others. Care should be taken in 12.2.2 Online Patching environments: direct edits to Oracle-shipped APPS code are not supported, and changes must be delivered through the standard patching and customisation mechanisms. All error signalling must flow through the documented OUT parameters rather than raising exceptions, since the packaged exception handler swallows errors and the routine is designed never to fail the posting run.