IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM:Processing of Item Data 项目数据处理
业务需求:新建THPO类型po交货日期为当前po的创建日期(今天)
1 METHOD if_ex_me_process_po_cust~process_item. 2 *-------------"THPO供应商退货po需求时间是建PO的当日- ------------------------------------------------------* 3 4 DATA: obj_header TYPE REF TO if_purchase_order_mm, 5 re_header TYPE mepoheader, 6 re_item TYPE mepoitem. 7 DATA:gs_ekko TYPE ekko. 8 9 obj_header = im_item->get_header( ). 10 re_header = obj_header->get_data( ). 11 re_item = im_item->get_data( ). 12 13 14 IF sy-tcode = 'ME21N'. 15 CLEAR gs_ekko. 16 SELECT SINGLE * INTO gs_ekko FROM ekko WHERE ebeln = re_header-ebeln. 17 IF sy-subrc <> 0. 18 IF re_header-bsart EQ 'THPO' . 19 CALL FUNCTION 'FORMAT_DATE_4_OUTPUT' 20 EXPORTING 21 datin = sy-datum 22 format = 'YYYY/MM/DD' 23 IMPORTING 24 datex = re_item-eeind. 25 26 re_item-eindt = sy-datum. 27 im_item->set_data( re_item ). 28 ENDIF. 29 ENDIF. 30 ENDIF. 31 32 ENDMETHOD.