按单生产2

Posted Snowfun

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了按单生产2相关的知识,希望对你有一定的参考价值。

 注意:

1、成品与半成品都是MFG时(即工单MO还没开)是不需要写进productionorders及supplydmdpegging中

2、 給非按單生產的bom是100(保留批量) 給按單生產的bom(主要是無批量)的是200

3、所有按单生产的成品及半成品BOM都要新增ORDER_BOM:MST_ITEMBOMROUTING 及MST_ITEMBOMROUTING _P。
4、MST_ITEMBOMROUTING中的MAXLOTSIZE和MINLOTSIZE为空则表示 原来就没有批量数据,不需要新增ORDER_BOM数据到此表MST_ITEMBOMROUTING

5、當MST_ITEMBOMROUTING沒帶批量就只要新增MST_ITEMBOMROUTING_P 多數據等於200就好

6、INVENTORYPROPERTY中的attribute=FACTORY的value,只能带厂别,如果VLUE帶訂單號那任何訂單都用不了此庫存 因為沒有廠別帶訂單號。此表的VALUE值为ATTRIBUTECLASS冒号:后面的值

7、supplydmdpegging中locationid,lotlevel1,lotlevel2,SERIALNUM都必須等於inventory中相對應的值 否則綁定會失敗

8、MST_ITEMBOMROUTING_P中ATTRIBUTE=ORDER_PLANNING且VALUE=200表示只可以給按單生產訂單使用,当VALUE=0表示只能給非按單生產訂單使用,当VALUE=100表示給沒批量按單生產使用
9、针对非限制MO不能被按单生产使用,只需要改MST_ITEMBOMROUTING_P
表。当當IN_MO中的MO是非限制的MO則使用此ROUTINGID去MST_ITEMBOMROUTING_P中找相同的ROUTINGID,然後在找當ATTRIBUTE=ORDER_PLANNING,把此筆記錄中的value改為0。

MST_ITEMBOMROUTING_P中ATTRIBUTE=ORDER_PLANNING且VALUE=200表示只可以給按單生產訂單使用,当VALUE=0表示只能給非按單生產訂單使用,当VALUE=100表示給沒批量按單生產使用   FP_MFG 061

10.只要寫進IN_MO_SHORT都會產生MTL的需求。

11、需求是MTL的都是訂單。 在supplydmdpegging中不需要operationseq 其他的需求是工單的則需要。FP_MO 20160628
supplydmdpeg_P和supplydmdpegging表的operationseq清空 表示需求是訂單不是工單

12、在SUPPLYFDMDPEG_p中ATTRIBUTECLASS=PASS_ALL是在DEMANDORDERID為空之下才可能發生 ,當DEMANDORDERID有值不能放PASS_ALL。FP_MO 1623行的AND DEMANDORDERID IS NULL

13、在IN_ITEMBOMROUTING_P表中,对于非限制工單不是只有2筆一筆factory(VALUE=廠區),一筆order_planning(VALUE=0)

14、非按单生产订单:即不存在IN_ORDER_PLANNING。SALESORDERID_P只能带0和100

按单生产订单:存在IN_ORDER_PLANNING(包含真验货、假验货和VIP)。真验货中SALESORDERID_P有200、SO+LINEID,假验货在此有有0\\200\\SO+LINEID。

按单不能带0。例如SALESORDERID_P不能带属性值为0,如下图

 

 

13、产生成品MFG000:没有成品工单(在IN_MO和IN_SFCHEADER)的情况下才会产生MFG000;

产生半成品MFG001:当未清SO需求的数量(in_sales_order考虑多支装 )大于绑定的所有半成品工单(IN_MO和IN_SFCHEADER,102%,里面有绑定SO) 加库存的数量总和 时才会产生MFG,MFG的数量为前者数量减去后者数量。

 14\\in_mo中若是沒有指定訂單的或是不在IN_SEMI_MO_LOCKED則為非限制mo

 

 

 

案例一(半成品绑定MO):总结:半成品MO与SO绑定成功

5000163998/30_1
000000101010001980CA
000000102010000218CA
001201192133

 

SELECT * FROM IN_MO where so_id=\'5000163998\' and so_line_id=\'30\';

SELECT DEMANDLINEID,SUPPLYORDERID,DEMANDORDERID,QTYALLOCATED,ITEM FROM ABPPMGR.SUPPLYDMDPEGPLAN  WHERE  ITEM=\'000000102010000218CA\';--前台显示

SELECT DEMANDORDERID,DEMANDLINEID,DEMANDTYPE,ITEM,QTYINMOVE,SOURCEDATE,SUPPLYORDERID,SUPPLYTYPE,QTYALLOCATED,OPERATIONSEQ
 FROM ABPPMGR.supplydmdpegging WHERE (DEMANDORDERID=\'5000163998\' AND DEMANDLINEID=\'30_1\') OR DEMANDORDERID=\'5000163998/30_1-MFG001\'  ;  --000000101002001849CZ   001201126508    000000102002000845CZ    
 
SELECT PRODUCTIONORDID,BOMID,ITEM,QTYORDERED,REQUIREDDATE,ROUTINGID,UDF_MO_FACTORY FROM ABPPMGR.PRODUCTIONORDERS WHERE PRODUCTIONORDID=\'5000163998/30_1-MFG001\';

SELECT ENTERPRISE, ENGINE_ID, SALESORDERID, SOLINENUM, ATTRIBUTECLASS, ATTRIBUTE, RELATIONSHIP, VALUE , SYS_CREATED_BY FROM ABPPMGR.SALESORDERLINE_P WHERE ATTRIBUTECLASS LIKE \'%5000163998_30_1%\';
SELECT * FROM ABPPMGR.PRODUCTIONORDERS_P WHERE PRODUCTIONORDERID IN (\'001201192133\');
SELECT BOMID,ITEM,PRIORITY,ROUTINGID FROM ABPPMGR.MST_ITEMBOMROUTING WHERE ITEM in(\'000000101010001980\',\'000000102010000218\') or ITEM in(\'000000101010001980\',\'000000102010000218\');
SELECT * FROM ABPPMGR.FORECASTDETAIL_P ;
SELECT * FROM ABPPMGR.INVENTORYPROPERTY WHERE ITEM in(\'000000101010001980CA\',\'000000102010000218CA\') or ITEM in(\'000000101010001980\',\'000000102010000218\');
SELECT * FROM ABPPMGR.SFCHEADERPROPERTY WHERE  PRODUCTIONORDERID IN (\'001201192133\');--

 修改后:

 

 

案例二:000000102004000033 (只有SO号且无库存,工单MO还没开)

000000102004000033CA    成品编码000000101004002267CA  5000163999_10
000000102004000033      成品编码000000101004010853     6900002438_180

SELECT LOCATIONID,DEMANDLINEID,SUPPLYORDERID,DEMANDORDERID,QTYALLOCATED,ITEM,SUPPLYTYPE FROM ABPPMGR.SUPPLYDMDPEGPLAN  WHERE  ITEM IN (\'000000102004000033\',\'000000102004000033CA\');--前台显示

SELECT ENTERPRISE, ENGINE_ID, SALESORDERID, SOLINENUM, ATTRIBUTECLASS, ATTRIBUTE, RELATIONSHIP, VALUE , SYS_CREATED_BY FROM ABPPMGR.SALESORDERLINE_P 
WHERE ATTRIBUTECLASS LIKE \'%6900002438_180%\' OR ATTRIBUTECLASS LIKE \'%5000163999_10%\';

SELECT BOMID,ITEM,PRIORITY,ROUTINGID FROM ABPPMGR.MST_ITEMBOMROUTING WHERE ITEM in(\'000000102004000033\',\'000000102004000033CA\');
SELECT * FROM ABPPMGR.MST_ITEMBOMROUTING_p WHERE ITEM  in(\'000000102004000033\',\'000000102004000033CA\') ORDER BY ITEM;
SELECT * FROM ABPPMGR.INVENTORYPROPERTY WHERE ITEM in (\'000000102004000033\',\'000000102004000033CA\');

 

 修改后前台显示如下:https://www.cnblogs.com/Snowfun/p/9138176.html

SELECT LOCATIONID,DEMANDLINEID,SUPPLYORDERID,DEMANDORDERID,QTYALLOCATED,ITEM,SUPPLYTYPE FROM ABPPMGR.SUPPLYDMDPEGPLAN  WHERE  ITEM IN (\'000000102004000033\') order by DEMANDORDERID desc;--前台显示
SELECT ENTERPRISE, ENGINE_ID, SALESORDERID, SOLINENUM, ATTRIBUTECLASS, ATTRIBUTE, RELATIONSHIP, VALUE , SYS_CREATED_BY FROM ABPPMGR.SALESORDERLINE_P 
WHERE ATTRIBUTECLASS LIKE \'%6900002438_180%\' OR ATTRIBUTECLASS LIKE \'%5000163999_10%\';
SELECT BOMID,ITEM,PRIORITY,ROUTINGID FROM ABPPMGR.MST_ITEMBOMROUTING WHERE ITEM in(\'000000102004000033\');
SELECT * FROM ABPPMGR.MST_ITEMBOMROUTING_p WHERE ITEM  in(\'000000102004000033\') ORDER BY ITEM; 
SELECT * FROM ABPPMGR.INVENTORYPROPERTY WHERE ITEM in (\'000000102004000033\');
SELECT * FROM ABPPMGR.INVENTORY  WHERE ITEM in (\'000000102004000033\');

 

  案例三:(半成品MO和成品MO没开,只有SO和库存)

5000163788/90_1
000000101002015678CZ
000000102002000589CZ    库存8个部分满足订单

SELECT * FROM IN_MO where so_id=\'5000163788\' and so_line_id=\'90\';---无

SELECT LOCATIONID,DEMANDORDERID,DEMANDLINEID,SUPPLYTYPE,SUPPLYORDERID,QTYALLOCATED,ITEM FROM ABPPMGR.SUPPLYDMDPEGPLAN  WHERE  ITEM IN (\'000000101002015678CZ\',\'000000102002000589CZ\');--前台显示

SELECT ENTERPRISE, ENGINE_ID, SALESORDERID, SOLINENUM, ATTRIBUTECLASS, ATTRIBUTE, RELATIONSHIP, VALUE , SYS_CREATED_BY FROM ABPPMGR.SALESORDERLINE_P WHERE ATTRIBUTECLASS LIKE \'%5000163788_90_1%\';

SELECT BOMID,ITEM,PRIORITY,ROUTINGID FROM ABPPMGR.MST_ITEMBOMROUTING WHERE ITEM in(\'000000101002015678CZ\',\'000000102002000589CZ\') or ITEM in(\'000000101002015678CZ\',\'000000102002000589CZ\');

SELECT * FROM ABPPMGR.INVENTORYPROPERTY WHERE ITEM in(\'000000101002015678CZ\',\'000000102002000589CZ\') or ITEM in(\'000000101002015678CZ\',\'000000102002000589CZ\');
--还没开MO,不需要写入supplydmdpegging
SELECT DEMANDORDERID,DEMANDLINEID,DEMANDTYPE,ITEM,QTYINMOVE,SOURCEDATE,SUPPLYORDERID,SUPPLYTYPE,QTYALLOCATED,OPERATIONSEQ
FROM ABPPMGR.supplydmdpegging WHERE (DEMANDORDERID=\'5000163788\' AND DEMANDLINEID=\'90_1\') OR DEMANDORDERID LIKE\'5000163788/90_1%\' ; -- ----还没开MO,不需要写入PRODUCTIONORDERS SELECT PRODUCTIONORDID,BOMID,ITEM,QTYORDERED,REQUIREDDATE,ROUTINGID,UDF_MO_FACTORY FROM ABPPMGR.PRODUCTIONORDERS WHERE PRODUCTIONORDID =\'5000163788/90_1-MFG001\'; -- --SELECT * FROM ABPPMGR.PRODUCTIONORDERS_P WHERE PRODUCTIONORDERID IN (\'001201192133\');--还没开MO SELECT * FROM ABPPMGR.FORECASTDETAIL_P ; --SELECT * FROM ABPPMGR.SFCHEADERPROPERTY WHERE PRODUCTIONORDERID IN (\'001201192133\');--无

 案例四+1:成品MFG+半成品库存
5000166118/1500_1
000000101011003137CZ   5000166118/1500_1-MFG000;
000000102011000038CZ   2022/2016;

 

SELECT * FROM IN_SFCHEADER where so_id=\'5000166118\' and so_line_id=\'1500\';  --
SELECT * FROM IN_MO where so_id=\'5000166118\' and so_line_id=\'1500\';  --

SELECT LOCATIONID,DEMANDORDERID,DEMANDLINEID,SUPPLYORDERID,QTYALLOCATED,ITEM,SUPPLYTYPE FROM ABPPMGR.SUPPLYDMDPEGPLAN  WHERE  ITEM IN(\'000000101011003137\',\'000000102011000038\');--前台显示

SELECT DEMANDORDERID,DEMANDLINEID,DEMANDTYPE,ITEM,QTYINMOVE,SOURCEDATE,SUPPLYORDERID,SUPPLYTYPE,QTYALLOCATED
,OPERATIONSEQ
FROM ABPPMGR.supplydmdpegging WHERE (DEMANDORDERID=\'5000166118\' AND DEMANDLINEID=\'1500_1\') OR DEMANDORDERID=\'5000166118/1500_1-MFG000\' ;  --OR DEMANDORDERID IN(\'001100918841\') OR SUPPLYORDERID IN (\'001100918841\') SELECT PRODUCTIONORDID,BOMID,ITEM,QTYORDERED,REQUIREDDATE,ROUTINGID,UDF_MO_FACTORY FROM ABPPMGR.PRODUCTIONORDERS WHERE PRODUCTIONORDID LIKE \'5000166118/1500%\'; SELECT ENTERPRISE, ENGINE_ID, SALESORDERID, SOLINENUM, ATTRIBUTECLASS, ATTRIBUTE, RELATIONSHIP, VALUE , SYS_CREATED_BY FROM ABPPMGR.SALESORDERLINE_P WHERE ATTRIBUTECLASS LIKE \'%5000166118%\'; SELECT * FROM ABPPMGR.PRODUCTIONORDERS_P WHERE PRODUCTIONORDERID IN (\'001100918841\') ; SELECT BOMID,ITEM,PRIORITY,ROUTINGID FROM ABPPMGR.MST_ITEMBOMROUTING WHERE ITEM IN(\'000000101011003137\',\'000000102011000038\'); SELECT * FROM ABPPMGR.FORECASTDETAIL_P ; SELECT * FROM ABPPMGR.INVENTORYPROPERTY WHERE ITEM IN(\'000000101011003137\',\'000000102011000038\') order by attribute; SELECT * FROM ABPPMGR.INVENTORY WHERE ITEM IN(\'000000101011003137\',\'000000102011000038\'); SELECT * FROM IN_INVENTORY WHERE ITEM_ID IN(\'000000101011003137\',\'000000102011000038\'); SELECT * FROM IN_SEMI_ONHAND_LOCKED WHERE ITEM_ID=\'000000102011000038\';

 案例五:成品MO REL+半成品库存(98 OK的)
5000166118/820_1
000000101005006567CZ   001100923737;
000000102005000263CZ   none
MTL_001100923737_2023/000000102005000263CZ   2023/2007

SELECT * FROM IN_SFCHEADER where so_id=\'5000166118\' and so_line_id=\'820\';  --
SELECT * FROM IN_MO where so_id=\'5000166118\' and so_line_id=\'820\';  --

SELECT LOCATIONID,DEMANDORDERID,DEMANDLINEID,SUPPLYORDERID,QTYALLOCATED,ITEM,SUPPLYTYPE FROM ABPPMGR.SUPPLYDMDPEGPLAN  WHERE  ITEM IN(\'000000101005006567\',\'000000102005000263\');--前台显示

SELECT DEMANDORDERID,DEMANDLINEID,DEMANDTYPE,ITEM,QTYINMOVE,SOURCEDATE,SUPPLYORDERID,SUPPLYTYPE,QTYALLOCATED
 FROM ABPPMGR.supplydmdpegging WHERE (DEMANDORDERID=\'5000166118\' AND DEMANDLINEID=\'820_1\') OR DEMANDORDERID=\'5000166118/820_1-MFG000\' 
 OR DEMANDORDERID IN(\'001100923737\') OR SUPPLYORDERID IN (\'001100923737\') ;
 
 SELECT PRODUCTIONORDID,BOMID,ITEM,QTYORDERED,REQUIREDDATE,ROUTINGID,UDF_MO_FACTORY FROM ABPPMGR.PRODUCTIONORDERS WHERE PRODUCTIONORDID LIKE \'5000166118/820%\';

SELECT ENTERPRISE, ENGINE_ID, SALESORDERID, SOLINENUM, ATTRIBUTECLASS, ATTRIBUTE, RELATIONSHIP, VALUE , SYS_CREATED_BY FROM ABPPMGR.SALESORDERLINE_P WHERE ATTRIBUTECLASS LIKE \'%5000166118%\';
SELECT * FROM ABPPMGR.PRODUCTIONORDERS_P WHERE PRODUCTIONORDERID IN   (\'001100923737\') ; 
SELECT BOMID,ITEM,PRIORITY,ROUTINGID FROM ABPPMGR.MST_ITEMBOMROUTING WHERE ITEM IN(\'000000101005006567\',\'000000102005000263\');
SELECT * FROM ABPPMGR.FORECASTDETAIL_P ;
SELECT * FROM ABPPMGR.INVENTORYPROPERTY WHERE ITEM IN(\'000000101005006567\',\'000000102005000263\') order by attribute;
SELECT * FROM ABPPMGR.INVENTORY  WHERE ITEM IN(\'000000101005006567\',\'000000102005000263\');
SELECT * FROM IN_INVENTORY WHERE ITEM_ID IN(\'000000101005006567\',\'000000102005000263\'); 
SELECT * FROM IN_SEMI_ONHAND_LOCKED WHERE ITEM_ID=\'000000102005000263\';
View Code

 

117 问题:MTL的工单没有吃带SO号的库存,而是产生了MFG。


 

案例六:

5000132102/1250_1
000000101011012820CZ     成品工单:001100888948
000000102011000576CZ    108个库存全部满足

SELECT * FROM IN_MO where so_id=\'5000132102\' and so_line_id=\'1250\';---无

SELECT LOCATIONID,DEMANDORDERID,DEMANDLINEID,SUPPLYTYPE,SUPPLYORDERID,QTYALLOCATED,ITEM FROM ABPPMGR.SUPPLYDMDPEGPLAN  WHERE  ITEM IN (\'000000101011012820CZ\',\'000000102011000576CZ\');--前台显示

SELECT ENTERPRISE, ENGINE_ID, SALESORDERID, SOLINENUM, ATTRIBUTECLASS, ATTRIBUTE, RELATIONSHIP, VALUE , SYS_CREATED_BY FROM ABPPMGR.SALESORDERLINE_P WHERE ATTRIBUTECLASS LIKE \'%5000132102_1250_1%\';

SELECT BOMID,ITEM,PRIORITY,ROUTINGID FROM ABPPMGR.MST_ITEMBOMROUTING WHERE ITEM in(\'000000101011012820CZ\',\'000000102011000576CZ\');

SELECT * FROM ABPPMGR.INVENTORYPROPERTY WHERE ITEM in(\'000000101011012820CZ\',\'000000102011000576CZ\') ;--or ITEM in(\'000000101002015678CZ\',\'000000102002000589CZ\');
--还没开MO,不需要写入supplydmdpegging
SELECT DEMANDORDERID,DEMANDLINEID,DEMANDTYPE,ITEM,QTYINMOVE,SOURCEDATE,SUPPLYORDERID,SUPPLYTYPE,QTYALLOCATED,OPERATIONSEQ
 FROM ABPPMGR.supplydmdpegging WHERE (DEMANDORDERID=\'5000132102\' AND DEMANDLINEID=\'1250_1\') OR DEMANDORDERID LIKE\'5000132102/1250_1%\'  ; 
----还没开MO,不需要写入PRODUCTIONORDERS
SELECT PRODUCTIONORDID,BOMID,ITEM,QTYORDERED,REQUIREDDATE,ROUTINGID,UDF_MO_FACTORY FROM ABPPMGR.PRODUCTIONORDERS WHERE PRODUCTIONORDID =\'5000132102/1250_1-MFG001\'; --
SELECT * FROM ABPPMGR.PRODUCTIONORDERS_P WHERE PRODUCTIONORDERID IN (\'001100888948\');

SELECT * FROM ABPPMGR.FORECASTDETAIL_P ;
--SELECT * FROM ABPPMGR.SFCHEADERPROPERTY WHERE  PRODUCTIONORDERID IN (\'001201192133\');--无

 

 修改后:

下下面两个库存表有误

案例七:成品(CRTD)MO+半成品库存
--5000164149/810_1
--000000101011012231CZ   001100939675;
--000000102011001139CZ   2022/2016;

SELECT * FROM IN_MO where so_id=\'5000164149\' and so_line_id=\'810\';  --

SELECT LOCATIONID,DEMANDORDERID,DEMANDLINEID,SUPPLYORDERID,QTYALLOCATED,ITEM,SUPPLYTYPE FROM ABPPMGR.SUPPLYDMDPEGPLAN  WHERE  ITEM IN(\'000000101011012231\',\'000000102011001139\');--前台显示

SELECT locationid,lotlevel1,lotlevel2,ITEM,SERIALNUM, DEMANDORDERID,DEMANDLINEID,DEMANDTYPE,QTYINMOVE,SOURCEDATE,SUPPLYORDERID,SUPPLYTYPE,QTYALLOCATED,OPERATIONSEQ
 FROM ABPPMGR.supplydmdpegging WHERE (DEMANDORDERID=\'5000164149\' AND DEMANDLINEID=\'810_1\') OR DEMANDORDERID=\'5000164149/810_1-MFG000\'
 OR DEMANDORDERID IN(\'001100939675\') OR SUPPLYORDERID IN (按单生产3

转SAP_405052等计划策略对比分析

SpringCloud系列十一:SpringCloudStream(SpringCloudStream 简介创建消息生产者创建消息消费者自定义消息通道分组与持久化设置 RoutingKey)(代码片段

SQL Prompt7.2下载及破解教程

将vscode打造成无敌的IDE初步探索vscode,解放生产力

揭秘先进制造业如何使用机械行业ERP系统快速升级?