Skip to Content
avatar image
Former Member

Filter Sales orders based on type during MRP run in MD01N

Hello,

I understand that classical BADI MD_CHANGE_MRP_DATA has corresponding AMDP BADI PPH_MRP_RUN_BADI =>MDPS_ADJUST when executing MRP run using MD01N in S4 HANA system.

I need to filter sales order based on its type when MRP is generating the requirement.

This requirement can be achieved using ABAP BADI MD_CHANGE_MRP_DATA.

MD01N procedures runs on HANA. Hence, no ABAP BADIs are triggered.

I could not find alternative of method MD_CHANGE_MRP_DATA=>CHANGE_MDPSX_VBBE in AMDP BADIs.

Please suggest how can I achieve this requirement.

Regards,

Atul

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Dec 28, 2016 at 09:58 PM

    Hello

    The internal table MDPS stores the MRP elements, so you can use PPH_MRP_RUN_BADI =>MDPS_ADJUST to do it, since the sales orders will be in MDPS.

    Another option would be to use transaction MD_MRP_FORCE_CLASSIC to force your material to be planned with the classic logic, so that it is planned in ABAP instead of in HANA. See the blog https://blogs.sap.com/2016/11/22/mrp-on-hana-forcing-a-material-to-be-planned-with-the-classic-logic-in-md01n/ for details. One remark is that BAdI MD_CHANGE_MRP_DATA is no longer called and it should be replaced by BAdI MD_ADD_ELEMENTS.


    Regards,

    Caetano

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 14, 2017 at 09:41 AM

    Dear Atul,

    I have the same requirement to filter out stock trasfer requisition from other company (MRP element is 'U2').

    I try to implement BADI PPH_MRP_RUN_BADI and put following code in method MDPS_ADJUST:

    ct_mdps = select * from :ct_mdps where DELKZ <> 'U2' ;

    The I use ADT to debug the AMDP Procedure for T-code MD01N and find the the result in table 'ct_mdps' is right after step over the BP..
    But after the MRP run, The stock requirement list is not correct cause it still have the mrp element of 'U2' in it.

    Also I have find if I set break-point in the BADI code. the I try to run T-code MD04 in ADT.

    It didn't stop in the break-point I set in the AMDP procedure.

    Is it a SAP bug? Have you any idea or progress about your issue until now?

    Steven.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 14, 2017 at 01:00 PM

    Hello

    Which release are you using? Depending on your release, transaction MD04 may not be optimized for HANA, and you would have to implement the ABAP BAdI MD_ADD_ELEMENTS to filter the element out from transaction MD04.

    Regards,

    Caetano

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 15, 2017 at 02:04 AM

    Dear Caetano

    The version of our SAP system is s4hana1610. Based on the released document 'SIMPL_OP1610.pdf' from SAP, we find the classic BADI 'MD_CHANGE_MRP_DATA' is replace by AMDP BADI 'PPH_MRP_RUN_BADI' (pls check page 159 in the file). So we suppose we should implement the AMDP BADI. But you propose to implement classic BADI 'MD_ADD_ELEMENT'. So I am confused.

    Please advise advance. Thanks a lot.

    Steven

    .

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 16, 2017 at 02:06 PM

    Hello

    The AMDP BAdIs are called during the MRP Live execution, so they are not relevant for MD04.

    Nevertheless, transaction MD04 was also optimized for HANA and the BAdI MD_CHANGE_MRP_DATA is no longer called and it should be replaced by MD_ADD_ELEMENTS.


    Regards,

    Caetano

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 17, 2017 at 12:01 PM

    Dear Caetano,

    Thanks for the detail explanation.

    I have try to implement BADI MD_ADD_ELEMENTS, and it work truely. Thank you so much.

    Another requirement is as following. please help:

    I need to change the production version in plan order generated by MD01N based on customer's specific rule.

    Should I implement AMDP BADI PPH_MRP_RUN_BADI in method MDPS_ADJUST or classic BADI MD_MODIFY_PRODVERS?

    Please advice.

    Steven

    Add comment
    10|10000 characters needed characters exceeded

    • Dear Steven,

      IF you want to change the production version of new created planned order or PR, you should use sourcing BAdi PPH_MRP_SOURCING_BADI => SOS_DET_ADJUST. Because the sourcing BAdI is trigger after net requirement calculation and generate new lots based on the lot size key in material master. If you change the production version in the BAdI, system will process BOM explosion based on the changed production version after the BAdI processed. I have implemented the BAdI to change production version based on customer condition successfully.

      Steven Chou