Modifying EKPO Fields in ME21n - ME_PROCESS_PO_CUST BADI

早过忘川 提交于 2019-12-11 17:50:04

问题


I am trying to modify the values of field WEORA and BSTAE in ME21n upon saving. I've written my codes in ME_PROCESS_PO_CUST BADI, in method CHECK. Below is my code.

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 it, 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 bot is initial so it doesn't go through the whole set_data code. But I also tried forcing one of them to abap_true (for it to go through the rest of the code) but updating the fields also doesn't work.

It seems like this BADI isn't working but I made my research and most of them uses this BADI to update EKPO fields in ME21n. Is there any problem with my code? And is there other exit I can use to update fields WEORA and BSTAE in transaction code ME21N upon saving?


回答1:


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



来源:https://stackoverflow.com/questions/52877382/modifying-ekpo-fields-in-me21n-me-process-po-cust-badi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!