订单发运确认api

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/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值