Skip to Content
0

Modify fields in ME51N when saving

Aug 29, 2017 at 09:56 AM

59

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Raymond Giuseppi
Aug 29, 2017 at 12:13 PM
0

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)

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Thanks Raymond, I solved it by using PROCESS_ITEM method.

0

This question is still displayed as unanswered. Kindly close it, see this blog.

Thank you.

0