一、采购订单创建修改增强
BADI:ME_PROCESS_PO_CUST
通过POST方法中的参数im_header,获取对应的数据
订单头
*Get header CALL METHOD im_header->get_data RECEIVING re_data = header. *获取长文本 REFRESH ex_textlines. CALL METHOD im_header->if_longtexts_mm~get_text EXPORTING im_tdid = im_tdid IMPORTING ex_textlines = ex_textlines.
订单行
"获取行 *Get Item CALL METHOD im_header->get_items RECEIVING re_items = items_data. LOOP AT items_data INTO item_data. ** First get Item Object, Second fill item data "获取行对象 item_obj = item_data-item. "获取行字段值 CALL METHOD item_obj->get_data RECEIVING re_data = item. "获取行长文本 REFRESH ex_textlines. CALL METHOD item_obj->if_longtexts_mm~get_text EXPORTING im_tdid = im_tdid IMPORTING ex_textlines = ex_textlines. ENDLOOP.
计划行
"获取计划行 CALL METHOD item_obj->get_schedules RECEIVING re_schedules = schedules_data. LOOP AT schedules_data INTO schedule_data. schedule_obj = schedule_data-schedule. CALL METHOD schedule_obj->get_data RECEIVING re_data = schedule. ENDLOOP.
二、采购订单审批同步外围系统增强
函数:ME_PURCHASE_DOCUMENT_DATA_SAVE
调用接口同步数据到外围系统
ENHANCEMENT 1 ZME28. "active version "采购订单审批发送SRM接口 CALL FUNCTION 'Z_XXX' "IN BACKGROUND TASK DESTINATION 'NONE' EXPORTING i_ekko = E_EKKO. ENDENHANCEMENT.