由于客户的PO单是外部系统导入到EBS PO模块,因此会涉及到关闭PO单的操作,可以通过接口关闭PO单。以下是核心代码:
declare
l_action varchar2(100) := 'FINALLY CLOSE';
v_po_header_id number := 1292;
l_return_status varchar2(100);
l_return_code varchar2(100);
l_exc_msg varchar2(100);
l_online_report_id varchar2(100);
p_reasons varchar2(100) := '小潘测试最终关闭PO单';
begin
–初始化
fnd_global.apps_initialize(user_id => 1110, –用户名
resp_id => 50737, –PO职责
resp_appl_id => 201); –PO产品
–调用系统自带功能释放保留款
PO_DOCUMENT_ACTION_PVT.do_manual_close(p_action => l_action,
p_document_id => v_po_header_id,
p_document_type => 'PO',
p_document_subtype => 'STANDARD',
p_line_id => '',
p_shipment_id => '',
p_reason => p_reasons,
p_action_date => to_date(to_char(sysdate,
'DD-MON-YYYY'),
'DD-MON-YYYY'),
p_calling_mode => 'PO',
p_origin_doc_id => NULL,
p_called_from_conc => FALSE,
p_use_gl_date => 'N',
x_return_status => l_return_status,
x_return_code => l_return_code,
x_exception_msg => l_exc_msg,
x_online_report_id => l_online_report_id);
DBMS_OUTPUT.put_line('成功与否标记:' || l_return_status);
DBMS_OUTPUT.put_line('返回代码:' || l_return_code);
DBMS_OUTPUT.put_line('错误消息:' || l_exc_msg);
end;