Previous  Next          Contents  Index  Glossary  Library

Writing Transaction Cost Extensions

Cost Management provides a template package and function that you use as the basis of your transaction cost extension functions. The name of the package is CSTPACHK.

Print out and review the following files before you begin writing transaction costing extensions. The files are located in the Cost Management admin/sql directory.

CSTACHKS.pls Transaction Cost Extension Package Specification Template. If you create functions within the package, outside the predefined function, you must also modify this package.
CSTACHKB.pls Transaction Cost Extension Package Body Template. This file contains the function that you modify to implement transaction cost extensions. You can define as many functions as you like within this package or within the predefined function.

Suggestion: After you write the function, do not forget to compile it and store it in the database. See: Storing Your functions.

Package Function

actual_cost_hook

Table 3 - 6 lists the parameters for Transaction Cost type extensions.

Parameter Usage Type Description
i_org_id IN NUMBER The organization that the current transaction is done in
i_txn_id IN NUMBER Transaction identifier
i_layer_id IN NUMBER The costing layer this transaction item corresponds to. Using the layer_id, one can obtain the current average cost stored in cst_quantity_layers
i_cost_type IN NUMBER The valuation cost type the cost processor is running for.
i_user_id IN NUMBER User identifier
i_login_id IN NUMBER Login identifier
i_req_id IN NUMBER Request ID for program
i_prg_appl_id IN NUMBER Application ID of program
i_prg_id IN NUMBER Program identifier
l_err_num OUT NUMBER Error number
l_err_code OUT NUMBER Error code
l_err_msg OUT VARCHAR2 Error message

Error Handling

l_err_num This parameter indicates the processing status of your extension as follows:

l_err_num = 0 The extension executed successfully.
l_err_num <> 0 An error occurred and the extension did not process successfully.
l_err_code and l_err_msg Values for error_code, l_err_code, and error_explanation, l_err_msg, are stored in the MTL_MATERIAL_TRANSACTIONS table.

See Also

Client Extensions

Transaction Cost Extension

Client Extensions

Oracle Cost Management Technical Reference Manual, Release 11


         Previous  Next          Contents  Index  Glossary  Library