declare
p_Delivery_Id Number := 2593105;
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);
Api_Failed Exception;
Begin
dbms_output.enable(3000);
dbms_output.put_line('begin');
FND_GLOBAL.APPS_INITIALIZE(user_id => user_id,
resp_id => resp_id,
resp_appl_id => resp_appl_id);
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 => p_Delivery_Id,
p_sc_rule_id => 1, --ship confirm rule ID:from wsh_ship_confirm_rules where sysdate between nvl(effective_start_date, sysdate) and nvl(effective_end_date, sysdate)
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 => 'N', --ship confirm defer interface flag
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
raise Api_Failed;
end if;
dbms_output.put_line('end');
commit;
Exception
when Api_Failed then
WSH_UTIL_CORE.get_messages('Y',
x_msg_summary,
x_msg_details,
x_msg_count);
if x_msg_count > 1 then
x_msg_data := x_msg_summary || x_msg_details;
else
x_msg_data := x_msg_summary;
end if;
dbms_output.put_line(x_return_status);
dbms_output.put_line(substr(x_Msg_Data, 1, 200));
dbms_output.put_line(substr(x_Msg_Data, 200, 200));
rollback;
When Others Then
dbms_output.put_line('other exception:' || sqlerrm);
rollback;
End Shipping_Confirm;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/797362/viewspace-592580/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/797362/viewspace-592580/

4007

被折叠的 条评论
为什么被折叠?



