Skip to Content
Author's profile photo Ulrich Köller

How to create separate planned order / purchase requesition for same date

In an MTS scenario MRP always considers requirements on the same date as one requirement.

In order to force MRP to create a separate planned order for each dependent requirement BAdI MD_ADD_ELEMENT method ADD_CHANGE_ELEMENTS can be used.

This is a basic coding which shows how this can basically be achieved. Please consider performance issues, type of call, type of call, etc.

And adjust according to your business requirements.

data: lf_temp_date type DAT00, ls_MDPS type BADI_MDPSX, lf_planr type PLANR.


loop at CH_COPY_MDPSX into ls_MDPS where delkz = ‘SR’. ” whatever requirement you have AR, SM, etc.

     if ls_MDPS-dat00 = lf_temp_date.

          ls_mdps-planr = lf_planr + 1.
          lf_planr = ls_mdps-planr.
            lf_planr = ls_mdps-planr.

      lf_temp_date = ls_mdps-date00


Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi Ulrich,

        Pl check two possibility whether u r using any lot size for material & second what setting u did in MRP4 view in material master whether individual / collective requirement, put individual requirement and check.

      Amit Awasthi.

      Author's profile photo Ulrich Köller
      Ulrich Köller
      Blog Post Author

      Hi Amit,

      this solution is supposed to be a last resort.

      It can be used for scenarios, where individual/collective indicator, explosion type, MTO planning, etc. doesn't work.

      I have seen this topic has been discussed several times. (e.gPlanned order generation for each demand)

      How to create multiple purchase requisition during MRP Run?

      Author's profile photo Caetano Almeida
      Caetano Almeida

      Hi Ulrich

      A solution for this issue has been already asked hundreds of times on this forum. I'll definitely try your solution in my test system. Thanks for sharing!



      Author's profile photo Former Member
      Former Member

      Hi Caetano,

      did you try this solution? I'm looking for a method that split purchase requisition for material managed with EX lot size  with same requirement date



      Author's profile photo Prasath Elumalai
      Prasath Elumalai

      Hi cetano

      Thanks lot

      By chaging H_COPY_MDPSX into ls_MDPS where delkz = ‘PP’

      multiple planned order has got even same date demand or multiple production version.


      Rename the BAdi as follows,

      In order to force MRP to create a separate planned order for each dependent requirement BAdI MD_ADD_ELEMENTS method ADD_CHANGE_ELEMENTS can be used



      Author's profile photo Nilesh Sankpal
      Nilesh Sankpal

      Hi Prasanth,


      We have similar requirement and need coding as suggested. But no separate planned orders got created based for each PIR requirement.

      Any possible reason for not working as expected.

      Thank you.



      Author's profile photo Akhil Tammiwar
      Akhil Tammiwar

      Hi Prasanth,


      Are you still facing the same issue?

      Author's profile photo Nikos Giannopoulos
      Nikos Giannopoulos

      Dear all,

      please use the code as it is shown in the attached picture. As you see in this code , it does produce a separate planned order for the same day, depending on the requirements category, is works for MRP controller 100 or 200, and for plant 1009 (please change any of these as per your requirement).

      Line Check NOt SY-tcode = 'MD04' is used so as MD04 does not put the newly created planned orders at the end of the screen, but let the in the correct chronological order.

      In the screenshot you will notice that there is code for using for these new (second per day) orders a different separate production version (ie production version 5). This is done because it was a requirement in our company that these new (second per day) planned orders should go to a specific storage location, different than the normal one. So, for all materials with mrp controller 100 or 200 we created a new production version (number 5), where we defaulted the storage location to the storage location requested by business. So, at the time of the new planned order was created, it was created in this specific storage location.

      Best regards


      Author's profile photo Senthil Somasundram
      Senthil Somasundram

      I am having the same requirement not able to create badi implementataion itself,

      While saving the BI i am getting this error. can you please help how to remove the error.


      Error image from se18