更新Sales Order里schedule line的ATP检查类型

需求:根据Sales Order 中交货工厂和库存地点的组合不同,设置Schedule line category

 

解决方法:

(1)在工厂的库存地点中,维护地址中的SerchTerm2为CP;

(2)查找ScheduleLine中,查找User Exit;

          在SD标准UserExit - User Exits In Sales Document Processing

          因为修改的内容最后写到VBEP表中,所以选用

  • USEREXIT_MOVE_FIELD_TO_VBEP
  • Use this user exit to assign values to new fields at the level of the sales document schedule lines.
  • The user exit is called up at the end of the FORM routine VBEP_FUELLEN.

     

(3)表关系:

TWLAD:Determination of Address from Plant and Storage

ADRC:Addresses (Business Address Services)

1.先查找TWLAD表中的ADRNR(Address number)

2.然后用Address number 到ADRC表中查找到地址信息记录;

(4)代码:

IF VBAK-AUART = 'FPOR' and ( VBAP-WERKS = '1220' or VBAP-WERKS = '1240' or VBAP-WERKS = '1315' ) and VBAP-LGORT <> '' .

   SELECT count(*) from TWLAD
   INNER JOIN ADRC ON TWLAD~ADRNR = ADRC~ADDRNUMBER
   WHERE TWLAD~WERKS = VBAP-WERKS and TWLAD~LGORT = VBAP-LGORT and TWLAD~LFDNR = '001' and ADRC~SORT2 = 'CP' .

     IF SY-SUBRC = 0 .
        VBEP-ETTYP = 'CP' .
     else.

        VBEP-ETTYP = 'NP' .
     ENDIF.

ENDIF.

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值