select * from wip_entities where wip_entity_name='60593'
select * from wip_discrete_jobs where wip_entity_id='1140724'
select * from WIP_OPERATIONS where wip_entity_id='1140724'
select * from WIP_OPERATION_RESOURCES where wip_entity_id='1140724'
SELECT * FROM WIP_REQUIREMENT_OPERATIONS WHERE WIP_ENTITY_ID='1140724' AND ORGANIZATION_ID=255
select * from mtl_system_items where inventory_item_id=341210 and organization_id=255 2KD0-0000000
select * from BOM_OPERATIONAL_ROUTINGS where assembly_item_id=341210
select * from BOM_OPERATION_SEQUENCES where routing_sequence_id=279801
select * from bom_operation_resources where operation_sequence_id=643727
select * from bom_resources where resource_id in (937,941,935,939,942,943,936,938,940)
select * from bom_standard_operations where standard_operation_id=643727
select * from cst_resource_costs where resource_id in (937,941,935,939,942,943,936,938,940) and cost_type_id=1203
select * from cst_cost_types where cost_type_id in (1181,1203)
select * from cst_department_overheads_v
-----------
inv會計期間無法關閉
a) The number of erred rows in MTL_MATERIAL_TRANSACTIONS:
select count (*)
from MTL_MATERIAL_TRANSACTIONS
where COSTED_FLAG = 'E';
b) The number of unprocessed rows in MTL_MATERIAL_TRANSACTIONS:
select count (*)
from MTL_MATERIAL_TRANSACTIONS
where COSTED_FLAG = 'N';
c) The number of processed rows in MTL_MATERIAL_TRANSACTIONS:
select count (*)
from MTL_MATERIAL_TRANSACTIONS
where COSTED_FLAG like NULL;
To resubmit the erred records in the MTL_MATERIAL_TRANSACTIONS table, it must be done via a SQL statement by updating the costed_flag = ‘N’ and the transaction_group_id = NULL.
Update MTL_MATERIAL_TRANSACTIONS
set COSTED_FLAG = 'N',
set TRANSACTION_GROUP_ID = NULL
where COSTED_FLAG ='E' or COSTED_FLAG ='N';
----------------------------------------------
查询未计成本:
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
from
MTL_MATERIAL_TRANSACTIONS M,
MTL_TRANSACTION_TYPES MTT,
mtl_system_items_b msib
where
to_char(m.transaction_date,'yyyymm')='200611'
and m.costed_flag='N'
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
order by
mtt.transaction_type_name,
to_char(m.transaction_date,'yyyy-mm-dd'),
m.subinventory_code
-----------------------
查询错误计成本:
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
from
MTL_MATERIAL_TRANSACTIONS M,
MTL_TRANSACTION_TYPES MTT,
mtl_system_items_b msib
where
to_char(m.transaction_date,'yyyymm')='200611'
and m.costed_flag='E'
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
order by
mtt.transaction_type_name,
to_char(m.transaction_date,'yyyy-mm-dd'),
m.subinventory_code
----------------------------
还原到未计成本原始状态:
update MTL_MATERIAL_TRANSACTIONS M1
set m1.costed_flag = 'N',
m1.error_code = NULL,
m1.error_explanation = NULL,
m1.transaction_group_id = NULL
where
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')='200611'
and m.costed_flag='N'
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
)
----------
最后,重新运行一下成本管理器即可!
-------------------------------------
未计成本物料导致库存会计期不可进行关闭的查询
由于俺们这里系统报表没有提供相应报表来查详细是哪些东西出错了,经过一个下午的研究终于找到了解决办法:
运行如下脚本语句
select mmt.*
from
apps.MTL_MATERIAL_TRANSACTIONS mmt
where mmt.organization_id= 您所设定的库存组织代码
and mmt.costed_flag='E'
and and mmt.transaction_date between 您所要查找的起始日期 and 您所要查找的结束日期
凡是costed_flag 标记为E的都是未计成本项目,在mmt这个表中错误代码及错误解释项目里有相应注释。
我不是系统管理员,暂时只研究到这一步,大家各位有什么宝贵经验请不吝赐教。俺们公司的库存会计期关闭经常出现异常问题,但是相应解决的方法却不明显,还望高手指教。
未处理物料事务处理的查询
运行如下脚本查询:
select mmtt.* ,
MSI.SEGMENT1 物料编码,
fu.user_name
from inv.MTL_MATERIAL_TRANSACTIONS_TEMP mmtt ,
INV.MTL_SYSTEM_ITEMS_B MSI,
apps.fnd_user fu
where mmtt.organization_id= 您所设定的库存组织代码
and msi.organization_id= mmtt.organization_id
AND msi.INVENTORY_ITEM_ID = mmtt.INVENTORY_ITEM_ID
and mmtt.created_by= fu.user_id
--此消息表示 MTL_MATERIAL_TRANSACTIONS_TEMP 表中存在未被处理的物料事务处理。
--在这种情况下,您不能关闭期间。请与系统管理员联系。
--库存管理系统会将此表内的这些事务处理视为移动数量的一部分。
--这种情况下系统将不允许您关闭期间,因为结果生成的会计分录事务处理日期将处于已关闭的期间内,
--该分录不会被关闭期间或总帐传送流程接受
等待接收事务处理的查询
select *
from po.RCV_TRANSACTIONS_INTERFACE
--如果使用的是采购管理系统,此消息表示 RCV_TRANSACTIONS_INTERFACE 表中有未被处理的采购事务处理,
--其中包括采购订单接收和库存退货。
--如果存在这种情况,您会收到一则警告消息,但仍可以关闭会计期。
--接收值中不会包括这些事务处理,但在关闭期间后,
--由于这些事务处理的日期处于已关闭的期间内,因此无法对其进行处理。
待定物料事务处理的查询
select *
from inv.MTL_TRANSACTIONS_INTERFACE
--此消息表示 MTL_TRANSACTIONS_INTERFACE 表中存在未被处理的物料事务处理。
--如果存在这种情况,您会收到一则警告消息,但仍可以关闭会计期。
--库存值中不会包括这些事务处理。
--但在关闭期间后,由于这些事务处理的日期处于已关闭的期间内,因此无法对其进行处理。
等待移动事务处理的查询
select *
from wip.WIP_MOVE_TXN_INTERFACE
--此消息表示 WIP_MOVE_TXN_INTERFACE 表中存在未被处理的车间移动事务处理。
--如果存在这种情况,您会收到一则警告消息,但仍可以关闭会计期。
--在制品值中不包括这些事务处理。但在关闭期间后,
--由于这些事务处理的日期处于已关闭的期间内,因此无法对其进行处理。
待定 WIP 成本核算事务处理的查询
select *
from wip.WIP_COST_TXN_INTERFACE
--此消息表示 WIP_COST_TXN_INTERFACE 表中存在未被处理的资源和制造费用会计事务处理。
--在这种情况下,您不能关闭期间。这些事务处理包括在在制品值中,正等待进一步处理。
--这种情况下系统将不允许您关闭期间,因为结果生成的会计分录事务处理日期将处于已关闭的期间内,
--该分录不会被关闭期间或总帐传送流程接受。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12122734/viewspace-329656/ ,如需转载,请注明出处,否则将追究法律责任。