abap-MRP自動產生採購申請-BADI增強-將銷售單和行號複製為需求追蹤號

來源:互聯網
上載者:User

這是很早以前做的一個開發,這裡記錄一下,做個備忘。
業務背景: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. Choose the tab page Interface.
    2. Double-click on the relevant method.
    3. Click on the right mouse button and choose Component documentation.

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.