select * from V_OUT_SHIPMENT_PLAN where date_change = '1' and qtyopen>0 QTYOPEN(WMENG)、EDATU(promised_mat_availdate)、、、、 insert into OUT_ORDER_RES
SELECT * FROM OUT_PR_jiankong WHERE ITEM='000000104004000454' ; --PR 净需求 SELECT * FROM OUT_PR WHERE ITEM='000000701119702034' ; ---加上PR回写逻辑后 SELECT * FROM TP_TEMP_PR WHERE ITEM='000000701119702034' ; ---最终回写去SAP的数据 select out_pr.PO_RELEASE_DATE,out_pr.supplier_id,out_pr.site_id,sap_eord.ekorg,out_pr.proc_group_id,out_pr.item,out_pr.qty,out_pr.qtyuom,substr(loc_id,-4) as LGORT ,'SAPRFC' as ERNAM,out_pr.due_datetime,out_pr.so_id,out_pr.so_lineid,out_pr.sobsl from V_OUT_PR out_pr --其实是select * from tp_temp_pr join sap_eord on out_pr.item = sap_eord.matnr and out_pr.supplier_id = sap_eord.lifnr and out_pr.site_id = sap_eord.werks where out_pr.item in ('000000701119702034'); --JAVA FOR LABLE ZFM_MM025 回写标签总需求数 SELECT LPAD(RECID,10,0) RECID,SUBSTR(ITEM,1,18) ITEM,SITE_ID,QTY,QTYUOM,NVL(ITEM_ID,0) ITEM_ID,CREATE_DATE,CREATE_TIME,'SAPRFC',LOC_ID FROM T_PRINT_LABEL --JAVA FOR LABLE1 打印标签 ZFM_MM024 SELECT LPAD(RECID,10,0) RECID,ITEM,SITE_ID,CEIL(QTYALLOCATED)QTYALLOCATED,QTYUOM,CREATE_DATE,CREATE_TIME,'SAPRFC' FROM T_PRINT_LABEL_1 T1
--回写到SAP的2021工厂数据 select * from V_OUTMO_HEADER where LOC_ID ='2021' ;---temp_out_mo SELECT * FROM V_OUTMO_DETAIL_MH WHERE PRODUCTIONORDID IN (SELECT PRODUCTIONORDID FROM V_OUTMO_HEADER where LOC_ID ='2021'); --回写到SAP的2022 2023工厂数据
SELECT PRODUCTIONORDID,SO_ID,SO_LINE_ID,PEGGED_MO_ID,ITEM,QTYORDERED,CREATION_DATE,LOC_ID,PLANNEDSTARTDATE,PLANNEDENDDATE,QTYUOM,CUSTOMER_ID,BOM_ID,MTART, FLAG,PLNNR,FEVOR FROM TB_OUTMO_HEADER SELECT PRODUCTIONORDID,BOM_ID,ITEM,QTYPER,LOC_ID,PRODUCT_TYPE,BOM_UOM,BOM_QTY,QTYUOM,LINE_TYPE,TEXT,KZKUP,RGEKZ,CUSTOMER_ID,ZFLAG FROM TB_OUTMO_DETAIL
SELECT * FROM TB_OUTMO_HEADER_JIANKONG; SELECT * FROM TB_OUTMO_DETAIL_JIANKONG; --select * from V_OUTMO_HEADER where LOC_ID IN('2022','2023') ; --SELECT * FROM V_OUTMO_DETAIL_XG WHERE PRODUCTIONORDID IN (SELECT PRODUCTIONORDID FROM V_OUTMO_HEADER where LOC_ID IN('2022','2023')) ; --将SAP回写MO后的日志数据写入FP,用于FP写于ZMO_BOM表 INSERT INTO OUT_MO_WEBSERVICE_SAP(PRODUCTIONORDID,MOID,ERDAT,CPUTM,QTYORDERED,ITEM) SELECT MRNUM,AUFNR,ERDAT,CPUTM,MENGE,MATNR FROM SAPSR3.ZTPO_PP003B@SAP_SEP A WHERE A.ERDAT=TO_CHAR(SYSDATE,'YYYYMMDD');
select * from sapsr3.aufk@sap_sep where erdat='20181102' and ernam='SAPRFC' and erfzeit like '08%'
and werks='2023' order by erfzeit
select * from OUT_MO_WEBSERVICE; select * from OUT_MO_WEBSERVICE_BACK; select * from OUT_MO_WEBSERVICE_SAP;--SAP系统的工单日志表 select * from OUT_MO_WEBSERVICE_SAPTEMP;
BOM用量表:SAPSR3.ZMO_BOM@SAP_SEP
排产表:SAPSR3.ZPPTAPO@SAP_SEP
排产逻辑是先将三大工厂的数据写入ZTPP_FP_0019,然后执行RFC ZFM_FP_020进行排产.注意2021用户只用到ZTPP_FP_0019此表,不参与RFC执行进行排产