Skip to Content
0
Mar 24, 2009 at 07:30 PM

How to update customer fields of EKPO from Method POST ME_PROCESS_PO_CUST

798 Views

Hi

I've extend table EKPO with an APPEND structure and I´m implementing method POST of BADI ME_PROCESS_PO_CUST for update that fields of EKPO. I've found method GET_EKPO of interface IF_PURCHASING_DOCUMENT_ITEM for get EKPO data, but I can`t found the corresponding SET_EKPO method. I can´t update EKPO directly because there are no entries there already. There are some other methods like IF_PURCHASE_ORDER_ITEM_MM~SET_DATA or SET_DATA but they use structure MEPOITEM instead of EKPO, and my Z fields doesn`t exists on that structure

This is the code:

  DATA: wt_poitems TYPE PURCHASE_ORDER_ITEMS,
            wg_poitems TYPE PURCHASE_ORDER_ITEM,
            obj_mepoitem TYPE REF TO IF_PURCHASE_ORDER_ITEM_MM,
            obj_doc_item TYPE REF TO IF_PURCHASING_DOCUMENT_ITEM,
            wg_ekpo     TYPE ekpo.

  wt_poitems = im_header->get_items( ).

  LOOP AT wt_poitems INTO wg_poitems.
    obj_mepoitem ?= wg_poitems-item.

    obj_doc_item ?= o_mepoitem.
    wg_ekpo = obj_doc_item->get_ekpo( ).

    wg_ekpo-zzmenge =  10.
    wg_ekpo-zznetpr    =  20.
    wg_ekpo-zzpesor   =  30.
  ENDLOOP.

Can anybody help me?

Thanks and regards

Dani