05-11-2017 8:03 AM
Hi Experts, I need to add validation on while creating/changing PO, On SERVICE TAB which is available in ITEM , service no would be related to same material group which is given in line item at item over view. I am using BADI- ME_PROCESS_PO_CUST .
Kindly help me, how will i get service tab data .
Regards,
01-03-2024 9:14 PM
For people who are looking for the answer
METHOD if_ex_me_process_po_cust~check.
DATA: lt_items TYPE purchase_order_items,
ls_items TYPE purchase_order_item,
lo_item TYPE REF TO cl_po_item_handle_mm,
lti_esll TYPE mmsrv_esll.
lt_items = im_header->get_items( ).
LOOP AT lt_items INTO ls_items.
CLEAR: lo_item,
lti_esll.
lo_item ?= ls_items-item.
" Get services
CALL METHOD lo_item->if_services_mm~get_srv_data
EXPORTING
im_packno = ls_item_data-packno
IMPORTING
ex_esll = lti_esll
EXCEPTIONS
failure = 1
OTHERS = 2.
ENDLOOP.
ENDMETHOD.