[置顶] Oracle EBS子库存转移,项目转移whole LPN


WMS中整箱进行子库存转移和项目转移:
将货位上的物料整箱的进行转移

IF   l_status = fnd_api.g_ret_sts_success   THEN
        dbms_output.put_line(   'start subtransfer' );
        l_trx_hdr_id     := mtl_material_transactions_s.nextval;
        l_lpn_trx_result := inv_trx_util_pub.insert_line_trx(p_trx_hdr_id      => l_trx_hdr_id,
                                                             p_cnt_lpn_id      => l_lpn_id,
                                                             p_from_lpn_id     =>   NULL   ,
                                                             p_xfr_lpn_id      =>   NULL   ,
                                                             p_org_id          => l_organization_id,
                                                             p_subinv_code     => l_subinv_code,   -- 来源子库
                                                             p_tosubinv_code   => i.dest_subinventory_name,   --
                                                             p_locator_id      => l_locator_id,   -- 来源货位
                                                             p_tolocator_id    => l_to_locator_id,
                                                             p_item_id         => - 1 ,   --
                                                             p_uom             =>   'X' ,   -- 没填
                                                             p_trx_action_id   =>   2   ,
                                                             p_trx_type_id     =>   2   ,
                                                             p_trx_src_type_id =>   13   ,
                                                             p_trx_src_id      =>   NULL   ,
                                                             p_trx_qty         => - 1 ,
                                                             p_pri_qty         => - 1 ,
                                                             p_date            =>   SYSDATE ,
                                                             p_user_id         => - 1 ,
                                                             x_trx_tmp_id      => x_trx_tmp_id,
                                                             x_proc_msg        => x_proc_msg);
     
          IF   l_lpn_trx_result = - 1   THEN
          l_status  := fnd_api.g_ret_sts_error;
          l_message :=   '子库存转移出错:'   || x_proc_msg;
          END   IF   ;
        END   IF   ;
   
        IF   l_status = fnd_api.g_ret_sts_success   THEN
        l_lpn_trx_result := inv_lpn_trx_pub.process_lpn_trx(p_trx_hdr_id         => l_trx_hdr_id,
                                                            p_business_flow_code =>   20   ,
                                                            x_proc_msg           => x_proc_msg);
     
          IF   l_lpn_trx_result = - 1   THEN
          l_status  := fnd_api.g_ret_sts_error;
          l_message :=   'Error in inv_trx_util_pub.process_lpn_trx:'   ||
                       x_proc_msg;
          END   IF   ;
        END   IF   ;

你可能感兴趣的:(oracle,sql,ebs,转移,子库存)