2009年10月7日 星期三

[OM] 訂單Line狀態:AWAITING INVOICE INTERFACE - PENDING COMPLETE DELIVERY

環境:EBS 11.5.10.2

簡述:訂單已出貨成功,存貨帳已扣,AR INTERFACE 無資料,懷疑workflow拋轉

            失敗沒Rollback。經過Load TAR後,測試結果是workflow拋轉另一張訂單失

            敗造成同一批次的其他單子卡單。

解決方案:

1. 先select wf_item_activity_statuses_v,找出error的order line id。

2.

set serveroutput on
Declare
l_line_id NUMBER := &line_id;
l_org_id NUMBER;
l_count NUMBER;
l_result VARCHAR2(30);
l_activity_label VARCHAR2(30);
l_file_val VARCHAR2(200);

Begin

fnd_client_info.set_org_context('&org_id');
oe_debug_pub.debug_on;
oe_debug_pub.initialize;
l_file_val := OE_DEBUG_PUB.Set_Debug_Mode('FILE');
oe_debug_pub.setdebuglevel(5);

select activity_label
into l_activity_label
from wf_item_activity_statuses_v
where item_type='OEOL'
and activity_name = 'INVOICE_INTERFACE'
and activity_status_code = 'ERROR'
and item_key = to_char(l_line_id);

dbms_output.put_line('activity label : '||l_activity_label);

OE_Standard_WF.OEOL_SELECTOR
(p_itemtype => 'OEOL'
,p_itemkey => to_char(l_line_id)
,p_actid => 12345
,p_funcmode => 'SET_CTX'
,p_result => l_result
);

wf_engine.handleError('OEOL', to_char(l_line_id), l_activity_label, 'RETRY',nu
ll);
dbms_output.put_line('File name '||OE_DEBUG_PUB.G_DIR||'/'||OE_DEBUG_PUB.G_FILE);
End;
/
commit;