描述:部分真验货客户未取进FP,检查发现IN_SALES_ORDER表有数据630\600\610行项目数据,但前台只显示630数据,600和610前台没有显示
1、查看IN_SALES_ORDER表,发现是存在数据的
SELECT * FROM IN_SALES_ORDER WHERE SO_ID='5000147446' and item_id in ('000000101011012796CZ','000000101011012820CZ','000000101001028523CZ')
2、查看salesorderline表发现没有数据,需继续往下查程序哪里被过滤
SELECT * FROM ABPPMGR.SALESORDERLINE WHERE ITEM in ('000000101011012796CZ','000000101011012820CZ','000000101001028523CZ')
3、查看FP_SO程序被过滤掉
发现IN_ITEM_SITE中没有带CZ的物料编码,导致被过滤没有进salesorderline表
select * from IN_ITEM_SITE where --item_id ='000000101011012820'OR ITEM_ID='000000101011012796' OR
ITEM_ID='000000101001028523CZ' or item_id like'000000101011012820%' or item_id like'000000101011012796%';
PS:维护UI见如下表
4、在IN_ITEM_SITE中添加尾续的存储过程为SAP_SO_QM_CUSTOMER
5、将循环头语句拿出来,发现数据是符合加尾续的,单独执行此循环是可以将尾续加入IN_ITEM_SITE里面的,但在SAP_SO_QM_CUSTOMER中却部分可以加尾续,部分无法加尾续。
SELECT SO.SO_ID,
SO.SO_LINE_ID,
QC.MATNR AS SEMI_ITEM,
BH.PRODUCT_ID AS ITEM_ID,
QC.ROW_ID AS CTYPE,
SO.CUSTOMER_ID,
SUBSTR (TRIM (BD.LOC_ID), 1, 4) AS SITE_ID
FROM SAP_QM_CUSTOMER QC,
IN_SALES_ORDER SO,
IN_BOM_DETAILS BD,
IN_BOM_HEADER BH
WHERE TRIM (BH.BOM_ID) = TRIM (BD.BOM_ID)
AND SO.ITEM_ID = BH.PRODUCT_ID
AND TRIM (SO.BOMID) = TRIM (BH.BOM_ID)
AND QC.MATNR = BD.ITEM_ID
AND QC.KUNNR = SO.CUSTOMER_ID
AND EXISTS
(SELECT NULL
FROM SAP_MAPL
WHERE QC.MATNR = SAP_MAPL.MATNR)
AND EXISTS
(SELECT NULL
FROM SAP_MAPL
WHERE BH.PRODUCT_ID = SAP_MAPL.MATNR)
AND SO.SO_ID = ''
order by so_line_id
6、解决方法:将这两条循环加尾续的存储过程拿出来调用,不放在SAP_SO_QM_CUSTOMER中调用