问题:仓库核算生产入库成本的时候报错
日志:错误详细堆栈信息:com.kingdee.bos.BOSException: null
Caused exception message is: ORA-01427: single-row subquery returns more than one row
at com.kingdee.eas.scm.common.app.util.SysTempTableHelper.execute(SysTempTableHelper.java:233)
at com.kingdee.eas.scm.common.app.util.SysTempTableHelper.execute(SysTempTableHelper.java:198)
at com.kingdee.eas.scm.cal.app.calculate.InpWarehsSumCalculate.calculateStrategy(InpWarehsSumCalculate.java:138)
at com.kingdee.eas.scm.cal.app.calculate.AbstractCalculateCost.calculateCost(AbstractCalculateCost.java:126)
at com.kingdee.eas.scm.cal.app.CalculateFacadeControllerBean._updateInpWarehsCost(CalculateFacadeControllerBean.java:110)
at com.kingdee.eas.scm.cal.app.AbstractCalculateFacadeControllerBean.updateInpWarehsCost(AbstractCalculateFacadeControllerBean.java:92)
问题可能原因:
1.物料的多计量单位重复。
解决方法:通过金蝶公司的数据卫士工具可以修复有问题的数据。
2.物料的分类关系有重复数据。
解决方法:
--------查出重复的物料分组关系
select *
--into T_BD_MaterialGroupDetial_02
from T_BD_MaterialGroupDetial where fid in (
select max(mgd.fid) fid
--, m.fadmincuid, m.fnumber 物料编码,m.fname_l2 物料名称,mgs.fnumber 分类标准,mgs.fname_l2 分类标准名称,mg.fnumber 物料分类,mg.FName_L2 物料分类名称
from T_BD_MaterialGroupDetial mgd
inner join
(select m.fid matid,mgs.fid mgsid
from t_bd_materialgroupdetial mgd
inner join t_bd_material m on m.fid =mgd.fmaterialid
inner join t_bd_materialgroupstandard mgs on mgs.fid =mgd.fmaterialgroupstandardid
group by m.fid,mgs.fid
having count(1)>1
) t on t.matid=mgd.FMaterialID and t.mgsid= mgd.FMaterialGroupStandardID
inner join T_BD_MaterialGroup mg on mg.fid =mgd.FMaterialGroupID
inner join t_bd_materiala m on m.fid =mgd.FMaterialID
inner join T_BD_MaterialGroupStandard mgs on mgs.fid =mgd.FMaterialGroupStandardID
where 1=1
--and m.FMaterialGroupID <> mg.fid
-- and m.fnumber='物料编码'
-- and mgs.fnumber='物料分类标准编码'
group by mgd.FMaterialGroupID, mgd.FMaterialGroupStandardID, mgd.FMaterialID
--order by m.fnumber,mgs.fnumber,mg.fnumber
)
------删除重复数据
del2ete T_BD_MaterialGroupDetial where fid in (select fid from T_BD_MaterialGroupDetial_01)
de2lete T_BD_MaterialGroupDetial where fid in (select fid from T_BD_MaterialGroupDetial_02)
推荐阅读