Previous  Next          Contents  Index  Glossary  Library

Writing Account Generation Extensions for Average Costing

Cost Management provides a template package and function for account generation type extensions. The name of the template package is CSTPACHK.

Print out the following files before you begin writing Accounting Entry type extensions. The files are located in the Cost Management admin/sql directory.

CSTACHKS.pls Accounting Generation Type Extension Package Specification Template. If you create functions outside the predefined function within the CSTPACHK package, you must also modify this file to include those new functions.
CSTACHKB.pls Accounting Generation Type Extension Package Body Template. This file contains the function that you can modify to implement the Account Generation type extension.

Suggestion: After you write the function, do not forget to compile it and store it in the database. See: Writing PL/SQL functions.

Package Function for Material Transactions

get_account_id

Table 3 - 6 lists the parameters for Account Generation type extensions that provide alternate material transaction accounts in average costing organizations.

Parameter Usage Type Description
i_org_id IN NUMBER The organization that the actual cost worker is running in
i_txn__id IN NUMBER Transaction identifier
i_debit_credit IN NUMBER Transaction type; debit or credit
i_acct_line_type IN NUMBER Accounting line type
i_cost_element_id IN NUMBER Cost element Identifier
i_resource_id IN NUMBER Resource identifier
i_subinv IN VARCHAR2 Subinventory involved (optional)
i_exp IN NUMBER Expense or asset account identifier
i_snd_rcv_org IN NUMBER Sending or receiving organization identifier
l_error_code
 
OUT VARCHAR2 Output error code. Can be any SQL code.
l_error_nun OUT NUMBER Output error number
l_error_msg OUT VARCHAR2 Error message

Additional Information About Parameters

Debit/Credit The valid values of i_debit_credit are as follows and indicate whether the traction is a debit or a credit:

i_debit_credit = 1 Indicates a debit.
i_debit_credit = -1 Indicates a credit.
Expense Account Identifier The valid values of o_error_num are:

i_exp = 0 The transaction is an asset transaction.
i_exp <> 0 The transaction is an expense transaction.
Sending/Receiving Organization The valid values of o_error_num are:

i_snd_rcvg_org = 1 The organization (i_org_id) is a sending organization.
i_snd_rcvg_org = 2 The organization (i_org_id) is a receiving organization.

Error Handling

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

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

See Also

Client Extensions

Account Generation Extension

Writing Account Generation Extensions for Standard Costing

Oracle Cost Management Technical Reference Manual, Release 11


         Previous  Next          Contents  Index  Glossary  Library