您的位置:首页 > 博客中心 > 数据库 >

Oracle EBS OM RMA销售退货异常处理(Datafix)

时间:2022-03-14 02:10

系统版本:

      RDBMS : 9.2.0.6.0
     Oracle 应用产品 : 11.5.10.2

问题症状:

      1.通过物料事务处理查看销售订单行退货记录显示已经入库为40;
gxlsystem.com,布布扣
      2.销售退货订单行已经接收入库。但是,订单行状态仍然是“等待退货”,发运数量为空;
gxlsystem.com,布布扣
      3.销售退货仍然能做RMA接收40数量。但是,查看接收事务处理记录显示已经接收入库了;
gxlsystem.com,布布扣
      4.AR接口行和AR事务处理没有找到对应销售退货订单行的记录;
      5.销售退货订单行工作流报错;
gxlsystem.com,布布扣

      EBS群下的朋友说要Datafix。但是,遗憾的是没有提供具体的解决方案和PLSQL代码。也朋友建议尝试如下操作

     1.选中对应订单行,“右击”分别选择“订单进程”和“重试出错的活动”,查看对应订单行的工作流的活动“等待接收”状态仍然是“错误”。

      2.“状态监控程序”查找到对应的销售退货订单行的工作流并且做“重试”操作。但是,该方法还是不行。然后,我就开始自作聪明做工作流程“倒退”也是不行,接着又“更新属性”,折腾好久,问题仍然没有解决。

在度娘上好搜索好久,也试用了好多关键没有找到想要的结果。

       没有办法,借用朋友的账号上Oracle EBS官方上查找处理方法,最后查找到有一个SR与我们问题症状相似,RMA LINE STUCK IN "AWAITING_RETURN" OR "AWAITING_RETURN_DISPOSITION" (文档 ID 378221.1)网址:

       由于对自己的英文没有自信,不敢在生产环境贸然行事。待历史备份数据在测试环境上Clone以后操作试一下。由于备份数据是历史数量,没有操作过订单行工作流程“重试”、“倒退”和“更新属性”等等。按照官方提供的PLSQL操作以后,销售退货行状态“已关闭”,没有需要退货行接收记录,AR接口也产生对应记录,自动开票“自动开票主程序”,通过对各项数据检查没有发现什么问题。

       当在生产环境上操作时,发现没有Clone环境上那么顺利了。由于之前在生产环境对订单行工作流操作过“重试”、“倒退”和“更新属生”等等,提示错误如下:

declare

 

  l_line_id     number := 263115;

  l_ordered_qty number;

 

  cursor line_info is

    select line_id, ordered_quantity

      from oe_order_lines_all ool

     where ool.line_id = l_line_id

       and ool.flow_status_code = ‘AWAITING_RETURN‘

       andexists

     (select‘x‘

              from mtl_material_transactions mmt, rcv_transactions rcv

             where mmt.trx_source_line_id = ool.line_id

               and mmt.transaction_type_id = 15

               and rcv.oe_order_line_id = ool.line_id

               and mmt.rcv_transaction_id = rcv.transaction_id)

       forupdatenowait;

 

  l_user_id       number;

  l_resp_id       number;

  l_appl_id       number;

  x_return_status varchar2(10);

  x_msg_count     number;

  x_msg_data      varchar2(2000);

 

begin

 

  ifnvl(l_line_id, 0) > 0then

    open line_info;

    fetch line_info

      into l_line_id, l_ordered_qty;

    if line_info%notfoundthen

      close line_info;

      dbms_output.put_line(‘Error: Invalid Line Id, Re-enter.‘);

      return;

    endif;

    close line_info;

  else

    return;

  endif;

 

  Begin

    select number_value

      into l_user_id

      from wf_item_attribute_values

     where item_type = ‘OEOL‘

       and item_key = l_line_id

       andname = ‘USER_ID‘;

 

    select number_value

      into l_resp_id

      from wf_item_attribute_values

     where item_type = ‘OEOL‘

       and item_key = l_line_id

       andname = ‘RESPONSIBILITY_ID‘;

 

    select number_value

      into l_appl_id

      from wf_item_attribute_values

     where item_type = ‘OEOL‘

       and item_key = l_line_id

       andname = ‘APPLICATION_ID‘;

 

  Exception

    When No_Data_Found Then

      dbms_output.put_line(‘Error: Line flow does not exist.‘);

      return;

  End;

 

  fnd_global.apps_initialize(l_user_id, l_resp_id, l_appl_id);

 

  update oe_order_lines

     set fulfilled_quantity = null,

         shipped_quantity   = null,

         last_updated_by    = -99999999,

         last_update_date   = sysdate

   where line_id = l_line_id;

 

  begin

    oe_rma_receiving.push_receiving_info(l_line_id,

                                         l_ordered_qty,

                                         ‘NO PARENT‘,

                                         ‘RECEIVE‘,

                                         ‘N‘,

                                         x_return_status,

                                         x_msg_count,

                                         x_msg_data);

 

    if x_return_status = ‘S‘then

   

      oe_rma_receiving.push_receiving_info(l_line_id,

                                           l_ordered_qty,

                                           ‘RECEIVE‘,

                                           ‘DELIVER‘,

                                           ‘N‘,

                                           x_return_status,

                                           x_msg_count,

                                           x_msg_data);

    endif;

 

    oe_debug_pub.add(‘no. of OE messages :‘ || x_msg_count, 1);

    dbms_output.put_line(‘no. of OE messages :‘ || x_msg_count);

 

    for k in1 .. x_msg_count loop

   

      x_msg_data := oe_msg_pub.get(p_msg_index => k, p_encoded => ‘F‘);

   

      oe_debug_pub.add(substr(x_msg_data, 1, 255));

      oe_debug_pub.add(substr(x_msg_data, 255, length(x_msg_data)));

      dbms_output.put_line(‘Error msg: ‘ || substr(x_msg_data, 1, 200));

   

    endloop;

 

    fnd_msg_pub.count_and_get(p_encoded => ‘F‘,

                              p_count   => x_msg_count,

                              p_data    => x_msg_data);

 

    oe_debug_pub.add(‘no. of FND messages :‘ || x_msg_count, 1);

    dbms_output.put_line(‘no. of FND messages :‘ || x_msg_count);

 

    for k in1 .. x_msg_count loop

   

      x_msg_data := fnd_msg_pub.get(p_msg_index => k, p_encoded => ‘F‘);

   

      dbms_output.put_line(‘Error msg: ‘ || substr(x_msg_data, 1, 200));

      oe_debug_pub.add(substr(x_msg_data, 1, 255));

   

    endloop;

 

    if x_return_status <> ‘S‘then

      oe_debug_pub.add(‘Error occurred, rolling back changes.‘, 1);

      dbms_output.put_line(‘Error occurred, please fix the errors and retry.‘);

      rollback;

    else

      commit;

    endif;

  end;

 

  dbms_output.put_line(‘For details, see OM Debug File: ‘ ||

                       OE_DEBUG_PUB.G_DIR || ‘/‘ || OE_DEBUG_PUB.G_FILE);

 

end;

 

 

 

 

 

 

热门排行

今日推荐

热门手游