abap-MRP自动产生采购申请-BADI增强-将销售单和行号复制为需求追踪号

这是很早以前做的一个开发,这里记录一下,做个备忘。
业务背景:1000公司的销售订单经过 MRP  运算后订单的每行都会转换成一个对应的采购申请单(对2000公司),生产计划人员需要按销售单汇集采购申请制作一张对2000公司的采购订单。问题就出在这里,当用 me21n建采购单,查找采购申请时,没有相应的按销售订单查询的条件,如下图:


如果要增强 me21n 程序,理论上可以但难度较大。于是从另一个角度来解决这个问题,见上图: 每个采购申请行都会有一个 "需求跟踪号" , 如果在采购申请创建时,能够把相应的订单及行号填到 需求跟踪号 这个栏位里,那就能解决这个问题了。延着这个思路,我们去找 mrp 运算相关的增强,进后台配置,如下图:

找到一个可用的 badi ,按照它的说明(后面附了说明),创建这个 badi 的实例, 可以用 se19 直接进入,如下图:


实现 Before_save 的方法:



测试结果very good:


这样就可以用 需求跟踪号 来查找了.


参考英文帮助: ( 其实 sap 的帮助本身是很详细的,仔细阅读一般都有所帮助 )

SIMGMD_PURREQ_CHANGE

Use

Application components:  PP-MRP-PP, MM-PUR

Function groups: M61P, M61U

You can use the Business Add-In (BAdI) MD_PURREQ_CHANGE to change data, before posting, for purchase requisitions, which have been created, changed, or deleted as a result of the materials planning of a material, or which have been created as a result of conversion of a planned order.

You can use the Business Add-In to fill and change fields from purchase requisitions in tables EBAN and EBKN: Customer include CI_EBANDB also supports filling customer-specific fields when changing fields in the table structure EBAN.

You can execute the Business Add-In in the planning run in the following areas:

Standard settings

  • The Business Add-In is not active in the standard system
  • The Business Add-In cannot be used multiple times

Activities

 

To activate the Business Add-In, you must create an active implementation. To do this, choose the following path in the SAP Menu: Tools -> ABAP Workbench -> Utilities -> Business Add-Ins -> Implementation

 

For more information about this procedure, see the SAP Library under

  • Basis Components -> ABAP Workbench -> Changing the SAP Standard -> Business Add-Ins -> Implementing Business Add-Ins.

 

Example

In the sample coding provided, the fields business area, controlling area and profit center are filled for purchase requisitions with account assignment to a sales order. The system reads the relevant data from the sales order and transfers it to the purchase requisition.

This sample implementation thus replaces the modification proposals from SAP Notes 303243 and 357713.

Further notes

Documentation on the BAdI method CHANGE_BEFORE_SAVE_MRP

Documentation on the BAdI method CHANGE_BEFORE_SAVE_CONV

 

 

You can also call the documentation on the BAdI method via the menu, by carrying out the following steps:

  1. 1. Choose the tab page Interface.
  1. 2. Double-click on the relevant method.
  1. 3. Click on the right mouse button and choose Component documentation.

 

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wxgnolux

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值