国内最全IT社区平台 联系我们 | 收藏本站
华晨云阿里云优惠2
您当前位置:首页 > 数据库 > MySql > Oracle EBS创建LPN

Oracle EBS创建LPN

来源:程序员人生   发布时间:2014-10-08 08:00:01 阅读次数:8328次

创建LPN

PROCEDURE create_lpn(errbuf            OUT VARCHAR2,
                     retcode           OUT VARCHAR2 ,
                     p_organization_id IN NUMBER ,
                     p_lpn_prefix      IN VARCHAR2 ,
                     p_lpn_suffix      IN VARCHAR2 ,
                     p_lpn             IN VARCHAR2 ) IS
  BEGIN
    --Initialize
    wms_container_pvt.generate_lpn_cp(errbuf                => errbuf,
                                      retcode               => retcode,
                                      p_api_version         => 1,
                                      p_organization_id     => p_organization_id,
                                      p_container_item_id   => NULL,
                                      p_revision            => NULL,
                                      p_lot_number          => NULL,
                                      p_from_serial_number  => NULL,
                                      p_to_serial_number    => NULL,
                                      p_subinventory        => NULL,
                                      p_locator_id          => NULL,
                                      p_org_parameters      => 2,
                                      p_parm_dummy_1        => 'N',
                                      p_total_length        => NULL,
                                      p_lpn_prefix          => p_lpn_prefix,
                                      p_starting_num        => p_lpn,
                                      p_ucc_128_suffix_flag => 2,
                                      p_parm_dummy_2        => 'N',
                                      p_lpn_suffix          => p_lpn_suffix,
                                      p_quantity            => 1,
                                      p_source              => NULL,
                                      p_cost_group_id       => NULL);
  END;

-- --------------------------------------------
  -- Get LPN Id
  -- --------------------------------------------
  PROCEDURE get_lpn_id(x_lpn_id OUT NUMBER , p_lpn IN VARCHAR2) IS
    --l_lpn_exist NUMBER;
  BEGIN
    x_lpn_id := - 9999;
    SELECT lpn.lpn_id
      INTO x_lpn_id
      FROM wms_license_plate_numbers lpn
     WHERE 1 = 1
       AND lpn.license_plate_number = p_lpn;
 
  EXCEPTION
    WHEN no_data_found THEN
      x_lpn_id := - 1; --LPN不存在
    WHEN OTHERS THEN
      x_lpn_id := - 9999;
  END;

--创建LPN
--检查LPN是否存在
get_lpn_id(l_outer_lpn_id, p_n_lpn_num);
--拆分LPN号
SELECT substr (p_n_lpn_num, -1),
       substr(p_n_lpn_num, 1 , length(p_n_lpn_num) - 1)
  INTO l_lpn_number, l_lpn_prefix
  FROM dual;
--创建LPN
IF l_outer_lpn_id = -1 THEN
  create_lpn(errbuf            => l_errbuf,
             retcode           => l_retcode,
             p_organization_id => p_organization_id,
             p_lpn_prefix      => l_lpn_prefix,
             p_lpn_su
生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠
程序员人生
------分隔线----------------------------
分享到:
------分隔线----------------------------
关闭
程序员人生