详解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.


用一行创建已登记的订单  

INSERT INTO OE_HEADERS_IFACE_ALL (
order_source_id
,orig_sys_document_ref
,creation_date
,created_by
,last_update_date
,last_updated_by
,operation_code
,sold_to_org_id
)
VALUES (
1227 --order_source_id
,'12345' --orig_sys_document_ref
,sysdate --creation_date
,-1 --created_by
,sysdate --last_update_date
,-1 --last_updated_by
,'INSERT' --operation_code
,1005 --sold_to_org_id
);
INSERT INTO OE_LINES_IFACE_ALL (
order_source_id
,orig_sys_document_ref
,orig_sys_line_ref
,inventory_item_id
,ordered_quantity
,operation_code
,created_by
,creation_date
,last_updated_by
,last_update_date
)
VALUES (
1227 --order_source_id
,'12345' --orig_sys_document_ref
,'1' --orig_sys_line_ref
,249 --inventory_item_id
, 10 --ordered_quantity
, 'INSERT' --operation_code
, -1 --created_by
, sysdate --creation_date
, -1 --last_updated_by
, sysdate --last_update_date
);
INSERT INTO OE_ACTIONS_IFACE_ALL (
order_source_id
,orig_sys_document_ref
,operation_code
)
VALUES (
1227 --order_source_id
,'12345' --orig_sys_document_ref
,'BOOK_ORDER' --operation_code
);
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.

INSERT INTO OE_HEADERS_IFACE_ALL (
order_source_id
,orig_sys_document_ref
,creation_date
,created_by
,last_update_date
,last_updated_by
,operation_code
,sold_to_org_id
,booked_flag
)
VALUES (
1227 --order_source_id
,'12345' --orig_sys_document_ref
,sysdate --creation_date
,-1 --created_by
,sysdate --last_update_date
,-1 --last_updated_by
,'INSERT' --operation_code
,1005 --sold_to_org_id
,'Y' --booked_flag
);
INSERT INTO OE_LINES_IFACE_ALL (
order_source_id
,orig_sys_document_ref
,orig_sys_line_ref
,inventory_item_id
,ordered_quantity
,operation_code
,created_by
,creation_date
,last_updated_by
,last_update_date
)
VALUES (
1227 --order_source_id
,'12345' --orig_sys_document_ref
,'1' --orig_sys_line_ref
,249 --inventory_item_id
, 10 --ordered_quantity
, 'INSERT' --operation_code
, -1 --created_by
, sysdate --creation_date
, -1 --last_updated_by
, sysdate --last_update_date
);
commit;

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

INSERT INTO OE_HEADERS_IFACE_ALL (
order_source_id
,orig_sys_document_ref
,creation_date
,created_by
,last_update_date
,last_updated_by
,operation_code
,sold_to_org_id
,order_type_id
,booked_flag
)
VALUES (
1227 --order_source_id
,'123456' --orig_sys_document_ref
,sysdate --creation_date
,-1 --created_by
,sysdate --last_update_date
,-1 --last_updated_by
,'INSERT' --operation_code
,1005 --sold_to_org_id
,1436 --order_type_id
,'Y' --booked_flag
);
INSERT INTO OE_LINES_IFACE_ALL (
order_source_id
,orig_sys_document_ref
,orig_sys_line_ref
,inventory_item_id
,ordered_quantity
,operation_code
,created_by
,creation_date
,last_updated_by
,last_update_date
,return_reason_code
,return_context
,return_attribute1
,return_attribute2
)
VALUES (
1227 --order_source_id
,'123456' --orig_sys_document_ref
,'1' --orig_sys_line_ref
,249 --inventory_item_id
,10 --ordered_quantity
,'INSERT' --operation_code
,-1 --created_by
,sysdate --creation_date
,-1 --last_updated_by
,sysdate --last_update_date
,'CANCELLATION' --return_reason_code
,'ORDER' --referencing a sales order
,'157638' --header_id of referenced order
,'256619' --line_id of referenced line
);
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.

INSERT INTO oe_headers_iface_all
(
order_source_id,
orig_sys_document_ref,
operation_code,
created_by,
creation_date,
last_updated_by,
last_update_date
)
VALUES
(
1227, -- order_source_id
'12345', -- orig_sys_document_ref
'UPDATE', -- operation_code
-1, -- created_by
SYSDATE, -- creation_date
-1, -- last_updated_by
SYSDATE -- last_update_date
);

INSERT INTO oe_lines_iface_all
(
order_source_id,
orig_sys_document_ref,
orig_sys_line_ref,
operation_code,
inventory_item_id,
ordered_quantity,
created_by,
creation_date,
last_updated_by,
last_update_date
)
VALUES
(1227, -- order_source_id
'12345', -- orig_sys_document_ref
'2', -- orig_sys_line_ref
'INSERT', -- operation_code
149, -- inventory_item_id
10, -- ordered_quantity
-1, -- created_by
SYSDATE, -- creation_date
-1, -- last_updated_by
SYSDATE -- last_update_date
);
commit;


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

INSERT INTO OE_HEADERS_IFACE_ALL (
order_source_id
,orig_sys_document_ref
,creation_date
,created_by
,last_update_date
,last_updated_by
,operation_code
,sold_to_org_id
)
VALUES (
1227 --order_source_id
,'12345' --orig_sys_document_ref
,sysdate --creation_date
,-1 --created_by
,sysdate --last_update_date
,-1 --last_updated_by
,'INSERT' --operation_code
,1005 --sold_to_org_id
);
INSERT INTO OE_LINES_IFACE_ALL (
order_source_id
,orig_sys_document_ref
,orig_sys_line_ref
,inventory_item_id
,ordered_quantity
,operation_code
,created_by
,creation_date
,last_updated_by
,last_update_date
,top_model_line_ref
,item_type_code
)
VALUES (
1227 --order_source_id
,'12345' --orig_sys_document_ref
,'1' --orig_sys_line_ref
,542851 --inventory_item
,1 --ordered_quantity
,'INSERT' --operation_code
,-1 --created_by
,sysdate --creation_date
,-1 --last_updated_by
,sysdate --last_update_date
,'1' --top_model_line_ref
,'MODEL' --item_type_code
);
INSERT INTO OE_LINES_IFACE_ALL (
order_source_id
,orig_sys_document_ref
,orig_sys_line_ref
,inventory_item_id
,ordered_quantity
,operation_code
,created_by
,creation_date
,last_updated_by
,last_update_date
,top_model_line_ref
,link_to_line_ref
,item_type_code
)
VALUES (
1227 --order_source_id
,'12345' --orig_sys_document_ref
,'2' --orig_sys_line_ref
,542852 --inventory_item_id
,1 --ordered_quantity
,'INSERT' --operation_code
,-1 --created_by
,sysdate --creation_date
,-1 --last_updated_by
,sysdate --last_update_date
,'1' --top_model_line_ref
,'1' --link_to_line_ref
,'CLASS' --item_type_code
);
INSERT INTO OE_LINES_IFACE_ALL (
order_source_id
,orig_sys_document_ref
,orig_sys_line_ref
,inventory_item_id
,ordered_quantity
,operation_code
,created_by
,creation_date
,last_updated_by
,last_update_date
,top_model_line_ref
,link_to_line_ref
,item_type_code
)
VALUES (
1227 --order_source_id
,'12345' --orig_sys_document_ref
,'3' --orig_sys_line_ref
,152840 --inventory_item_id
,1 --ordered_quantity
,'INSERT' --operation_code
,-1 --created_by
,sysdate --creation_date
,-1 --last_updated_by
,sysdate --last_update_date
,'1' --top_model_line_ref
,'2' --link_to_line_ref
,'OPTION' --item_type_code
);
commit;


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




原文地址:https://www.cnblogs.com/wanghang/p/6299360.html