码迷,mamicode.com
首页 > 数据库 > 详细

PO工单接口SQL

时间:2018-08-06 11:10:06      阅读:339      评论:0      收藏:0      [点我收藏+]

标签:bom   tom   header   ati   tar   service   substr   nbsp   item   

 

 

select * from V_OUTMO_HEADER where LOC_ID =2021 ;


select * from V_OUTMO_HEADER where LOC_ID IN(2022,2023)  ;


SELECT * FROM V_OUTMO_DETAIL_MH WHERE  PRODUCTIONORDID IN (SELECT PRODUCTIONORDID FROM V_OUTMO_HEADER where LOC_ID =2021);

SELECT * FROM V_OUTMO_DETAIL_XG WHERE  PRODUCTIONORDID IN (SELECT PRODUCTIONORDID FROM V_OUTMO_HEADER     where LOC_ID IN(2022,2023)) ;



select * from OUT_MO_WEBSERVICE;
delete from OUT_MO_WEBSERVICE;

--将2022、2023工厂的工单数据写入表中
INSERT INTO STG.TEMP_OUT_MO(PRODUCTIONORDID, SO_ID, SO_LINE_ID, PEGGED_MO_ID, ITEM, QTYORDERED, CREATION_DATE, LOC_ID, PLANNEDSTARTDATE, PLANNEDENDDATE, QTYUOM, CUSTOMER_ID, BOM_ID)
SELECT PRODUCTIONORDID, LTRIM(SO_ID,0) AS SO_ID, SO_LINE_ID, PEGGED_MO_ID, ITEM, QTYORDERED, CREATION_DATE, LOC_ID, PLANNEDSTARTDATE, PLANNEDENDDATE, QTYUOM, CUSTOMER_ID, BOM_ID FROM STG.OUT_MO
WHERE OUT_MO.LOC_ID in(2022,2023);

 

--2021
select * from v_out_mo;
select * from v_out_mo_item_1 out_mo_item   left join sap_marc  on substr(out_mo_item.loc_ID, 0, 4)=sap_marc.werks and out_mo_item.item=sap_marc.matnr ;

--2022\2023
select * from v_out_mo;
SELECT * FROM V_OUT_MO_ITEM_2 out_mo_item ;

 

PO工单接口SQL

标签:bom   tom   header   ati   tar   service   substr   nbsp   item   

原文地址:https://www.cnblogs.com/Snowfun/p/9429006.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!