详解EBS接口开发之库存事务处理批次更新

库存事务处理批次有时候出现导入错误需要更新可使用次程序更新,批次导入可参考博客

详解EBS接口开发之库存事务处理-物料批次导入 http://blog.csdn.net/cai_xingyun/article/details/17129243


DECLARE
  l_api_version      NUMBER := 1.0;
  l_init_msg_list    VARCHAR2(100) := fnd_api.g_false; -- bug 7513308;
  l_commit           VARCHAR2(100) := fnd_api.g_false;
  l_validation_level NUMBER := fnd_api.g_valid_level_full;
  l_origin_txn_id    NUMBER := NULL;
  l_source           NUMBER := 2;
  l_return_status    VARCHAR2(1);
  l_msg_data         VARCHAR2(3000);
  l_msg_count        NUMBER;
  l_row_id           ROWID;

  l_count           NUMBER;
  x_mtl_lot_numbers mtl_lot_numbers%ROWTYPE;
  l_mtl_lot_numbers mtl_lot_numbers%ROWTYPE;

  CURSOR cux_inv(p_lot_number IN VARCHAR2) IS
    SELECT l.lot_number, l.lot_date
      FROM oms_inv_lot_number l
     WHERE l.lot_number = p_lot_number;

  CURSOR cur_mtl IS
    SELECT l.inventory_item_id, l.organization_id, l.lot_number
      FROM mtl_lot_numbers l;
BEGIN
  fnd_global.apps_initialize(user_id      => 1110,
                             resp_id      => 20634,
                             resp_appl_id => 401);
  --MO_GLOBAL.set_policy_context(p_access_mode => ‘S‘,p_org_id => 83);
  -- fnd_profile.PUT(NAME =>‘MFG_ORGANIZATION_ID‘ ,VAL => 83);
  FOR rec_mtl IN cur_mtl LOOP
    FOR rec_inv IN cux_inv(p_lot_number => rec_mtl.lot_number) LOOP
      l_mtl_lot_numbers.inventory_item_id := rec_mtl.inventory_item_id;
      l_mtl_lot_numbers.organization_id   := rec_mtl.organization_id;
      l_mtl_lot_numbers.lot_number        := rec_mtl.lot_number;
      l_mtl_lot_numbers.origination_date  := rec_inv.lot_date;
    
      inv_lot_api_pub.update_inv_lot(x_return_status => l_return_status,
                                     x_msg_count     => l_msg_count,
                                     x_msg_data      => l_msg_data,
                                     x_lot_rec       => x_mtl_lot_numbers,
                                     p_lot_rec       => l_mtl_lot_numbers,
                                     p_source        => l_source,
                                     p_api_version   => l_api_version,
                                     p_init_msg_list => l_init_msg_list,
                                     p_commit        => l_commit);
    
    END LOOP;
  END LOOP;

EXCEPTION
  WHEN OTHERS THEN
    dbms_output.put_line(‘---‘ || SQLERRM);
  
END;
SELECT DISTINCT t.origination_date FROM mtl_lot_numbers t;





详解EBS接口开发之库存事务处理批次更新

上一篇:Excel导入其他Excle文件中的某一单元格内容


下一篇:Hadoop 2.2.0版本HDFS的HA配置