一、查看訂單行狀態(tài):在查看行狀態(tài),發(fā)現(xiàn)已經(jīng)關閉了,但是INVOICE_INTERFACE_STATUS_CODE = NOT_ELIGIBLE INVOICED_QUANTITY = NULL SELECT ool.fulfilled_quantity, ool.invoice_interface_status_code, ool.open_flag, ool.flow_status_code, ool.line_id, ool.invoiced_quantity, ool.ordered_quantity, ooh.order_number FROM oe_order_headers_all ooh, oe_order_lines_all ool WHERE 1 = 1 AND ooh.header_id = ool.header_id AND ooh.org_id = 81 AND ool.line_id = 131959; 二、查看訂單行工作流狀態(tài):SELECT ias.item_type , ias.item_key , pa.instance_label , ias.activity_result_code result , ias.activity_status FROM wf_item_activity_statuses ias, wf_process_activities pa WHERE 1 = 1 AND ias.item_type LIKE 'OEOL' AND ias.item_key LIKE '131959' --AND pa.instance_label LIKE 'instance_label' AND ias.process_activity = pa.instance_id --AND ias.activity_status = 'ERROR' ORDER BY ias.item_key, ias.begin_date 三、運行導入接口表:DECLARE l_result_out VARCHAR2(30); l_return_status VARCHAR2(30); CURSOR cur_order_info IS SELECT line_id FROM oe_order_lines_all WHERE line_id = 131959; BEGIN fnd_global.apps_initialize(user_id => 1292, resp_id => 50830, resp_appl_id => 222); mo_global.init('S', 81); FOR rec IN cur_order_info LOOP UPDATE oe_order_lines_all SET invoiced_quantity = NULL, invoice_interface_status_code = NULL, --fulfilled_quantity = ordered_quantity, --非銷退不要更新 open_flag = 'N', flow_status_code = 'CANCELLED', last_updated_by = -1, last_update_date = SYSDATE WHERE line_id = rec.line_id; DELETE FROM ra_interface_lines_all WHERE interface_line_attribute6 = to_char(rec.line_id); DELETE FROM ra_interface_salescredits_all WHERE interface_line_attribute6 = to_char(rec.line_id); COMMIT; oe_invoice_pub.interface_line(rec.line_id, 'OEOL', l_result_out, l_return_status); dbms_output.put_line(to_char(rec.line_id) || '+' || l_result_out || '+' ||l_return_status); commit; END LOOP; END; 運行之后,查看狀態(tài)(已連接至應收款管理系統(tǒng)),已經(jīng)成功插入接口表中 四、跑INVOICE_INTERFACE工作流:由于工作流中的interface 都是未完成,需要更改工作流狀態(tài)(運行本程序后,請等5-10分鐘,讓系統(tǒng)的工作流跑完) BEGIN fnd_global.apps_initialize(user_id => 1292, resp_id => 50830, resp_appl_id => 222); mo_global.init('S', 81); wf_engine.handleerror(itemtype => 'OEOL', itemkey => 131959, activity => 'INVOICE_INTERFACE', command => 'RETRY', RESULT => NULL); commit; END; 運行之后,查看訂單行狀態(tài),已經(jīng)關閉。 查看訂單行工作流狀態(tài),如下圖所示: 五、跑CLOSE_LINE工作流:
|
|
來自: daizhengya > 《OM_銷售模塊》