网站首页博客首页 ┆欢迎光临 ERP顾问最热爱的网络——金蝶社区 登录注册帮助
好望角的天堂
感恩、知足、珍惜
日志

[原创]通过物料代码查询物料在各业务单据的使用情况

  在查询分析工具新建关键字"@Fnumber@"(不含引号),名称为物料代码,字符串型,再新建直接SQL查询,复制以下代码粘贴,点下一步直到完成,打开后输入相关物料代码即可查询物料被相关业务单据的关联数。可以自己再增加有运作的相关业务单据。以下代码(k/3V10.3上通过测试):

select s1.销售订单,s2.采购申请单,s3.采购订单,s4.生产及委外任务单,s5.生产及委外投料单,s6.投料变更单,s7.计划订单,s8.出入库单据,s9.BOM,s10.收退料通知 from

(select count(t1.fitemid) 销售订单

from seorderentry t1,t_icitem t11

where t1.fitemid=t11.fitemid

and t11.Fnumber = '@Fnumber@') s1, 

(select count(t2.fitemid) 采购申请单

from poorderentry t2,t_icitem t11

where t2.fitemid=t11.fitemid

and t11.Fnumber = '@Fnumber@') s2,

(select count(t3.fitemid) 采购订单

from porequestentry t3,t_icitem t11

where t3.fitemid=t11.fitemid

and t11.Fnumber = '@Fnumber@') s3,

(select count(t4.fitemid) 生产及委外任务单

from icmo t4,t_icitem t11

where t4.fitemid=t11.fitemid

and t11.Fnumber = '@Fnumber@') s4,

(select count(t5.fitemid) 生产及委外投料单

from ppbom t5,t_icitem t11

where t5.fitemid=t11.fitemid

and t11.Fnumber = '@Fnumber@') s5,

(select count(t6.fitemid) 投料变更单

from ppbomchangeentry t6,t_icitem t11

where t6.fitemid=t11.fitemid

and t11.Fnumber = '@Fnumber@') s6,

(select count(t7.fitemid) 计划订单

from icmrpresult t7,t_icitem t11

where t7.fitemid=t11.fitemid

and t11.Fnumber = '@Fnumber@') s7,

(select count(t8.fitemid) 出入库单据

from icstockbillentry t8,t_icitem t11

where t8.fitemid=t11.fitemid

and t11.Fnumber = '@Fnumber@') s8,

(select count(t9.fitemid) BOM

from icbomchild t9,t_icitem t11

where t9.fitemid=t11.fitemid

and t11.Fnumber = '@Fnumber@') s9,

(select count(t10.fitemid) 收退料通知

from poinstockentry t10,t_icitem t11

where t10.fitemid=t11.fitemid

and t11.Fnumber = '@Fnumber@') s10
 
已经公开 2007年9月3日 9:13 作者: 好望角
所属归类: ,

评论

avatar 
这篇实在太好了,谢谢,我收藏一下吧,以后多学习
2007-09-03 14:07
 
请登录后再发表评论以赚取更多积分

About 好望角

用真诚来表达爱心!