问题描述
我正在尝试修改 ME21n中的
保存时为tcode。我已经在 WEORA
, BSTAE
的值 ME_PROCESS_PO_CUST BADI
中编写了代码,方法为 CHECK
:
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.
我尝试调试,但是在方法 set_data
有条件:
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.
两者的值都是初始值,因此会中断并且不会进入其余代码。强制将它们设置为 true
可以执行所有代码,但无论如何都无法更新字段。
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.
它似乎此BADI无效,但我进行了研究,大多数人都使用此BADI更新 ME21n
EKPO 字段>。
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
.
我的代码有问题吗?
还有其他出口可用来更新字段 WEORA
和 BSTAE $保存后,交易代码为
ME21N
的c $ c>?
Is there other exit I can use to update fields WEORA
and BSTAE
in transaction code ME21N
upon saving?
推荐答案
您必须先调用方法SET_DATAX,然后再调用SET_DATA。
SET_DATAX,您会将X标记为要更新值的字段。
You have to call method SET_DATAX and then SET_DATA. SET_DATAX , you will mark X to field you want to update values.
致谢,
Umar Abdullah
Regards,Umar Abdullah
这篇关于通过ME_PROCESS_PO_CUST更新ME21n tcode中的字段不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!