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

14 篇文章 0 订阅

转自:https://blog.csdn.net/chenxianping/article/details/40917577

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

2014年11月08日 08:09:37 AlanChen 阅读数:7174

系统版本:

      RDBMS : 9.2.0.6.0
     Oracle 应用产品 : 11.5.10.2

问题症状:

      1.通过物料事务处理查看销售订单行退货记录显示已经入库为40;

      2.销售退货订单行已经接收入库。但是,订单行状态仍然是“等待退货”,发运数量为空;

      3.销售退货仍然能做RMA接收40数量。但是,查看接收事务处理记录显示已经接收入库了;

      4.AR接口行和AR事务处理没有找到对应销售退货订单行的记录;
      5.销售退货订单行工作流报错;

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

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

 

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

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

       没有办法,借用朋友的账号上Oracle EBS官方上查找处理方法,最后查找到有一个SR与我们问题症状相似,RMA LINE STUCK IN "AWAITING_RETURN" OR "AWAITING_RETURN_DISPOSITION" (文档 ID 378221.1)网址:https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=514804030234119&id=378221.1&displayIndex=4&_afrWindowMode=0&_adf.ctrl-state=2xpv9x45m_378

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

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

ORA-20001: OE_RMA_WF.Wait_For_Receiving(OEOL, 263115, 161649, RUN) Wf_Engine_Util.Function_Call(OE_RMA_WF.WAIT_FOR_RECEIVING, OEOL, 263115, 161649, RUN)

并且订单行的子流程也提示错误:

OE_STANDARD_WF.STANDARD_BLOCK(OMERROR, WF11118,162379, RUN)

Wf_Engine_Util.Function_Call(OE_ERROR_WF.Set_entity_Descriptor, OMERROR, WF11118,162379, RUN)

        最后,没有办法只能重新Clone生产环境历史备份数据,把生产环境上关于该订单行流程相关记录删除,删除之前注意备份数据,再把Clone环境上关于该订单行流程数据导入到生产环境。执行官方提供的PLSQL才能顺利完成。

解决方法:

       由于对生产环上订单行流程操作过“重试”、“倒退”和“更新属性”,导致执行官方提供的ontd0018.sql不执行,需求修订单行流程的数据。操作方法:

      备份数据:

 
  1. --备份数据

  2. create table cux.WF_ITEMS as

  3. select * from WF_ITEMS where ITEM_KEY='263115' for update;

  4. delete from WF_ITEMS where ITEM_KEY='263115';

  5.  
  6. create table cux.wf_item_activity_statuses as

  7. Select * From wf_item_activity_statuses wf where wf.item_key='263115';

  8. delete from wf_item_activity_statuses wf where wf.item_key='263115';

  9.  
  10. create table cux.WF_ITEM_ACTIVITY_STATUSES_H as

  11. SELECT * FROM WF_ITEM_ACTIVITY_STATUSES_H WHERE ITEM_KEY='263115';

  12. Delete FROM WF_ITEM_ACTIVITY_STATUSES_H WHERE ITEM_KEY='263115'

  13. --子流程提示错误记录

  14. Insert Into cux.wf_item_activity_statuses

  15. Select * From cux.wf_item_activity_statuses wf where wf.item_key In ('WF11148','WF11146');

  16. Insert Into cux.WF_ITEM_ACTIVITY_STATUSES_H

  17. SELECT * FROM WF_ITEM_ACTIVITY_STATUSES_H WHERE ITEM_KEY In ('WF11148','WF11146');

  18. Insert Into cux.WF_ITEMS

  19. select * from WF_ITEMS where ITEM_KEY In ('WF11148','WF11146');

  20. --从Clone环境导入数据

  21. select * from WF_ITEMS where ITEM_KEY='263115' for update;

  22. Select * From wf_item_activity_statuses wf where wf.item_key='263115' for update;

  23. SELECT * FROM WF_ITEM_ACTIVITY_STATUSES_H WHERE ITEM_KEY='263115' for update;

  24. <span style="color:black;"><span style="font-size:14px;">注意:</span></span>

ITEM_KEY ='263115'为销售订单行的LINE_ID;ITEM_KEYIn ('WF11148','WF11146')为之流程项目关键字的值。

然后执行ontd0018.sql,如下PLSQL

1.     检查要DataFix的记录

 
  1. --&report_yn默认值为Y

  2. select oh.order_number,

  3. ol.line_number || '.' || ol.shipment_number line_number,

  4. ol.line_id,

  5. ol.flow_status_code,

  6. ol.ordered_quantity,

  7. mmt.transaction_date received_date,

  8. rcv.quantity received_quantity

  9. from OE_ORDER_HEADERS_ALL OH,

  10. OE_ORDER_LINES_ALL OL,

  11. RCV_TRANSACTIONS RCV,

  12. MTL_MATERIAL_TRANSACTIONS MMT

  13. where oh.header_id = ol.header_id

  14. and ol.line_id = rcv.oe_order_line_id

  15. and ol.line_id = mmt.trx_source_line_id

  16. and mmt.transaction_type_id = 15

  17. and mmt.rcv_transaction_id = rcv.transaction_id

  18. and ol.flow_status_code = 'AWAITING_RETURN'

  19. and nvl(upper('&report_yn'), 'N') = 'Y';

2.     然后,根据检查结果的订单行LINE_ID批量或逐行执行

 
  1. declare

  2.  
  3. l_line_id number := 263115;

  4. l_ordered_qty number;

  5.  
  6. cursor line_info is

  7. select line_id, ordered_quantity

  8. from oe_order_lines_all ool

  9. where ool.line_id = l_line_id

  10. and ool.flow_status_code = 'AWAITING_RETURN'

  11. and exists

  12. (select 'x'

  13. from mtl_material_transactions mmt, rcv_transactions rcv

  14. where mmt.trx_source_line_id = ool.line_id

  15. and mmt.transaction_type_id = 15

  16. and rcv.oe_order_line_id = ool.line_id

  17. and mmt.rcv_transaction_id = rcv.transaction_id)

  18. for update nowait;

  19.  
  20. l_user_id number;

  21. l_resp_id number;

  22. l_appl_id number;

  23. x_return_status varchar2(10);

  24. x_msg_count number;

  25. x_msg_data varchar2(2000);

  26.  
  27. begin

  28.  
  29. if nvl(l_line_id, 0) > 0 then

  30. open line_info;

  31. fetch line_info

  32. into l_line_id, l_ordered_qty;

  33. if line_info%notfound then

  34. close line_info;

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

  36. return;

  37. end if;

  38. close line_info;

  39. else

  40. return;

  41. end if;

  42.  
  43. Begin

  44. select number_value

  45. into l_user_id

  46. from wf_item_attribute_values

  47. where item_type = 'OEOL'

  48. and item_key = l_line_id

  49. and name = 'USER_ID';

  50.  
  51. select number_value

  52. into l_resp_id

  53. from wf_item_attribute_values

  54. where item_type = 'OEOL'

  55. and item_key = l_line_id

  56. and name = 'RESPONSIBILITY_ID';

  57.  
  58. select number_value

  59. into l_appl_id

  60. from wf_item_attribute_values

  61. where item_type = 'OEOL'

  62. and item_key = l_line_id

  63. and name = 'APPLICATION_ID';

  64.  
  65. Exception

  66. When No_Data_Found Then

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

  68. return;

  69. End;

  70.  
  71. fnd_global.apps_initialize(l_user_id, l_resp_id, l_appl_id);

  72.  
  73. update oe_order_lines

  74. set fulfilled_quantity = null,

  75. shipped_quantity = null,

  76. last_updated_by = -99999999,

  77. last_update_date = sysdate

  78. where line_id = l_line_id;

  79.  
  80. begin

  81. oe_rma_receiving.push_receiving_info(l_line_id,

  82. l_ordered_qty,

  83. 'NO PARENT',

  84. 'RECEIVE',

  85. 'N',

  86. x_return_status,

  87. x_msg_count,

  88. x_msg_data);

  89.  
  90. if x_return_status = 'S' then

  91.  
  92. oe_rma_receiving.push_receiving_info(l_line_id,

  93. l_ordered_qty,

  94. 'RECEIVE',

  95. 'DELIVER',

  96. 'N',

  97. x_return_status,

  98. x_msg_count,

  99. x_msg_data);

  100. end if;

  101.  
  102. oe_debug_pub.add('no. of OE messages :' || x_msg_count, 1);

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

  104.  
  105. for k in 1 .. x_msg_count loop

  106.  
  107. x_msg_data := oe_msg_pub.get(p_msg_index => k, p_encoded => 'F');

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

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

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

  112.  
  113. end loop;

  114.  
  115. fnd_msg_pub.count_and_get(p_encoded => 'F',

  116. p_count => x_msg_count,

  117. p_data => x_msg_data);

  118.  
  119. oe_debug_pub.add('no. of FND messages :' || x_msg_count, 1);

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

  121.  
  122. for k in 1 .. x_msg_count loop

  123.  
  124. x_msg_data := fnd_msg_pub.get(p_msg_index => k, p_encoded => 'F');

  125.  
  126. dbms_output.put_line('Error msg: ' || substr(x_msg_data, 1, 200));

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

  128.  
  129. end loop;

  130.  
  131. if x_return_status <> 'S' then

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

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

  134. rollback;

  135. else

  136. commit;

  137. end if;

  138. end;

  139.  
  140. dbms_output.put_line('For details, see OM Debug File: ' ||

  141. OE_DEBUG_PUB.G_DIR || '/' || OE_DEBUG_PUB.G_FILE);

  142.  
  143. end;


 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值