CO01/CO02生产订单组件库存地点替换

一、生产订单组件库存地点替换

当生产订单维护组件点击保存时,根据对应的工厂和工作中心,到配置表中查询对应的库存地点,并将自动带出的库存地点替换

 二、隐式增强

在函数CO_VB_ORDER_POST中添加隐式增强逻辑(此函数为异步调用)

 参考代码

"-----------------------------------------@斌将军--------------------------------------------
ENHANCEMENT 1 ZPPXXX. "active version READ TABLE CAUFVTA INDEX 1. IF CAUFVTA-WERKS = 'XXXX'. IF AFVGTAB[] IS NOT INITIAL. SELECT OBJTY,"资源的对象类型 OBJID,"资源的对象 ID ARBPL"工作中心 FROM CRHD INTO TABLE @DATA(LT_CRHD) FOR ALL ENTRIES IN @AFVGTAB WHERE OBJID = @AFVGTAB-ARBID. IF LT_CRHD IS NOT INITIAL. "获取配置表对应的库存地点 SELECT * FROM ZXXX INTO TABLE @DATA(LT_XBC) FOR ALL ENTRIES IN @LT_CRHD WHERE ARBPL = @LT_CRHD-ARBPL AND WERKS = @CAUFVTA-WERKS. LOOP AT RESBTAB ASSIGNING FIELD-SYMBOL(<FS_RESB>) WHERE RGEKZ = 'X'. READ TABLE AFVGTAB WITH KEY AUFPL = <FS_RESB>-AUFPL APLZL = <FS_RESB>-APLZL. IF SY-SUBRC EQ 0. READ TABLE LT_CRHD INTO DATA(LS_CRHD) WITH KEY OBJID = AFVGTAB-ARBID. IF SY-SUBRC EQ 0. READ TABLE LT_XBC INTO DATA(LS_XBC) WITH KEY ARBPL = LS_CRHD-ARBPL. IF SY-SUBRC EQ 0. <FS_RESB>-LGORT = LS_XBC-LGORT."库存地点 ENDIF. ENDIF. ENDIF. ENDLOOP. ENDIF. ENDIF. ENDIF. ENDENHANCEMENT.
"-----------------------------------------@斌将军--------------------------------------------

 

定期更文,欢迎关注

 
 
posted @ 2021-10-25 10:58  斌将军  阅读(389)  评论(0编辑  收藏  举报