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 plsql/115/sql directory.
CSTACHKS.pls - Transaction Cost Extension Package Specifica-tion 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 ex-tensions. You can define as many functions as you like within this package or within the pre-defined function.
Suggestion: After you write the function, do not forget to compile it and store it in the database. See: Storing Your functions.
actual_cost_hook
The following table lists the parameters for Transaction Cost type extensions.
| Parameter | Usage | Type | Description |
|---|---|---|---|
| i_org_id | IN | NUMBER | The organization that the cur-rent transaction is done in |
| i_txn_id | IN | NUMBER | Transaction identifier |
| i_layer_id | IN | NUMBER | The costing layer this transac-tion item corresponds to. Us-ing the layer_id, one can ob-tain 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 |
l_err_num
This parameter indicates the processing status of your extension as follows:
1_err_num = 0 - The extension executed successfully.
1_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.
Other Sources
Oracle Bills of Material Technical Reference Manual, Release 12