Skip to Content

Modify fields in ME51N when saving

Hi experts,

I need to update field "fixed vendor" for each item when saving a purchase requisition. I implemented badi ME_PROCESS_REQ_CUST

DATA i_items TYPE mmpur_requisition_items.
DATA: wa_item LIKE LINE OF i_items,
lv_if_item TYPE REF TO if_purchase_requisition_item,
lt_itm_data TYPE mereq_item.

LOOP AT i_items INTO wa_item.
lv_if_item = wa_item-item.

lt_itm_data-flief = <XXXX>.
lx_itm_data-flief = 'X'.
CALL METHOD lv_if_item->set_data
EXPORTING
im_data = lt_itm_data.
CALL METHOD lv_if_item->set_datax
EXPORTING
im_datax = lx_itm_data.
ENDLOOP.

I get sy-subrc = 0 but the purchase requisition is not updated.

Thanks in advance,

Maria

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 29, 2017 at 12:13 PM

    You cannot use method POST (too late) so did you use method CHECK, did you use method im_header->get_items (Also only call set_data[x] when you actually change a value)

    Add comment
    10|10000 characters needed characters exceeded