Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with new custom field in EKPO when saving purchase order

maria_merino
Active Participant
0 Kudos

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

1 ACCEPTED SOLUTION

maria_merino
Active Participant
0 Kudos

Solved, I need to use fm EXIT_SAPMM06E_013 and EXIT_SAPMM06E_016.

María

2 REPLIES 2

Former Member
0 Kudos

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

maria_merino
Active Participant
0 Kudos

Solved, I need to use fm EXIT_SAPMM06E_013 and EXIT_SAPMM06E_016.

María