起因
在DEV里写了个报表,用生产订单关联工艺路线,关联特性值的时候发现特性值维护的和PRD里不一样,PRD里,这个特性值在“值”标签里定义了选项,而DEV里却没有,于是乎就想把它补过来。然而保存存的时候报错了,如图。
经过
猜测报错的原因是可能有的工艺路线里定义了该特性值,且已维护的特性值不在我录入的范围内。于是乎萌生检查到底是哪个工艺路线维护了该特性值的想法。
结果
写了以下的SQL,查询结果中根据OBJEK能够轻易的判断出所属的工艺路线了。
select cabn.atinn, cabn.atnam, cabn.atfor, cabn.anzst, cabn.anzdz, cabn.atkla, inob.objek, inob.klart, inob.obtab, inob.objek, ausp.atwrt, cawnt.atwtb from cabn inner join ausp on cabn.mandt = ausp.mandt and ausp.mafid = 'O' and ausp.klart = '018' and cabn.atinn = ausp.atinn inner join inob on inob.OBTAB = 'PLKO' AND inob.KLART = ausp.klart and inob.mandt = ausp.mandt and inob.cuobj = ausp.OBJEK left outer join cawn on cawn.mandt = cabn.mandt and cawn.atinn = cabn.atinn and cawn.atwrt = ausp.atwrt left outer join CAWNT on cawnt.mandt = cabn.mandt and cawnt.atinn = cawn.atinn and cawnt.spras = '1' and cawnt.ATZHL = cawn.ATZHL and cawnt.ADZHL = cawn.ADZHL where cabn.atnam = 'ZPP_RTG_LX' and cabn.mandt = '600' |