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

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

时间:2022-11-27 11:03:12浏览次数:46  
标签:purchase Business MRP abap Add 采购 SAP 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:

  • Material requirements planning
  • Master production scheduling

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.
  2. 2. Double-click on the relevant method.
  3. 3. Click on the right mouse button and choose Component documentation.

 

标签:purchase,Business,MRP,abap,Add,采购,SAP,BADI
From: https://blog.51cto.com/fangkailove/5889838

相关文章

  • abap-SD-客户主数据
    在用vl01n做创建交货单时(客户的两个订单合建一张交货单),出现一个错误提示组合错误051,从现象上判断应该是两个订单合并时有什么条件不满足。熟悉SD 配置的人知道这......
  • abap-商业发票管理系统
    对国外销售一般都会有商业发票要求,主要用于客户的清关及后期与客户对账结算用。取数的逻辑是按照对客户的出货单出得数量单价,再附加货运等信息,构成发票主要内容,下面简单记......
  • abap-标准程序调试一例
    任务描述:系统使用的可配置物料,VA01,VA02,销售订单维护界面,已经有功能,当保存订单时,自动为可配置物料做成本估算,但是此估算是针对订单行项的交货工厂(1000公司代码下1000工厂......
  • abap-使用vim做abap的编辑器
    abap-使用vim做为abap的外部编辑器sapgui7带的abap编辑器很不错了,但是我最近都是在用ubuntu系统,用的是forjava的gui,编辑器超难用。于是就想能否用自已习惯的编辑器来......
  • SAP-ABAP-Smartforms调用参数的利用与打印次数的记录
    在设计好一个 smartform后,系统会自动生成一个相对应的functionmodule,我们在调用smartform时实际上就是调用这个对应的function如下我们可以找到对应的function:......
  • SAP-SD-ABAP-VMOD 查找和应用SD模块用户出口(user exit) 好方法
    针对SD模块,有一个专门管理user-exit的开发包 VMOD,只要用tcode:se80查看它,会发现绝大部分的SD要相关的user-exit都能在这找到。......
  • ABap smartforms 预览重叠问题解决
     smartfoms在预览时总会出现文字重叠的现象,但是实际打印却又正常。如下图。 通过对sap源码的修改可以修正此问题。如下显示就正常了。......
  • abap: 一个 成本估算不能标记和发布问题的跟踪调试案例(对于 0 物料, 0 成本评估被成
    一个成本估算不能标记和发布的跟踪案例: 为了避免用户数据的干扰,我首先将料号20101115的估算全都册除了(事务:CKR1)然后重新做估算。确认估算保存无错。 然后再用CK2......
  • abap-如何更好的给代码添加硬断点 break-point
    ​​http://gnolux-blog.appspot.com/2010/06/17/abap_20100617002.html​​之前对代码添加硬断都是采用这种方式: ifsy-uname= 'userid'.  break-point.endif.这种......
  • SAP ABAP CDS view里的注解在ABAP后台是如何被解析的?
    我们在ABAPDevelopmentTool里编写SAPCDSview,为视图维护这些以@开头的注解,同JavaSpring里广泛应用的annotation一样,都是一种为developmentobject维护元数据的方式。......