MTL_CST_TXN_COST_DETAILS stores the cost of a transaction by element and level.
记录每一笔事务处理的成本;对于每笔库存事务的记录,这个表中有可能有记录,也有可能没记录;对于那些可以手工设定成本的事务处理,在这个表中有记录,例如,录入成本的杂项事务处理等
===Fields Relationship===
MTL_CST_TXN_COST_DETAILS.COST_ELEMENT_ID = CST_COST_ELEMENTS.COST_ELEMENT_ID
MTL_CST_TXN_COST_DETAILS.TRANSACTION_ID = MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ID
===Key Fields===
LEVEL_TYPE:this level,previous level
===Scripts===
select transaction_id txn_id, organization_id org_id, inventory_item_id item_id, cost_element_id ce,
level_type lt, transaction_cost txn_cst, value_change v_chg, new_average_cost new_avg
from mtl_cst_txn_cost_details where transaction_id = &transaction_id;
insert into mtl_cst_txn_cost_details (
transaction_id
,organization_id
,cost_element_id
,level_type
,last_update_date
,last_updated_by
,creation_date
,created_by
,last_update_login
,request_id
,program_application_id
,program_id
,program_update_date
,inventory_item_id
,transaction_cost
,new_average_cost
,percentage_change
,value_change)
select
transaction_id
,organization_id
,1
,1
,last_update_date
,last_updated_by
,creation_date
,created_by
,last_update_login
,request_id
,program_application_id
,program_id
,program_update_date
,inventory_item_id
,transaction_cost
,null
,null
,null
from mtl_material_transactions
where transaction_id in (&txn_id );