How to change PO delivery date via ME_PROCESS_PO_CUST?

9.3k views Asked by At

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.
2

There are 2 answers

1
AmNoOne On BEST ANSWER

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 :)

0
Suncatcher On

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.