Cost Management provides a template package and functions as a basis for account generation type extensions. The name of the template package is CSTPSCHK.
Print the following files before you begin writing Account Generation type extensions. The files are located in the Cost Management plsql/115/sql directory.
CSTSCHKS.pls - Account Generation Type Extension Package Specification Template. If you create functions outside the predefined function within the CSTPSCHK package, you must also modify this file to include those new functions.
CSTSCHKB.pls - Account Generation Type Extension Package Body Template. This file contains the function that you can modify to implement the Ac-count 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/Procedures.
You can use this function for either material or scrap transactions.
std_get_account_id
The following table lists the parameters for Account Generation type extensions that provide alternate material transaction accounts in standard 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 |
| i_exp | IN | NUMBER | Expense or asset account indicator |
| i_snd_rcv_org | IN | NUMBER | Sending or receiving organization indicator |
| i_txn_type_id | IN | NUMBER | Transaction type identifier |
| i_txn_act_id | IN | NUMBER | Transaction action identifier |
| i_txn_src_type_id | IN | NUMBER | Transaction source type identifier |
| i_item_id | IN | NUMBER | Item identifier |
| i_cg_id | IN | NUMBER | Cost group identifier |
| o_err_code | OUT | VARCHAR2 | Output error code. Can be any SQL code. |
| o_err_num | OUT | NUMBER | Output error number |
| o_err_msg | OUT | VARCHAR2 | Error message |
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 Indicator
The valid values of i_exp are:
i_exp = 0 - Expense item transaction.
i_exp = 1 - Asset item transaction.
Sending/Receiving Organization
The valid values of i_snd_rcvg_org are:
i_snd_rcvg_org = 1 - The organization (i_org_id) is a sending orga-nization for inter - organization transactions.
i_snd_rcvg_org = 2 - The organization (i_org_id) is a receiving or-ganization for inter - organization transactions.
o_err_num
This parameter indicates the processing status of your extension as follows:
o_err_num = 0 - The extension executed successfully.
o_err_num <> 0 - An error condition has occurred and the ex-tension did not process successfully.
o_err_code and o_err_msg
Values for error_code, o_err_code, and error_explanation, o_err_msg, are stored in the MTL_MATERIAL_TRANSACTIONS table.
std_get_update_acct_id
The following table lists the parameters for Account Generation type extensions that provide alternate cost update accounts in standard costing organizations.
| Parameter | Usage | Type | Description |
|---|---|---|---|
| i_org_id | IN | NUMBER | The organization that the cost distributor is running in |
| i_update_id | IN | NUMBER | Cost update session identifier |
| i_debit_credit | IN | NUMBER | Type of transaction, debit or credit |
| i_cost_element_id | IN | NUMBER | Cost element identifier |
| i_acct_line_type | IN | NUMBER | The accounting line type |
| i_resource_id | IN | NUMBER | Resource identifier |
| i_subinv | IN | VARCHAR2 | Subinventory identifier |
| i_exp | IN | NUMBER | Expense or asset account indicator |
| i_snd_rcv_org | IN | NUMBER | Sending or receiving organization indicator |
| o_err_code | OUT | VARCHAR2 | Output error code. Can be any SQL code. |
| o_err_num | OUT | NUMBER | Output error number |
| o_err_msg | OUT | VARCHAR2 | Error message |
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 i_exp are:
i_exp = 0 - The transaction is an asset transaction.
i_exp <> 0 - The transaction is an expense transaction.
o_err_num
This parameter indicates the processing status of your extension as follows:
o_err_num = 0 - The extension executed successfully.
o_err_num <> 0 - An error condition has occurred and the ex-tension did not process successfully.
o_err_code and o_err_msg
Values for error_code, o_err_code, and error_explanation, o_err_msg, are stored in the MTL_MATERIAL_TRANSACTIONS table.
std_get_update_scrap_acct_id
This routine lets you select the account to be used for posting scrap adjustments in the standard cost update process for standard lot based jobs.
| Parameter | Usage | Type | Description |
|---|---|---|---|
| i_org_id | IN | NUMBER | The organization that the cost distributor is running in |
| i_cost_update_id | IN | NUMBER | Cost update session identifier |
| I_WIP_ENTITY_ID | IN | NUMBER | wip_entity_id of the work order |
| I_DEPT_ID | IN | NUMBER | department_id of the department that runs the operation |
| I_OPERATION_SEQ_NUM | IN | NUMBER | operation sequence number of the operation |
When this extension is called, the application determines if it has been implemented and returns a value accordingly. The return values are:
-1 The extension was not used. Hence use the normal department scrap account
<>-1 use this return value as the scrap adjustment account
std_get_est_scrap_rev_acct_id
This routine lets you select the account to be used for posting estimated scrap reversal in the operation yield processor for scrap transactions.
| Parameter | Usage | Type | Description |
|---|---|---|---|
| i_org_id | IN | NUMBER | The organization that the cost distributor is running in |
| I_WIP_ENTITY_ID | IN | NUMBER | wip_entity_id of the work order |
| I_OPERATION_SEQ_NUM | IN | NUMBER | operation sequence number of the operation |
When this extension is called, the application determines if it has been implemented and returns a value accordingly. The return values are:
-1 The extension was not used. The default scrap account of current operation will be used.
<>-1 use this return value to be charged for scrap reversal transaction
Other Sources
Oracle Bills of Material Technical Reference Manual, Release 12