BADI:ME_PROCESS_REQ_CUST
接口:IF_EX_ME_PROCESS_REQ_CUST
需求:创建采购申请时检查每个行项次的采购组是否一致
method if_ex_me_process_req_cust~check. data:lt_items type mmpur_requisition_items, ls_items type mmpur_requisition_item. data:ls_ekgrp type ekgrp, ls_item_data type mereq_item, ls_item type ref to if_purchase_requisition_item. "获取行项目数据的类 lt_items = im_header->get_items( ). ***手工pr项次中采购组不一致不能保存 loop at lt_items into ls_items. ls_item = ls_items-item. clear ls_item_data. ls_item_data = ls_item->get_data( ). "获取数据 if ls_item_data-bnfpo = '00010'. ls_ekgrp = ls_item_data-ekgrp. else. if ls_ekgrp <> ls_item_data-ekgrp. message '采购组不一致' type 'E'. endif. endif. endloop. endmethod.