码迷,mamicode.com
首页 > 其他好文 > 详细

OM批量发运确认开发

时间:2015-02-03 14:55:32      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:

问题:
1、发运确认会调用接口请求,同一个SO对应几个交货号会报出现锁,
2、请求会存在延时,报表不能输出正确的结果
解决方法:
把发运确认API设置为延迟接口,即p_sc_defer_interface_flag为‘Y’,直接调用连接停靠站存储过程wsh_ship_confirm_actions.interface_all

DECLARE
  --PARAMETER FOR "WSH_DELIVERIES_PUB.Delivery_Action"
  p_api_version_number      NUMBER := 1.0;
  p_init_msg_list           VARCHAR2(30);
  x_msg_count               NUMBER;
  x_msg_data                VARCHAR2(2000);
  p_action_code             VARCHAR2(15) := ‘CONFIRM‘;
  p_delivery_id             NUMBER := 93024;
  p_delivery_name           VARCHAR2(30) := ‘93024‘;
  p_asg_trip_id             NUMBER;
  p_asg_trip_name           VARCHAR2(30);
  p_asg_pickup_stop_id      NUMBER;
  p_asg_pickup_loc_id       NUMBER;
  p_asg_pickup_stop_seq     NUMBER;
  p_asg_pickup_loc_code     VARCHAR2(30);
  p_asg_pickup_arr_date     DATE;
  p_asg_pickup_dep_date     DATE;
  p_asg_dropoff_stop_id     NUMBER;
  p_asg_dropoff_loc_id      NUMBER;
  p_asg_dropoff_stop_seq    NUMBER;
  p_asg_dropoff_loc_code    VARCHAR2(30);
  p_asg_dropoff_arr_date    DATE;
  p_asg_dropoff_dep_date    DATE;
  p_sc_action_flag          VARCHAR2(10) := ‘S‘;
  p_sc_intransit_flag       VARCHAR2(10) := ‘Y‘;
  p_sc_close_trip_flag      VARCHAR2(10) := ‘Y‘;
  p_sc_create_bol_flag      VARCHAR2(10) := ‘N‘;
  p_sc_stage_del_flag       VARCHAR2(10) := ‘Y‘;
  p_sc_trip_ship_method     VARCHAR2(30);
  p_sc_actual_dep_date      DATE;
  p_sc_report_set_id        NUMBER;
  p_sc_report_set_name      VARCHAR2(60);
  p_sc_defer_interface_flag VARCHAR2(60) := ‘Y‘;
  p_sc_send_945_flag        VARCHAR2(60) := ‘N‘;
  p_wv_override_flag        VARCHAR2(10) := ‘N‘;
  x_trip_id                 VARCHAR2(30);
  x_trip_name               VARCHAR2(30);

  --PARAMETERS FOR "WSH_SHIP_CONFIRM_ACTIONS.Interface_ALL"

  errbuf      VARCHAR2(2000);
  retcode     VARCHAR2(3);
  p_mod       VARCHAR2(30) := ‘ALL‘;
  p_stop_id   NUMBER;
  p_log_level NUMBER := 0;
  
  l_msg_return    VARCHAR2(2000);
  x_return_status VARCHAR2(1);

BEGIN
  fnd_global.APPS_INITIALIZE(1371,50627,660);
  
  wsh_deliveries_pub.delivery_action(p_api_version_number      => p_api_version_number,
                                     p_init_msg_list           => p_init_msg_list,
                                     x_return_status           => x_return_status,
                                     x_msg_count               => x_msg_count,
                                     x_msg_data                => x_msg_data,
                                     p_action_code             => p_action_code,
                                     p_delivery_id             => p_delivery_id,
                                     p_delivery_name           => p_delivery_name,
                                     p_asg_trip_id             => p_asg_trip_id,
                                     p_asg_trip_name           => p_asg_trip_name,
                                     p_asg_pickup_stop_id      => p_asg_pickup_stop_id,
                                     p_asg_pickup_loc_id       => p_asg_pickup_loc_id,
                                     p_asg_pickup_stop_seq     => p_asg_pickup_stop_seq,
                                     p_asg_pickup_loc_code     => p_asg_pickup_loc_code,
                                     p_asg_pickup_arr_date     => p_asg_pickup_arr_date,
                                     p_asg_pickup_dep_date     => p_asg_pickup_dep_date,
                                     p_asg_dropoff_stop_id     => p_asg_dropoff_stop_id,
                                     p_asg_dropoff_loc_id      => p_asg_dropoff_loc_id,
                                     p_asg_dropoff_stop_seq    => p_asg_dropoff_stop_seq,
                                     p_asg_dropoff_loc_code    => p_asg_dropoff_loc_code,
                                     p_asg_dropoff_arr_date    => p_asg_dropoff_arr_date,
                                     p_asg_dropoff_dep_date    => p_asg_dropoff_dep_date,
                                     p_sc_action_flag          => p_sc_action_flag,
                                     p_sc_intransit_flag       => p_sc_intransit_flag,
                                     p_sc_close_trip_flag      => p_sc_close_trip_flag,
                                     p_sc_create_bol_flag      => p_sc_create_bol_flag,
                                     p_sc_stage_del_flag       => p_sc_stage_del_flag,
                                     p_sc_trip_ship_method     => p_sc_trip_ship_method,
                                     p_sc_actual_dep_date      => p_sc_actual_dep_date,
                                     p_sc_report_set_id        => p_sc_report_set_id,
                                     p_sc_report_set_name      => p_sc_report_set_name,
                                     p_sc_defer_interface_flag => p_sc_defer_interface_flag,
                                     p_sc_send_945_flag        => p_sc_send_945_flag,
                                     p_wv_override_flag        => p_wv_override_flag,
                                     x_trip_id                 => x_trip_id,
                                     x_trip_name               => x_trip_name);

  IF x_return_status != ‘S‘ THEN
    dbms_output.put_line(‘EEE‘);
    FOR i IN 1..x_msg_count LOOP
      fnd_msg_pub.get(p_msg_index     => i
                     ,p_encoded       => ‘F‘
                     ,p_data          => x_msg_data
                     ,p_msg_index_out => l_msg_return);
      dbms_output.put_line(x_msg_data);
    END LOOP;
    
  ELSE
  
    wsh_ship_confirm_actions.interface_all(errbuf        => errbuf,
                                           retcode       => retcode,
                                           p_mode        => p_mod,
                                           p_stop_id     => p_stop_id,
                                           p_delivery_id => p_delivery_id,
                                           p_log_level   => p_log_level);
  
    IF retcode != ‘0‘ THEN
      dbms_output.put_line(‘E‘);
    ELSE
      dbms_output.put_line(‘S‘);
    END IF;
  END IF;
END;

 

OM批量发运确认开发

标签:

原文地址:http://www.cnblogs.com/cocoolwen/p/4269884.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!