标签:ebs api
API wsh_deliveries_pub.delivery_action问题点:
1、发运确认会调用接口请求,同一个SO对应几个交货号会报出现锁,
2、请求会存在延时,报表不能输出正确的结果
解决方法:
把发运确认API设置为延迟接口,即p_sc_defer_interface_flag为‘Y’,
然后存储过程中直接调用连接停靠站过程。
declare
--PARAMETER FOR "WSH_DELIVERIES_PUB.Delivery_Action"
x_Return_Status Varchar2(1);
x_Msg_Count Number;
x_Msg_Data Varchar2(3500);
l_Trip_Id Number;
l_Trip_Name Varchar2(40);
x_msg_details VARCHAR2(3000);
x_msg_summary VARCHAR2(3000);
BEGIN
fnd_global.apps_initialize(1371,50627,660);
Wsh_Deliveries_Pub.Delivery_Action(p_Api_Version_Number => 1.0,
p_Init_Msg_List => Fnd_Api.g_True,
x_Return_Status => x_Return_Status,
x_Msg_Count => x_Msg_Count,
x_Msg_Data => x_Msg_Data,
p_Action_Code => ‘CONFIRM‘,
p_Delivery_Id => R2.DELIVERY_ID,
p_sc_rule_id => 21, --发运规则 select * from wsh_ship_confirm_rules
p_sc_action_flag => ‘S‘, --s/a/c/o: Ship entered quantity--option - ‘S‘, ‘B‘, ‘T‘, ‘A‘, ‘C‘
p_sc_stage_del_flag => ‘Y‘, --ship confirm create delivery for staged quantity flag
p_sc_actual_dep_date => sysdate, --ship confirm actual departure date
p_sc_intransit_flag => ‘Y‘, --ship confirm set in-transit flag
p_sc_close_trip_flag => ‘Y‘, --ship confirm close trip flag
p_sc_create_bol_flag => ‘N‘, --ship confirm create BOL flag
p_sc_defer_interface_flag => ‘Y‘, --ship confirm defer interface flag --为‘Y’,手动运行连接停靠站
--p_sc_report_set_id => 6, --Ship Confirm Documents:from wsh_report_sets where usage_code=‘SHIP_CONFIRM‘
x_Trip_Id => l_Trip_Id,
x_Trip_Name => l_Trip_Name);
if (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS and
x_return_status <> ‘W‘) then
rollback;
--raise Api_Failed;
else
--调用连接停靠站请求过程
--defer_interface_flag是‘Y‘,需运行以下接口请求
wsh_ship_confirm_actions.interface_all(errbuf => errbuf2,
retcode => retcode2,
p_mode => p_mod,
p_stop_id => p_stop_id,
p_delivery_id => R2.delivery_id,
p_log_level => p_log_level);
IF retcode != ‘0‘ THEN
rollback;
ELSE
commit;
END IF;
end if;
end;
批量发运确认开发 wsh_deliveries_pub.delivery_action
标签:ebs api
原文地址:http://9966064.blog.51cto.com/9956064/1617311