'How to change PO delivery date via ME_PROCESS_PO_CUST?

I need to update the delivery date of the purchase order.

I used the ME_PROCESS_PO_CUST BAdI in the POST method but it does not update the dates in the EKET table, only the dates on the screen are updated.

Here is the code in the method POST:

 CALL METHOD im_header->get_data
   RECEIVING
     re_data = ls_header_data.

  lt_items = im_header->get_items( ).


  LOOP AT lt_items INTO ls_items.

    lo_item = ls_items-item.
    ls_dati = lo_item->get_data( ).
    lt_schedule = lo_item->get_schedules( ).


    LOOP AT lt_schedule INTO ls_schedule.

      lo_schedule = ls_schedule-schedule.
      ls_meposchedule = lo_schedule->get_data( ).

      IF lv_data GE ls_meposchedule_pai-eindt.
        ls_meposchedule-eindt = lv_data.
      ENDIF.

      lo_schedule->set_data( ls_meposchedule ).

    ENDLOOP.

  ENDLOOP.


Solution 1:[1]

FUNCTION EXIT_SAPMM06E_017 is used for EKET update.

U need to update (SAPLMEPO)ETT[] table, because you can find changes of PO there.

Cheers :)

Solution 2:[2]

Try this code:

METHOD if_ex_me_process_po_cust~process_schedule.

  DATA: lv_eindt TYPE eket-eindt VALUE '20190731'.

  DATA(ls_schedule)  = im_schedule->get_data( ).
  DATA(lr_item)      = im_schedule->get_item( ).
  DATA(ls_item)      = lr_item->get_data( ).

  ls_item-eindt = lv_eindt.
  lr_item->set_data( ls_item ).

ENDMETHOD.

and put it into method IF_EX_ME_PROCESS_PO_CUST~PROCESS_SCHEDULE.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AmNoOne
Solution 2 Suncatcher