Skip to Content
0
Oct 01, 2009 at 06:12 AM

Trigger badi after giving data in custom tab of po item

109 Views

Hi,

We have added custom tab in po item level, now we want to make those fields manditory

for specific document type.We are using badi ME_PROCESS_PO_CUST .

The message is getting triggered initially , but after giving data in the custom fields the badi

is not getting triggered again.And triggers if we make changes to some other fields in po.

So can we trigger the badi after giving data in custom tab ?

I was trying something like this.

method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM .

  DATA: l_if_header TYPE REF TO if_purchase_order_mm,
        ls_header TYPE mepoheader,
       ls_mepoitem TYPE mepoitem,
  l_if_header = im_item->get_header( ).
  ls_header   = l_if_header->get_data( ).
  CALL METHOD im_item->get_data
    RECEIVING
      re_data = ls_mepoitem.
IF ls_header-bsart = 'BW'.
if ls_mepoitem-ZZONAME IS INITIAL.
MESSAGE 'Plz enter Operator name in custom data' TYPE 'E'.
 endif.
endif.
endmethod.

Any pointers are welcome..