|
原帖由 robincao 于 2006-11-15 09:46 发表 ![]()
--1.select cost error
select
m.transaction_id ,
m.transfer_organization_id,
m.organization_id,
msib.segment1 item,
mtt.transaction_type_name,
to_char(m.transaction_date,'yyyy-mm-dd') 事务日期,
m.transaction_reference,
m.transaction_id ,
m.subinventory_code,
m.costed_flag,
m.cost_group_id,
m.cost_category_id,
m.cost_update_id,
m.error_code,
m.error_explanation,
m.transaction_group_id
--m.transaction_type_id,
--m.transaction_source_name,
--m.*
from
MTL_MATERIAL_TRANSACTIONS M,
MTL_TRANSACTION_TYPES MTT,
mtl_system_items_b msib
where
to_char(m.transaction_date,'yyyymm')='200609'
and m.costed_flag='E'
--and m.error_code='No Error in CSTPSISC.ins_std_cost.'
--and m.subinventory_code='201_RMH'
and M.TRANSACTION_TYPE_ID = MTT.TRANSACTION_TYPE_ID
and msib.inventory_item_id=m.inventory_item_id
and msib.organization_id=m.organization_id
--and m.transfer_organization_id is null
--and m.transaction_id='10928181'
order by
mtt.transaction_type_name,
to_char(m.transaction_date,'yyyy-mm-dd'),
m.subinventory_code
--2.select cost no
--no
select
m.transaction_id
,
m.transfer_organization_id,
m.organization_id,
msib.segment1 item,
mtt.transaction_type_name,
to_char(m.transaction_date,'yyyy-mm-dd') 事务日期,
m.transaction_reference,
m.transaction_id ,
m.subinventory_code,
m.costed_flag,
m.cost_group_id,
m.cost_category_id,
m.cost_update_id,
m.error_code,
m.error_explanation,
m.transaction_group_id
--m.transaction_type_id,
--m.transaction_source_name,
--m.*
from
MTL_MATERIAL_TRANSACTIONS M,
MTL_TRANSACTION_TYPES MTT,
mtl_system_items_b msib
where
to_char(m.transaction_date,'yyyymm')='200609'
and m.costed_flag='N'
--and m.error_code='No Error in CSTPSISC.ins_std_cost.'
--and m.subinventory_code='201_RMH'
and M.TRANSACTION_TYPE_ID = MTT.TRANSACTION_TYPE_ID
and msib.inventory_item_id=m.inventory_item_id
and msib.organization_id=m.organization_id
--and m.transfer_organization_id is null
--and m.transaction_id='10928181'
order by
mtt.transaction_type_name,
to_char(m.transaction_date,'yyyy-mm-dd'),
m.subinventory_code
--3.
update MTL_MATERIAL_TRANSACTIONS M1
set m1.costed_flag = 'N',
m1.error_code = NULL,
m1.error_explanation = NULL,
m1.transaction_group_id = NULL
where
--m.transaction_id='10926766'
m1.transaction_id in
(
select
m.transaction_id
from
MTL_MATERIAL_TRANSACTIONS M,
MTL_TRANSACTION_TYPES MTT,
mtl_system_items_b msib
where
to_char(m.transaction_date,'yyyymm')='200607'
--and to_char(m.transaction_date,'yyyymmdd')
收藏学习了. .... |
|