当前位置:  数据库>oracle

Oracle EBS 销售时物料保留出错相关症状和处理方法

    来源: 互联网  发布时间:2017-04-09

    本文导语:  之前,我在Oracle EBS R12版本中遇到过销售订单发运时"物料保留出错",伴随着物料事处处理接口错误和发运事务处事处理不了背景:销售订单发运事务处理或销售订发放,子库存的保留和物料事务处理出错.主要症状:1.INV:物料保留窗体...

之前,我在Oracle EBS R12版本中遇到过销售订单发运时"物料保留出错",伴随着物料事处处理接口错误和发运事务处事处理不了
背景:
销售订单发运事务处理或销售订发放,子库存的保留和物料事务处理出错.
主要症状:
1.INV:物料保留窗体中的
2.INV:物料事务处理接口错误解释""
3.OM:发运事务处理下一步为"运行接口"
4.AR:应收事务处理已经正常产生
若以上没有第1个症状的情况,还是比较简单方法去"系统管理员"提交""(Workflow Background Process)就可以处理;当第1个症状时,若保留中的数量与发运事务处理发运数一致比较好办,也可以提交一下""(Workflow Background Process)试一试.但是,若保留中的数量与发运事务处理发运数不一致,则麻烦太了.这个错误是Oracle EBS的BUG,公司提交SR,半个月Oracle的也没有回复这事处理.做事效率也太低了.真是"店大欺负客,客大欺店"呀!
原因:.
我们公司用户太NB了,一个订单行拆分成70多行致导保留出错.
解决方法:只能通过保留API来改修或新增销售订单的保留.
1.找到SO发运事务处理订单行要保留的数量,找出哪一些保留是要修改或新增.











SELECT oeh.org_id ou_id,
       hou.NAME ou_name,
       mso.concatenated_segments header_number,
       oel.line_number || '.' || oel.shipment_number ||
       decode(oel.option_number, NULL, NULL, '.' || oel.option_number) ||
       decode(oel.component_number, NULL, NULL, '.' || oel.component_number) ||
       decode(oel.service_number, NULL, NULL, '.' || oel.service_number) line,
       mst.segment1 item_code,
       oel.flow_status_code status_code,
       lov.meaning status_name,
       rsv.organization_id,
       ood.organization_code,
       ood.organization_name,
       rsv.subinventory_code,
       rsv.requirement_date,
       rsv.reservation_quantity,
       rsv.reservation_uom_code,
       rsv.staged_flag,
       oel.ordered_quantity,
       oel.shipped_quantity,
       oel.shipping_quantity
  FROM inv.mtl_reservations              rsv,
       inv.mtl_system_items_b            mst,
       apps.mtl_sales_orders_kfv         mso,
       ont.oe_order_lines_all            oel,
       ont.oe_order_headers_all          oeh,
       apps.fnd_lookup_values_vl         lov,
       apps.org_organization_definitions ood,
       apps.hr_operating_units           hou
 WHERE rsv.organization_id = mst.organization_id
   AND rsv.inventory_item_id = mst.inventory_item_id
   AND rsv.demand_source_header_id = mso.sales_order_id
   AND rsv.demand_source_line_id = oel.line_id
   AND oel.header_id = oeh.header_id
   AND lov.lookup_type = 'LINE_FLOW_STATUS'
   AND oel.flow_status_code = lov.lookup_code
   AND rsv.organization_id = ood.organization_id
   AND oeh.org_id = hou.organization_id
   AND rsv.demand_source_type_id = 2 --需求2是销售定单,具体看inv.mtl_txn_source_types
   AND rsv.supply_source_type_id = 13 --供应13是库存,具体看inv.mtl_txn_source_types
   AND rsv.reservation_quantity = 0 --数量为0
   AND nvl(rsv.staged_flag, 'N') 'Y' --未到待发库
   AND oel.flow_status_code = 'AWAITING_SHIPPING' --状态是等待发运
   AND oeh.org_id = 88
 ORDER BY hou.NAME, ood.organization_code











































2.对于一些发运事务处理订单行没有产生保留,要用保留API添加销售订单的保留量,处理SQL
DECLARE
  p_rsv_rec           inv_reservation_global.mtl_reservation_rec_type;
  p_serial_number     inv_reservation_global.serial_number_tbl_type;
  x_return_status     VARCHAR2(1);
  x_msg_count         NUMBER;
  x_msg_data          VARCHAR2(2000);
  x_serial_number     inv_reservation_global.serial_number_tbl_type;
  x_quantity_reserved NUMBER;
  x_reservation_id    NUMBER;
  Cursor Cr is
    Select MMT.Creation_Date - + (-15 / 24 / 60) REQUIREMENT_DATE,
           MMT.ORGANIZATION_ID,
           MMT.INVENTORY_ITEM_ID,
           2 DEMAND_SOURCE_TYPE_ID,
           MMT.SOURCE_LINE_ID,
           MMT.TRANSACTION_UOM,
           -1 * Sum(MMT.TRANSACTION_QUANTITY) TRANSACTION_QUANTITY,
           13 SUPPLY_SOURCE_TYPE_ID,
           MMT.SUBINVENTORY_CODE,
           MMT.TRANSACTION_SOURCE_ID
      From MTL_TRANSACTIONS_INTERFACE MMT, MTL_RESERVATIONS_ALL_V MRA
     Where MMT.ORGANIZATION_ID = 429
       And MMT.SOURCE_CODE = 'ORDER ENTRY'
       And MMT.ORGANIZATION_ID = MRA.ORGANIZATION_ID(+)
       And MMT.SOURCE_LINE_ID = MRA.DEMAND_SOURCE_LINE_ID(+)
       And MRA.RESERVATION_ID Is Null
       --And MMT.SOURCE_LINE_ID = 664042
     Group By MMT.Creation_Date - + (-15 / 24 / 60),
              MMT.ORGANIZATION_ID,
              MMT.INVENTORY_ITEM_ID,
              MMT.SOURCE_LINE_ID,
              MMT.TRANSACTION_UOM,
              MMT.SUBINVENTORY_CODE,
              MMT.TRANSACTION_SOURCE_ID; ---221111040022
BEGIN
  For Rs In Cr Loop
    p_rsv_rec.reservation_id               := NULL;
    p_rsv_rec.requirement_date             := Rs.REQUIREMENT_DATE;
    p_rsv_rec.organization_id              := Rs.ORGANIZATION_ID;
    p_rsv_rec.inventory_item_id            := Rs.INVENTORY_ITEM_ID;
    p_rsv_rec.demand_source_type_id        := Rs.DEMAND_SOURCE_TYPE_ID;
    p_rsv_rec.demand_source_name           := NULL;
    p_rsv_rec.demand_source_header_id      := Rs.TRANSACTION_SOURCE_ID;
    p_rsv_rec.demand_source_line_id        := Rs.SOURCE_LINE_ID;
    p_rsv_rec.demand_source_delivery       := NULL;
    p_rsv_rec.primary_uom_code             := NULL;
    p_rsv_rec.primary_uom_id               := NULL;
    p_rsv_rec.reservation_uom_code         := Rs.TRANSACTION_UOM;
    p_rsv_rec.reservation_uom_id           := NULL;
    p_rsv_rec.reservation_quantity         := Rs.TRANSACTION_QUANTITY;
    p_rsv_rec.primary_reservation_quantity := NULL;
    p_rsv_rec.detailed_quantity            := NULL;
    p_rsv_rec.autodetail_group_id          := NULL;
    p_rsv_rec.external_source_code         := NULL;
    p_rsv_rec.external_source_line_id      := NULL;
    p_rsv_rec.supply_source_type_id        := Rs.SUPPLY_SOURCE_TYPE_ID;
    p_rsv_rec.supply_source_header_id      := NULL;
    p_rsv_rec.supply_source_line_id        := NULL;
    p_rsv_rec.supply_source_name           := NULL;
    p_rsv_rec.supply_source_line_detail    := NULL;
    p_rsv_rec.revision                     := NULL;
    p_rsv_rec.subinventory_code            := Rs.SUBINVENTORY_CODE;
    p_rsv_rec.subinventory_id              := NULL;
    p_rsv_rec.locator_id                   := NULL;
    p_rsv_rec.lot_number                   := NULL;
    p_rsv_rec.lot_number_id                := NULL;
    p_rsv_rec.pick_slip_number             := NULL;
    p_rsv_rec.lpn_id                       := NULL;
    p_rsv_rec.ship_ready_flag              := NULL;
    p_rsv_rec.attribute_category           := NULL;
    p_rsv_rec.attribute1                   := NULL;
    p_rsv_rec.attribute2                   := NULL;
    p_rsv_rec.attribute3                   := NULL;
    p_rsv_rec.attribute4                   := NULL;
    p_rsv_rec.attribute5                   := NULL;
    p_rsv_rec.attribute6                   := NULL;
    p_rsv_rec.attribute7                   := NULL;
    p_rsv_rec.attribute8                   := NULL;
    p_rsv_rec.attribute9                   := NULL;
    p_rsv_rec.attribute10                  := NULL;
    p_rsv_rec.attribute11                  := NULL;
    p_rsv_rec.attribute12                  := NULL;
    p_rsv_rec.attribute13                  := NULL;
    p_rsv_rec.attribute14                  := NULL;
    p_rsv_rec.attribute15                  := NULL;
   
    Update OE_ORDER_LINES_ALL
       Set open_flag = 'Y'
     Where LINE_ID = Rs.SOURCE_LINE_ID;
    inv_reservation_pub.create_reservation(p_api_version_number       => '1.0',
                                           p_init_msg_lst             => fnd_api.g_true,
                                           x_return_status            => x_return_status,
                                           x_msg_count                => x_msg_count,
                                           x_msg_data                 => x_msg_data,
                                           p_rsv_rec                  => p_rsv_rec,
                                           p_serial_number            => p_serial_number,
                                           x_serial_number            => x_serial_number,
                                           p_partial_reservation_flag => fnd_api.g_true,
                                           p_force_reservation_flag   => fnd_api.g_false,
                                           p_validation_flag          => fnd_api.g_true,
                                           x_quantity_reserved        => x_quantity_reserved,
                                           x_reservation_id           => x_reservation_id);
        
    IF x_return_status = fnd_api.g_ret_sts_success THEN
      dbms_output.put_line('Reservation Created Successfully! Reservation ID: ' ||
                           x_reservation_id);
    ELSE
      ROLLBACK;
      dbms_output.put_line('Return Status: ' || x_return_status);
      fnd_msg_pub.count_and_get(p_count => x_msg_count,
                                p_data  => x_msg_data);
      dbms_output.put_line('Error count  : ' || to_char(x_msg_count));
      dbms_output.put_line(REPLACE(x_msg_data, chr(0), ' '));
      FOR i IN 2 .. x_msg_count LOOP
        x_msg_data := fnd_msg_pub.get;
        dbms_output.put_line(REPLACE(x_msg_data, chr(0), ' '));
      END LOOP;
   
    END IF;
  End Loop;
END;























































































































3.对一些发运事务处理的订单行保留数量与发运数量不一致的,要用保留的API修改订单的保留量,处理的SQL
DECLARE
  p_original_rsv_rec       inv_reservation_global.mtl_reservation_rec_type;
  p_to_rsv_rec             inv_reservation_global.mtl_reservation_rec_type;
  p_original_serial_number inv_reservation_global.serial_number_tbl_type;
  p_to_serial_number       inv_reservation_global.serial_number_tbl_type;
  x_return_status          VARCHAR2(1);
  x_msg_count              NUMBER;
  x_msg_data               VARCHAR2(2000);
  x_quantity_reserved      NUMBER;
  x_secondary_quantity_reserved Number;
  Cursor Cr is
    Select MRA.RESERVATION_ID,
           MMT.TRANSACTION_UOM,
           -1 * Sum(MMT.TRANSACTION_QUANTITY) TRANSACTION_QUANTITY,
           MMT.TRANSACTION_SOURCE_ID
      From MTL_TRANSACTIONS_INTERFACE MMT, MTL_RESERVATIONS_ALL_V MRA
     Where MMT.ORGANIZATION_ID = 429
       And MMT.SOURCE_CODE = 'ORDER ENTRY'
       And MMT.ORGANIZATION_ID = MRA.ORGANIZATION_ID(+)
       And MMT.SOURCE_LINE_ID = MRA.DEMAND_SOURCE_LINE_ID(+)
       And MRA.RESERVATION_ID Is Not Null
     
       ---And MMT.SOURCE_LINE_ID = 662459
     Group By MRA.RESERVATION_ID, MMT.TRANSACTION_UOM,MMT.TRANSACTION_SOURCE_ID;
BEGIN
  For Rs In Cr Loop
    p_original_rsv_rec.reservation_id := Rs.RESERVATION_ID;
    p_to_rsv_rec.reservation_uom_code := Rs.TRANSACTION_UOM;
    p_to_rsv_rec.reservation_quantity := Rs.TRANSACTION_QUANTITY;
    p_to_rsv_rec.demand_source_header_id :=Rs.TRANSACTION_SOURCE_ID;
   
    inv_reservation_pub.update_reservation(p_api_version_number       => '1.0',
                                           p_init_msg_lst             => fnd_api.g_true,
                                           x_return_status            => x_return_status,
                                           x_msg_count                => x_msg_count,
                                           x_msg_data                 => x_msg_data,
                                           x_quantity_reserved        => x_quantity_reserved,
                                           x_secondary_quantity_reserved=>x_secondary_quantity_reserved, 
                                           p_original_rsv_rec         => p_original_rsv_rec,
                                           p_to_rsv_rec               => p_to_rsv_rec,
                                           p_original_serial_number   => p_original_serial_number,
                                           p_to_serial_number         => p_to_serial_number,
                                           p_validation_flag          => fnd_api.g_true,
                                           p_partial_reservation_flag => fnd_api.g_false,
                                           p_check_availability       => fnd_api.g_false);
 
    IF x_return_status = fnd_api.g_ret_sts_success THEN
      dbms_output.put_line('Reservation Updated Successfully! New Quantity: ' ||
                           x_quantity_reserved);
    ELSE
      ROLLBACK;
      dbms_output.put_line('Return Status: ' || x_return_status);
      fnd_msg_pub.count_and_get(p_count => x_msg_count,
                                p_data  => x_msg_data);
      dbms_output.put_line('Error count  : ' || to_char(x_msg_count));
      dbms_output.put_line(REPLACE(x_msg_data, chr(0), ' '));
      FOR i IN 2 .. x_msg_count LOOP
        x_msg_data := fnd_msg_pub.get;
        dbms_output.put_line(REPLACE(x_msg_data, chr(0), ' '));
      END LOOP;
   
    END IF;
  end loop;
END;































































目前,我们公司没有出现过有保留量是要删除的,也可以通过保留API删除.



    
 
 

您可能感兴趣的文章:

  • Linux下安装oracle11gr2出错,求帮助!
  • linux7.1 安装 oracle8.1.7 出错
  • Linux下安装了Oracle10g,启动出错
  • linux下oracle的console出错,怎么办?
  • RD9安全oracle817出错?
  • Oracle数据库并行查询出错的解决方法
  • AS3安装Oracle 9.2.0前,打补丁出错,导致系统无法引导.大侠们帮忙
  • linux下安装oracle出错啦!!!不知道怎么解决,帮忙看看好吗?
  • Linux下oracle如何 建库建表出错???
  • 使用jspsamrtupload上载文件到oracle出错?Help me!
  • 一个连oracle的servlet,oracle在另一台机器上,为何出错??
  • 快一个月了,我参考了所有的安装帖子,下了所有的补丁,Oracle安装依然出错。为什么??想哭。
  • rs.last()为什么会出错?(jsp,jrun,jdbc,oracle)
  • Oracle数据更改后出错的解决方法
  • jsp向oracle数据库插入图片出错!急!为什么?
  • 安装oracle8.1.7 在linux9.0上出错
  • solaris 10 下用OCCI操作oracle 10g链接出错!!!
  • Oracle 11gR2 netca 无法启动出错解决
  •  
    本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
    本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • Oracle 12c发布简单介绍及官方下载地址
  • 在linux下安装oracle,如何设置让oracle自动启动!也就是让oracle那个服务自动启动,不是手动的
  • oracle 11g最新版官方下载地址
  • 请问su oracle 和su - oracle有什么不同?
  • Oracle 数据库(oracle Database)Select 多表关联查询方式
  • 虚拟机装Oracle R12与Oracle10g
  • Oracle数据库(Oracle Database)体系结构及基本组成介绍
  • Oracle 数据库开发工具 Oracle SQL Developer
  • 如何设置让Oracle SQL Developer显示的时间包含时分秒
  • Oracle EBS R12 支持 Oracle Database 11g
  • Oracle 10g和Oracle 11g网格技术介绍
  • SCO unix下安装oracle,但没有光盘,请大家推荐一个oracle下载站点(unix版本的)。谢谢!!!!
  • oracle中如何把表中具有相同值列的多行数据合并成一行
  • 请问大家用oracle数据库, 用import oracle.*;下的东西么? 还是用标准库?
  • Oracle 数据库(oracle Database)性能调优技术详解
  • Linux /$ORACLE_HOME $ORACLE_HOME
  • ORACLE日期相关操作
  • Linux系统下Oracle的启动与Oracle监听的启动
  • ORACLE数据库常用字段数据类型介绍
  • 请问在solaris下安装ORACLE,用root用户和用oracle用户安装有什么区别么?
  • Oracle 12c的九大最新技术特性介绍
  • 网间Oracle的连接,远程连接Oracle服务器??


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,,E-mail:www_#163.com(请将#改为@)

    浙ICP备11055608号-3