I am trying to modify the values of WEORA
, BSTAE
in ME21n
tcode upon saving. I've written the code in ME_PROCESS_PO_CUST BADI
, method CHECK
:
DATA: lt_data TYPE PURCHASE_ORDER_ITEMS,
lo_header TYPE REF TO CL_PO_HEADER_HANDLE_MM,
lt_item TYPE REF TO IF_PURCHASE_ORDER_ITEM_MM,
ls_get_item TYPE MEPOITEM,
ls_set_item TYPE MEPOITEM,
lv_firewall TYPE abap_bool.
FIELD-SYMBOLS: <fs_data> TYPE PURCHASE_ORDER_ITEM.
lt_data = im_header->get_items( ).
READ TABLE lt_data ASSIGNING <fs_data> INDEX 1.
IF <fs_data> IS ASSIGNED.
lt_item = <fs_data>-item.
ENDIF.
ls_get_item = lt_item->get_data( ).
ls_get_item-bstae = '0004'.
ls_get_item-weora = abap_true.
CALL METHOD lt_item->set_data
EXPORTING
im_data = ls_get_item.
I tried debugging, but inside the method set_data
there is a condition:
CHECK l_parent->my_ibs_firewall_on EQ mmpur_yes OR
l_parent->my_cust_firewall_on EQ mmpur_yes.
The value of both is initial so it interrupts and doesn't go to the rest of the code. Forced setting them to true
makes all the code execute but update of the fields doesn't work anyway.
It seems that this BADI doesn't work but I made my research and most people use this BADI to update EKPO
fields in ME21n
.
Is there any problem with my code?
Is there other exit I can use to update fields WEORA
and BSTAE
in transaction code ME21N
upon saving?
You have to call method SET_DATAX and then SET_DATA. SET_DATAX , you will mark X to field you want to update values.
Regards, Umar Abdullah