Skip to Content
0

Problem with new custom field in EKPO when saving purchase order

Oct 19, 2016 at 02:46 PM

103

avatar image

Hi experts,

I checked the forum for answers for my issue but there's nothing that solves it.

I have a new custom field in EKPO, ZREVNO. This field is shown in additional data of item PO at ME2xN. For some purchase orders, this field is editable but in some other cases it is disabled and I have to fill it when posting the PO (that's what the consultant told me).

So the field already exists in the screen, in CI_EKPODB and it seems everything is correct in ME_GUI_PO_CUST methods.

In method POST of badi ME_PROCESS_PO_CUST that's what i wrote:

DATA: li_item_data TYPE STANDARD TABLE OF mepoitem.
DATA: lw_item_prev TYPE mepoitem,

lw_item_data TYPE mepoitem.

LOOP AT li_items ASSIGNING <fs_item>.

lw_item_data = <fs_item>-item->get_data( ).

CALL METHOD <fs_item>-item->get_persistent_data
IMPORTING
ex_data = lw_item_prev.
IF lw_item_prev <> lw_item_data.

lw_item_data-zrevno = c_value.

CALL METHOD <fs_item>-item->set_data
EXPORTING
im_data = lw_item_data.

ENDIF.
ENDLOOP.

But nothing happens and the field is not updated. Is there anything I'm missing ?

Thanks in advance,

María

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

2 Answers

Best Answer
Maria Merino Nov 09, 2016 at 03:51 PM
0

Solved, I need to use fm EXIT_SAPMM06E_013 and EXIT_SAPMM06E_016.

María

Share
10 |10000 characters needed characters left characters exceeded
max bianchi Oct 19, 2016 at 03:07 PM
0

Hi

The method POST is to save data in custom table and not to save data in purchase table (EKKO, EKPO......)

If you have added your field in the additional data screen, it should be all you need to do, I mean if the custom field can be filled manually by the user, you shouldn't need to implement the BADI

Max

Share
10 |10000 characters needed characters left characters exceeded