销售订单 挑库 发放 wsh_picking_batches_pub

这段PL/SQL代码演示了如何调用wsh_picking_batches_pub私有API来创建和释放销售订单拣选批次。通过设置不同参数,如customer_id、order_header_id和autocreate_delivery_flag等,来指定拣选任务的细节,并使用dbms_output.put_line打印返回状态和消息数据。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  DECLARE
   
    l_api_name                       VARCHAR2(30) := 'sale_order_pick';
    l_api_version                   NUMBER   := 1.0;
    l_batch_info_rec                 wsh_picking_batches_pub.Batch_Info_rec;
   
    x_return_status   VARCHAR2(1);
    x_msg_count       NUMBER;
    x_batch_id        NUMBER;
    x_msg_data        VARCHAR2(2000);
    x_pick_result                    varchar2(1);
    l_msg_return           NUMBER;
    x_request_id      NUMBER;
  BEGIN

 
    l_batch_info_rec.backorders_only_flag       := 'E';
    l_batch_info_rec.existing_rsvs_only_flag    := 'N';
    l_batch_info_rec.customer_id                := 37040;
    l_batch_info_rec.order_header_id            := 9775;
--    l_batch_info_rec.inventory_item_id          := l_order_info_rec.inventory_item_id;
--    l_batch_info_rec.order_type_id              := l_order_info_rec.order_type_id;
 --   l_batch_info_rec.pick_grouping_rule_name    := 'BJJF_STANDARD PICKING';
    l_batch_info_rec.from_scheduled_ship_date   := NULL;--to_date('28-07-2010','DD-MM-YYYY');
   -- l_batch_info_rec.to_scheduled_ship_date     :=
   -- l_batch_info_rec.ship_to_location_id        :=
   -- l_batch_info_rec.ship_to_location_code      :=
    l_batch_info_rec.organization_id            := 89;
  --  l_batch_info_rec.ship_from_location_id      := 182;--'BJJF_BCPK.BJJF_0528001.01'
   -- l_batch_info_rec.ship_from_location_code    := 'BJJF_BCPK.BJJF_0528001.01';
   -- l_batch_info_rec.pick_grouping_rule_id      := 1030;
   -- l_batch_info_rec.pick_sequence_rule_id      := 1010;
    l_batch_info_rec.include_planned_lines      := 'N';
    l_batch_info_rec.autocreate_delivery_flag   := 'Y';
    l_batch_info_rec.autodetail_pr_flag         := 'Y';
    l_batch_info_rec.allocation_method          := 'I';
--    l_batch_info_rec.default_stage_subinventory := 'BJJF_DF';
--    l_batch_info_rec.default_stage_locator_id   := 82;
--    l_batch_info_rec.pick_from_subinventory     := l_order_info_rec.subinventory;
    l_batch_info_rec.pick_from_locator_id       := NULL;--182;
    l_batch_info_rec.auto_pick_confirm_flag     := 'N';
    l_batch_info_rec.autopack_flag              := 'N';
   
   
    -- Call Private API
    wsh_picking_batches_pub.Create_Batch(p_api_version   => l_api_version
                                        ,x_return_status => x_return_status
                                        ,x_msg_count     => x_msg_count
                                        ,x_msg_data      => x_msg_data
                                        ,p_batch_rec     => l_batch_info_rec
                                        ,x_batch_id      => x_batch_id);
   
    dbms_output.put_line(x_return_status);  
   
                                
    wsh_picking_batches_pub.Release_Batch(p_api_version   => l_api_version,
                                          x_return_status => x_return_status,
                                          x_msg_count     => x_msg_count,
                                          x_msg_data      => x_msg_data,
                                          p_batch_id      => x_batch_id,
                                          p_release_mode  => 'ONLINE',
                                          x_request_id    => x_request_id);
   
    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;
        
END;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值