Skip to Content
0
Jul 06, 2019 at 09:06 AM

Creating seperate production orders based on the requirement source

491 Views

Dear all,

some time ago, i had asked how i can create two different planned orders per day, depending on the type of the requirement (https://answers.sap.com/questions/12670199/creating-seperate-production-orders-based-on-the-r.html). In this question, Caetano Almeida had proposed the approach posted in this blog: https://blogs.sap.com/2014/09/10/how-to-create-separate-planned-order-purchase-requesition-for-same-date/

I have tried this approach but i can not manage derive two separate orders per day. This is my code: code.jpg

METHOD if_ex_md_add_elements~add_change_elements.
DATA: lf_temp_date TYPE dat00,
ls_mdps TYPE mdps,
ls_mt61d TYPE mt61d,
lf_planr TYPE planr.
* BREAK-POINT.
MOVE-CORRESPONDING IM_MT61D TO ls_mt61d .
check ls_mt61d-werks = '1009'.
check ( ls_mt61d-dispo = '100' or ls_mt61d-dispo = '200' ).
ch_changed = 'X'.
LOOP AT ch_copy_mdpsx INTO ls_mdps
WHERE ( delkz = 'AR' OR delkz = 'SB' ).
IF ls_mdps-dat00 = lf_temp_date.
ls_mdps-planr = lf_planr + 1.
lf_planr = ls_mdps-planr.
ELSE.
lf_planr = ls_mdps-planr.
ENDIF.
lf_temp_date = ls_mdps-dat00.
ENDLOOP.
ENDMETHOD.

And this is MD04 for my material. At 25/2/2019 MRP should have created two different planned orders, but it hasn't. My material has mrp controller = 100 and Lot Size EX. md04.jpg

Your help is highly appreciated.

Best personal regards

Nikos

Attachments

code.jpg (223.2 kB)
md04.jpg (306.7 kB)
md04.jpg (306.7 kB)