详解EBS接口开发之销售订单导入

步骤

1. 创建一个订单导入来源. 
     - 导航到 OM -> 设置 -> 订单 -> 导入来源 
     - 输入一个新的订单导入来源名称和描述

     - 选择启用来激活订单导入来源,并保存。 
     - 点击 帮助-> 诊断 -> 检查, 并检查字段ORDER_SOURCE_ID的值 
     - 记下这个值.

2. 使用上面创建的ORDER_SOURCE_ID 值插入数据到相应的订单导入接口表。不是所有的表和列都需要被填充到导入订单里;对测试案例使用适当的表与需要的列。插入脚本样例提供如下。参照 API 指南和eTRM 来了解列出的表和列的详细信息。

订单导入接口表
OE_HEADERS_IFACE_ALL
OE_LINES_IFACE_ALL
OE_PRICE_ADJS_IFACE_ALL
OE_PRICE_ATTS_IFACE_ALL
OE_CREDITS_IFACE_ALL
OE_LOTSERIALS_IFACE_ALL
OE_RESERVTNS_IFACE_ALL
OE_ACTIONS_IFACE_ALL
OE_CUSTOMER_INFO_IFACE_ALL
OE_PAYMENTS_IFACE_ALL 

注意,表 OE_CUSTOMER_INFO_IFACE_ALL (用于增加客户/地址/联系方式) 是上面表中唯一没有ORDER_SOURCE_ID 列的表. 订单头记录的链接是通过表OE_CUSTOMER_INFO_IFACE_ALL 的列CUSTOMER_INFO_REF 和表OE_HEADERS_IFACE_ALL 的列 (详细信息参照应用程序接口指南).

3. 运行订单导入并发程序. 
    - 导航到 订单, 返回 ->导入订单> 订单导入请求 
    - 在参数表单的列表值中选择订单来源. 
    - 提交并发程序请求 . 

设置‘仅验证’参数为Yes ,订单导入会执行一个接口表数据的验证而没有实际的数据导入。这对在运行实际的导入之前检查接口表数据是否正确很有帮助。这个参数的默认值是No.

4. 去查看-> 请求并检查父请求和子请求都已提交,并且都已成功的完成。 
 - 检查 子请求的"查看输出" 中的信息,比如:


      发现的订单数: 1
      导入的订单数: 1
      导入失败的订单数: 0



 如果子请求未从父请求得到衍生,订单导入没有在接口表里挑出任何行来处理.这可能是由于接口表里的数据被设置错误,或由于用户在运行请求时选择了错误的 参数值 (例如,选择错误的订单来源值). 如果子请求从父请求得到衍生但输出文件显示有订单导入失败,失败的原因可以在输出文件中查找错误信息。相应地修改接口表里的数据。为了得到更详细的订单导 入失败的原因,可以在请求运行之前,在运行这个请求的人员的用户层设置OM : Debug Level为5,OM 调试信息会在子请求的日志文件中显示。



5. 检验被导入的订单. 
     - 订单,返回 -> 订单管理
     - 在报价/订单信息页签, 输入以下信息并点击查找:


          订单来源 : 输入第一步里提到的订单来源
          订单来源参考 : orig_sys_document_ref


      - 打开订单. 
      - 订单头里的订单来源/订单来源参考信息会在‘其它’页签上出现. 
      - 行的来源信息会在‘主要’页签里显示 (滚动到右边)

使用订单更正表单


订单更正表单提供了一个用户接口来查看,更新,插入和删除接口表里的数据。在线验证和订单导入的接口数据也能在这个表单执行。


做订单导入测试案例不是总需要使用这个表单,除非为了调试 并使用这个表单来尽量重现特殊情况。
导航到订单,返回 ->导入订单 ->更正
使用查找条件比如订单来源在接口表里查询数据.
有问题的订单显示为红色。此表单中页签和按钮的详细信息请参考API 指南 和 订单用户手册。

样例脚本


使用两种方法之一做订单导入的测试案例.

1. 直接插入数据到接口表。表和列的详细信息请参照API 指南 和 eTRM.


用一行创建已登记的订单  

  1. INSERT INTO OE_HEADERS_IFACE_ALL (  
  2. order_source_id  
  3. ,orig_sys_document_ref  
  4. ,creation_date  
  5. ,created_by  
  6. ,last_update_date  
  7. ,last_updated_by  
  8. ,operation_code  
  9. ,sold_to_org_id  
  10. )  
  11. VALUES (  
  12. 1227 --order_source_id  
  13. ,'12345' --orig_sys_document_ref  
  14. ,sysdate --creation_date  
  15. ,-1 --created_by  
  16. ,sysdate --last_update_date  
  17. ,-1 --last_updated_by  
  18. ,'INSERT' --operation_code  
  19. ,1005 --sold_to_org_id  
  20. );  
  21. INSERT INTO OE_LINES_IFACE_ALL (  
  22. order_source_id  
  23. ,orig_sys_document_ref  
  24. ,orig_sys_line_ref  
  25. ,inventory_item_id  
  26. ,ordered_quantity  
  27. ,operation_code  
  28. ,created_by  
  29. ,creation_date  
  30. ,last_updated_by  
  31. ,last_update_date  
  32. )  
  33. VALUES (  
  34. 1227 --order_source_id  
  35. ,'12345' --orig_sys_document_ref  
  36. ,'1' --orig_sys_line_ref  
  37. ,249 --inventory_item_id  
  38. , 10 --ordered_quantity  
  39. 'INSERT' --operation_code  
  40. , -1 --created_by  
  41. , sysdate --creation_date  
  42. , -1 --last_updated_by  
  43. , sysdate --last_update_date  
  44. );  
  45. INSERT INTO OE_ACTIONS_IFACE_ALL (  
  46. order_source_id  
  47. ,orig_sys_document_ref  
  48. ,operation_code  
  49. )  
  50. VALUES (  
  51. 1227 --order_source_id  
  52. ,'12345' --orig_sys_document_ref  
  53. ,'BOOK_ORDER' --operation_code  
  54. );  
  55. commit;  

* Alternately, to book the order you can pass BOOKED_FLAG as 'Y' in OE_HEADERS_IFACE_ALL instead of passing data in the OE_ACTIONS_IFACE_ALL table.

  1. INSERT INTO OE_HEADERS_IFACE_ALL (  
  2. order_source_id  
  3. ,orig_sys_document_ref  
  4. ,creation_date  
  5. ,created_by  
  6. ,last_update_date  
  7. ,last_updated_by  
  8. ,operation_code  
  9. ,sold_to_org_id  
  10. ,booked_flag  
  11. )  
  12. VALUES (  
  13. 1227 --order_source_id  
  14. ,'12345' --orig_sys_document_ref  
  15. ,sysdate --creation_date  
  16. ,-1 --created_by  
  17. ,sysdate --last_update_date  
  18. ,-1 --last_updated_by  
  19. ,'INSERT' --operation_code  
  20. ,1005 --sold_to_org_id  
  21. ,'Y' --booked_flag  
  22. );  
  23. INSERT INTO OE_LINES_IFACE_ALL (  
  24. order_source_id  
  25. ,orig_sys_document_ref  
  26. ,orig_sys_line_ref  
  27. ,inventory_item_id  
  28. ,ordered_quantity  
  29. ,operation_code  
  30. ,created_by  
  31. ,creation_date  
  32. ,last_updated_by  
  33. ,last_update_date  
  34. )  
  35. VALUES (  
  36. 1227 --order_source_id  
  37. ,'12345' --orig_sys_document_ref  
  38. ,'1' --orig_sys_line_ref  
  39. ,249 --inventory_item_id  
  40. , 10 --ordered_quantity  
  41. 'INSERT' --operation_code  
  42. , -1 --created_by  
  43. , sysdate --creation_date  
  44. , -1 --last_updated_by  
  45. , sysdate --last_update_date  
  46. );  
  47. commit;  

创建参考了已存在订单的RMA订单

  1. INSERT INTO OE_HEADERS_IFACE_ALL (  
  2. order_source_id  
  3. ,orig_sys_document_ref  
  4. ,creation_date  
  5. ,created_by  
  6. ,last_update_date  
  7. ,last_updated_by  
  8. ,operation_code  
  9. ,sold_to_org_id  
  10. ,order_type_id  
  11. ,booked_flag  
  12. )  
  13. VALUES (  
  14. 1227 --order_source_id  
  15. ,'123456' --orig_sys_document_ref  
  16. ,sysdate --creation_date  
  17. ,-1 --created_by  
  18. ,sysdate --last_update_date  
  19. ,-1 --last_updated_by  
  20. ,'INSERT' --operation_code  
  21. ,1005 --sold_to_org_id  
  22. ,1436 --order_type_id  
  23. ,'Y' --booked_flag  
  24. );  
  25. INSERT INTO OE_LINES_IFACE_ALL (  
  26. order_source_id  
  27. ,orig_sys_document_ref  
  28. ,orig_sys_line_ref  
  29. ,inventory_item_id  
  30. ,ordered_quantity  
  31. ,operation_code  
  32. ,created_by  
  33. ,creation_date  
  34. ,last_updated_by  
  35. ,last_update_date  
  36. ,return_reason_code  
  37. ,return_context  
  38. ,return_attribute1  
  39. ,return_attribute2  
  40. )  
  41. VALUES (  
  42. 1227 --order_source_id  
  43. ,'123456' --orig_sys_document_ref  
  44. ,'1' --orig_sys_line_ref  
  45. ,249 --inventory_item_id  
  46. ,10 --ordered_quantity  
  47. ,'INSERT' --operation_code  
  48. ,-1 --created_by  
  49. ,sysdate --creation_date  
  50. ,-1 --last_updated_by  
  51. ,sysdate --last_update_date  
  52. ,'CANCELLATION' --return_reason_code  
  53. ,'ORDER' --referencing a sales order  
  54. ,'157638' --header_id of referenced order  
  55. ,'256619' --line_id of referenced line  
  56. );  
  57. commit;  

Add other columns or modify the insert script as appropriate for your testcase, referring to the API Guide and eTRM. 
Set the value of order_source_id in all tables to your own order_source_id. 
Set the value of orig_sys_document_ref in all tables to a unique value for each order.


向已存在的订单上加一行

Note: Set the orig_sys_document_ref to the value of orig_sys_document_ref of the existing order in the base table oe_order_headers_all.

  1. INSERT INTO oe_headers_iface_all  
  2. (  
  3. order_source_id,  
  4. orig_sys_document_ref,  
  5. operation_code,  
  6. created_by,  
  7. creation_date,  
  8. last_updated_by,  
  9. last_update_date  
  10. )  
  11. VALUES  
  12. (  
  13. 1227, -- order_source_id  
  14. '12345'-- orig_sys_document_ref  
  15. 'UPDATE'-- operation_code  
  16. -1, -- created_by  
  17. SYSDATE, -- creation_date  
  18. -1, -- last_updated_by  
  19. SYSDATE -- last_update_date  
  20. );  
  21.   
  22. INSERT INTO oe_lines_iface_all  
  23. (  
  24. order_source_id,  
  25. orig_sys_document_ref,  
  26. orig_sys_line_ref,  
  27. operation_code,  
  28. inventory_item_id,  
  29. ordered_quantity,  
  30. created_by,  
  31. creation_date,  
  32. last_updated_by,  
  33. last_update_date  
  34. )  
  35. VALUES  
  36. (1227, -- order_source_id  
  37. '12345'-- orig_sys_document_ref  
  38. '2'-- orig_sys_line_ref  
  39. 'INSERT'-- operation_code  
  40. 149, -- inventory_item_id  
  41. 10, -- ordered_quantity  
  42. -1, -- created_by  
  43. SYSDATE, -- creation_date  
  44. -1, -- last_updated_by  
  45. SYSDATE -- last_update_date  
  46. );  
  47. commit;  


用选件类和选项物料导入一个ATO模型

  1. INSERT INTO OE_HEADERS_IFACE_ALL (  
  2. order_source_id  
  3. ,orig_sys_document_ref  
  4. ,creation_date  
  5. ,created_by  
  6. ,last_update_date  
  7. ,last_updated_by  
  8. ,operation_code  
  9. ,sold_to_org_id  
  10. )  
  11. VALUES (  
  12. 1227 --order_source_id  
  13. ,'12345' --orig_sys_document_ref  
  14. ,sysdate --creation_date  
  15. ,-1 --created_by  
  16. ,sysdate --last_update_date  
  17. ,-1 --last_updated_by  
  18. ,'INSERT' --operation_code  
  19. ,1005 --sold_to_org_id  
  20. );  
  21. INSERT INTO OE_LINES_IFACE_ALL (  
  22. order_source_id  
  23. ,orig_sys_document_ref  
  24. ,orig_sys_line_ref  
  25. ,inventory_item_id  
  26. ,ordered_quantity  
  27. ,operation_code  
  28. ,created_by  
  29. ,creation_date  
  30. ,last_updated_by  
  31. ,last_update_date  
  32. ,top_model_line_ref  
  33. ,item_type_code  
  34. )  
  35. VALUES (  
  36. 1227 --order_source_id  
  37. ,'12345' --orig_sys_document_ref  
  38. ,'1' --orig_sys_line_ref  
  39. ,542851 --inventory_item  
  40. ,1 --ordered_quantity  
  41. ,'INSERT' --operation_code  
  42. ,-1 --created_by  
  43. ,sysdate --creation_date  
  44. ,-1 --last_updated_by  
  45. ,sysdate --last_update_date  
  46. ,'1' --top_model_line_ref  
  47. ,'MODEL' --item_type_code  
  48. );  
  49. INSERT INTO OE_LINES_IFACE_ALL (  
  50. order_source_id  
  51. ,orig_sys_document_ref  
  52. ,orig_sys_line_ref  
  53. ,inventory_item_id  
  54. ,ordered_quantity  
  55. ,operation_code  
  56. ,created_by  
  57. ,creation_date  
  58. ,last_updated_by  
  59. ,last_update_date  
  60. ,top_model_line_ref  
  61. ,link_to_line_ref  
  62. ,item_type_code  
  63. )  
  64. VALUES (  
  65. 1227 --order_source_id  
  66. ,'12345' --orig_sys_document_ref  
  67. ,'2' --orig_sys_line_ref  
  68. ,542852 --inventory_item_id  
  69. ,1 --ordered_quantity  
  70. ,'INSERT' --operation_code  
  71. ,-1 --created_by  
  72. ,sysdate --creation_date  
  73. ,-1 --last_updated_by  
  74. ,sysdate --last_update_date  
  75. ,'1' --top_model_line_ref  
  76. ,'1' --link_to_line_ref  
  77. ,'CLASS' --item_type_code  
  78. );  
  79. INSERT INTO OE_LINES_IFACE_ALL (  
  80. order_source_id  
  81. ,orig_sys_document_ref  
  82. ,orig_sys_line_ref  
  83. ,inventory_item_id  
  84. ,ordered_quantity  
  85. ,operation_code  
  86. ,created_by  
  87. ,creation_date  
  88. ,last_updated_by  
  89. ,last_update_date  
  90. ,top_model_line_ref  
  91. ,link_to_line_ref  
  92. ,item_type_code  
  93. )  
  94. VALUES (  
  95. 1227 --order_source_id  
  96. ,'12345' --orig_sys_document_ref  
  97. ,'3' --orig_sys_line_ref  
  98. ,152840 --inventory_item_id  
  99. ,1 --ordered_quantity  
  100. ,'INSERT' --operation_code  
  101. ,-1 --created_by  
  102. ,sysdate --creation_date  
  103. ,-1 --last_updated_by  
  104. ,sysdate --last_update_date  
  105. ,'1' --top_model_line_ref  
  106. ,'2' --link_to_line_ref  
  107. ,'OPTION' --item_type_code  
  108. );  
  109. commit;  


插值完成后调用并发程序完成导入

请使用浏览器的分享功能分享到微信等