[问题]采购订单取消API报错

[复制链接]
查看11 | 回复1 | 2016-1-14 21:17:02 | 显示全部楼层 |阅读模式
本帖最后由 objmodel 于 2016-10-19 15:43 编辑
EBS版本:11.5.2.0
数据库版本:9i
测试脚本:
DECLARE
x_return_status VARCHAR2(30);
l_msg_dataVARCHAR2(3000);
l_msg_index NUMBER;
BEGIN
/* fnd_global.apps_initialize(6712, 53518, 201);*/
apps.fnd_global.apps_initialize(user_id=> 1918

,resp_id=> 52281

,resp_appl_id => 201);
/*dbms_application_info.set_client_info('456');*/
po_document_control_pub.control_document(p_api_version=> 1.0

,p_init_msg_list=> fnd_api.g_true

,p_commit => fnd_api.g_true

,x_return_status=> x_return_status

,p_doc_type => 'PO' -- 'PO','PA','RELEASE'

,p_doc_subtype=> 'STANDARD' --'BLANKET','STANDARD','SCHEDULED'

,p_doc_id => NULL /*295556*/

,p_doc_num
=> '116101900000003' /*NULL*/

,p_release_id => NULL

,p_release_num=> NULL

,p_doc_line_id=> NULL /*1294613*/

,p_doc_line_num => NULL

,p_doc_line_loc_id=> NULL

,p_doc_shipment_num => NULL

,p_action => 'CANCEL'

,p_action_date=> to_date('2016-10-20','YYYY-MM-DD')

,p_cancel_reason=> NULL

,p_cancel_reqs_flag => 'N'

,p_print_flag => NULL

,p_note_to_vendor => NULL);
dbms_output.put_line('x_return_status:' || x_return_status);
FOR i IN 1 .. fnd_msg_pub.count_msg LOOP
fnd_msg_pub.get(p_msg_index => i

,p_encoded => fnd_api.g_false

,p_data
=> l_msg_data

,p_msg_index_out => l_msg_index);
dbms_output.put_line(l_msg_data);
END LOOP;
END;
复制代码
报错信息:
单据控制因 [DOCMGR-CANCEL] 中的错误而失败,返回代码 = [OTHER]。
回复

使用道具 举报

千问 | 2016-1-14 21:17:02 | 显示全部楼层
這問題Metalink還滿多點的。大概歸類以下幾個:
1、環境變數定義錯誤(RESP_ID與CANCEL PO廠別不符)
fnd_global.apps_initialize (user_id =>&user_id, resp_id =>&resp_id, resp_appl_id =>201);
dbms_application_info.set_client_info(&org_id);
mo_global.init('PO');
2、欄位類型定義錯誤。
儘量用PO_HEADER_ID、PO_LINE_ID不要用單號或者項次號。
3、狀態錯誤。
CANCEL的單據一定需為Approved且Cancel_FLAG=N
先以上述測試看看...若還是有問題~~土法煉鋼就是用PLSQL D-BUG看到底死在哪囉!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行