4600007972内销新单未取进FP

时间:2022-10-22 09:37:01

1.首先检查 in_sales_order表:

select * from in_sales_order where so_id='04600007972'发现没有数据

2.接着检查从SAP导数的步骤,TEMP_IN_SALES_ORDER_STO表,发现也没有此单

3.再检查开跑前,开跑后作做监控的表TEMP_IN_SALES_ORDER_TEST、TEMP_IN_SALES_ORDER_TEST1发现也没有写进去

4.早上上班后执行以下SQL语句发现数据是存在的,断定数据应该是会写入TEMP_IN_SALES_ORDER_STO,但凌晨跑出来的数据却没有

--INSERT INTO STG.TEMP_IN_SALES_ORDER_STO(SO_ID, SO_LINE_ID, POSNR, FAMILY_ID, CUSTOMER_ID, VC_OR_NOT, ITEM_ID, SITE_ID, CREATION_DATE, SALES_GROUP, CHANNEL_ID, DISTRIBUTION, PURCHASE_GROUP, REQUIRE_DATE, PROMISE_DATE, QTY, EX_PROMISE_DATE, STATUS, TOEC_OR_NOT)
SELECT SZ.EBELN AS SO_ID,
LTRIM(SUBSTR(SZ.POSNR,1,6),'')||'_'||LTRIM(SUBSTR(SZ.POSNR,7,4),'') AS SO_LINE_ID,
SZ.POSNR AS POSNR,
SZ.MVGR2 AS FAMILY_ID,
SZ.KUNNR AS CUSTOMER_ID,
SZ.KZKFG AS VC_OR_NOT,
SZ.MATNR AS ITEM_ID,
LTRIM(SE.LIFNR,'R') AS SITE_ID,
TO_DATE(SUBSTR(SZ.ERDAT,1,4)||'-'||SUBSTR(SZ.ERDAT,5,2)||'-'||SUBSTR(SZ.ERDAT,7,2),'YYYY-MM-DD') AS CREATION_DATE,
SZ.VKORG AS SALES_GROUP,
SZ.VTWEG AS CHANNEL_ID,
SZ.BZIRK AS DISTRIBUTION,
SZ.EKORG AS PURCHASE_GROUP,
TO_DATE(SUBSTR(SZ.VDATU,1,4)||'-'||SUBSTR(SZ.VDATU,5,2)||'-'||SUBSTR(SZ.VDATU,7,2),'YYYY-MM-DD') AS REQUIRE_DATE,
TO_DATE(SUBSTR(SZ.EDATU,1,4)||'-'||SUBSTR(SZ.EDATU,5,2)||'-'||SUBSTR(SZ.EDATU,7,2),'YYYY-MM-DD') AS PROMISE_DATE,
SZ.WMENG AS QTY,
CASE WHEN SZ.ZEDATU = '' THEN NULL ELSE TO_DATE(SUBSTR(SZ.ZEDATU,1,4)||'-'||SUBSTR(SZ.ZEDATU,5,2)||'-'||SUBSTR(SZ.ZEDATU,7,2),'YYYY-MM-DD') END AS EX_PROMISE_DATE,
SZ.ZSTATE AS STATUS,
SZ.ZTO_EC AS TOEC_OR_NOT
FROM SAPSR3.ZTSD_008_1@SAP_SEP SZ JOIN SAPSR3.EKKO@SAP_SEP SE ON SZ.MANDT = SE.MANDT AND SZ.EBELN = SE.EBELN
WHERE SZ.EKORG IN ('','')
AND TRIM(SZ.ZSFCH) IS NULL
AND SZ.MANDT = ''
AND TRIM(SZ.KZKFG) IS NULL
AND LTRIM(SE.LIFNR,'R') LIKE '2%' AND SZ.EBELN=''

4.检查SAPSR3.ZTSD_008_1的确是存在此单号,通过上面SQL语句断定单号在凌晨12点跑FP时是没有写入表ZTSD_008_1中,早上上班后此表是有数据的。

5.确定插入数据到此表的RFC为寻源,再检查寻源是否有问题

4600007972内销新单未取进FP

检查发现寻源在18:40分执行后卡住,导致数据没有写入ZTSD_008_1表,从而导致数据没有写入temp_sales_order_sto,没有入in_sales_order,导致回写交期为2020年

4600007972内销新单未取进FP

解决方法:

现在寻源已经不使用了,需要将此RFC加入FP取数节点,保证凌晨或者中午开跑时ZTSD_008_1是有最新数据的。