My Oracle Support Banner

When is allowed to change the ACCOUNTS of a COST GROUP (CSTFDCGA)? (Doc ID 436698.1)

Last updated on JULY 14, 2018

Applies to:

Oracle Cost Management - Version 11.5.9 to [Release 11.5]
Oracle Cost Management - Version 12.2 and later
Information in this document applies to any platform.


We have created a cost group for a project. After booking some transactions on this cost group, we found an Account was wrongly setup. Thus we need to change the wrong account
(0111111000-0111111000- General Stock Account) to (0111112000-0111112000- Project Stock Account). But Oracle does not allow us to accommodate this change right now.



The Accounts cannot be changed once the setup is done.
It's because costs and inventory quantities are maintained against a Cost Group and any accounting that happens uses the accounts defined against the cost group. Any change in Accounts for a Cost group gets defaulted to Subinventory level as well and hence could cause problems later on.

The associated accounts to a cost group cannot be changed if ANY transactions exist for the cost group. This is the intended functionality. As changing the account association will have major repercussions on the distributions that are created for the transactions in the INV Subledger and GL.

When it comes to impact on GL, Cost management reports read the current accounts from the cost group and print the information against those accounts i.e. total stock value would be reported for these accounts. If any account change is allowed, cost group will have the changed account then onwards and reports would show total stock values against these accounts. But, material distributions and GL journals would show a different picture. To avoid such discrepancies, account changes are not allowed for cost groups
once transactions are created for them.

This is not a bug but intended functionality.

As a workaround, you may Inactivate these cost groups from the Form/Application so that these cost
groups cannot be used going forward.

- Navigation Path for the Form.
- Navigator >> Cost >> Setup >> Cost Groups.
- Query for the cost groups and save them after providing the Inactive On date. This would render
these cost groups unusable henceforth.

Then you can create a new Cost group with the correct accounts and transfer the existing stocks to the new cost group.

Package CSTPCGUT (file CSTCGUTB.pls) contains procedure verify_cg_change:


Use this procedure to verify if changing the accounts of a cost group is allowed. Replaces get_cg_pending_txns.

Allow the change of accounts if the following conditions are met:

1. Cost group / org holds no quantity inside MOQ
2. Cost group / org holds no quantity inside CQL
3. No uncosted transactions for this cost group/org
4. No pending transactions for this cost group/org

Following scripts can be used to identify if transactions exist on a particular cost group/org:

SELECT organization_id, cost_group_id, count(1)
FROM mtl_onhand_quantities
WHERE cost_group_id IN ('&cost_group_id')
GROUP BY organization_id, cost_group_id;


SELECT organization_id, cost_group_id, transfer_cost_group_id, count(1)
FROM mtl_material_transactions
WHERE ((cost_group_id IN ('&cost_group_id'))
OR (transfer_cost_group_id IN ('&cost_group_id')))
GROUP BY organization_id, cost_group_id, transfer_cost_group_id;


SELECT organization_id, cost_group_id, count(1)
FROM cst_quantity_layers
WHERE cost_group_id IN ('&cost_group_id')
GROUP BY organization_id, cost_group_id;

SELECT * FROM cst_cost_group_accounts
WHERE cost_group_id IN ('&cost_group_id');

SELECT count(*)
FROM cst_cost_groups ccg
WHERE ccg.cost_group_id = '&cost_group_id'
FROM mtl_material_transactions mmt
WHERE mmt.organization_id = '&org_id'
AND mmt.transaction_date >= ccg.creation_date
AND mmt.cost_group_id = '&cost_group_id'
AND rownum = 1
FROM mtl_material_transactions mmt
WHERE mmt.transfer_organization_id = '&org_id'
AND mmt.transaction_date >= ccg.creation_date
AND mmt.transfer_cost_group_id = '&cost_group_id'
AND mmt.transaction_action_id in (2,3,5,6,12,21,27)
AND rownum = 1
) );

FROM mtl_material_transactions_temp
( organization_id = '&org_id'
AND cost_group_id = '&cost_group_id'
( transfer_organization = '&org_id'
AND transfer_cost_group_id = '&cost_group_id'
AND rownum = 1;


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.