首页 > 其他分享 >EBS:OM Sales Order销售订单【Open Interface、Open API】

EBS:OM Sales Order销售订单【Open Interface、Open API】

时间:2024-09-17 08:52:02浏览次数:1  
标签:OM iface oe Sales tbl rec line Open order

21. OM Sales Order销售订单【Open Interface、Open API】
21.1. 快速参考

参考点
内容
功能导航
N: OM/Orders, Returns/Sales Order
并发请求
N: OM/View/Request/Order Import
接口表
oe_headers_iface_all/oe_lines_iface_all/oe_actions_iface_all/….
API
oe_order_pub.process_order
错误信息表
接口Form
N/A
接口Report
N/A
Debug Profile
OM: Debug Level
详细例子
oracle_iface_scripts_pkg.oe_so_iface
官方文档
115mfgapi.pdf:Oracle Manufacturing APIs and Open Interfaces Manual 115omapi.pdf:Oracle Order Management Open Interfaces, API, & Electronic Messaging Guide
数据验证包
21.2.
接口表、错误信息表
开发参考
Table List:
接口表
数据表
说明
oe_headers_iface_all
oe_order_headers_all
订单头
oe_lines_iface_all
oe_order_lines_all
订单行
oe_actions_iface_all
订单操作控制
错误信息表
Table Relation: 头和行关联:OU、订单来源、头参考 头和Action关联:OU、订单来源、头参考 如果Action的行参考为空,说明控制整个订单,否则控制单行
并发程序
N: OM/View/Requst/Order Import
参数
说明
Order Source
订单来源
Order Reference
订单参考
Validate Only
是否仅验证
Instance
并发数
Interface Form
N: 无
21.3.
订单头和订单行,大部分字段都可以根据Default Rule自定给出;不过,为精确控制,确定的字段我们还是尽可能给出为好。
关键字段(参数)+最简单例子
关键字段
oe_headers_iface_all
字段
说明
org_id
OU
order_number
订单号,自动编号的,给空
order_source_id
订单来源,手工输入是0,即Online
orig_sys_document_ref
订单参考,和订单来源构成唯一性,一般用来标志源系统ID
operation_code
INSERT或者UPDATE,当订单来源和参考组合存在时用更新,当订单为Enter状态时,可以DELETE
ready_flag
Y
ordered_date
订单日期
order_type_id
订单类型
price_list_id
价目表
conversion_type_code
货币转换类型,可由订单类型默认
transactional_curr_code
货币单位
字段
说明
tax_exempt_flag
S,税务免除标志
payment_term_id
付款条件,也可以默认
salesrep_id
销售员ID
sold_from_org_id
销售OU
sold_to_org_id
客户ID,来自hz_cust_accounts
ship_from_org_id
发运库存
ship_to_org_id
发运地址,来自hz_cust_site_uses_all
invoice_to_org_id
开票地址,来自hz_cust_site_uses_all
booked_flag
Y或者N
closed_flag
Y或者N
5个who字段
习惯上都给
oe_headers_iface_all
字段
说明
org_id
OU
order_source_id
订单来源,手工输入是0,即Online
orig_sys_document_ref
订单参考,一般用来标志源系统ID
orig_sys_line_ref
行参考,与上面两个构成唯一性,一般用来标志源系统ID
operation_code
INSERT或者UPDATE,当上述3个组合存在时用更新,当订单为Enter状态时,可以DELETE
split_from_line_ref
拆行时,标志来源行参考
line_number
行号,非Close的订单行号不能重复。接口表我们可以给空由系统自动编号;如果有需要待导入后Update Line表即可
shipment_number
发运行号
line_type_id
行类型
item_type_code
物料类别,默认由ITEM类型决定,通常是STANDARD
inventory_item_id
Item ID
source_type_code
EXTERNAL或者INTERNAL,可由默认规则确定
ordered_quantity
订单数量,正负要与Line Type一致,正的对Order,负的对Return,否则接口报Inventory Item错误
order_quantity_uom
单位
pricing_quantity
计价数量
pricing_quantity_uom
单位
unit_list_price
价目表价格
unit_selling_price
实际销售价格
calculate_price_flag
N或者Y,是否自动计算价格
5个who字段
习惯上都给
oe_actions_iface_all
字段
说明
org_id
OU
order_source_id
订单来源,手工输入是0,即Online
orig_sys_document_ref
订单参考,一般用来标志源系统ID
orig_sys_line_ref
行参考,与上面两个构成唯一性,一般用来标志源系统ID
operation_code
CLOSE_ORDER,用于关闭订单或行或行 BOOK_ORDER,用户预定订单
Open Inerface最简单例子(新建Book的订单)

(11.5.10.2 Prod环境测试通过)
脚本如下:
DECLARE l_iface_rec ont.oe_headers_iface_all%ROWTYPE; 
l_iface_lines_rec ont.oe_lines_iface_all%ROWTYPE;
l_iface_action_rec ont.oe_actions_iface_all%ROWTYPE; 
l_org_id NUMBER := 102; --OU ID 
l_user_id NUMBER := 0; --User ID?Sysadmin 
BEGIN --Header 
l_iface_rec.last_update_date := SYSDATE; 
l_iface_rec.last_updated_by := 0; 
l_iface_rec.creation_date := SYSDATE; 
l_iface_rec.created_by := 0; 
l_iface_rec.last_update_login := -1; 
l_iface_rec.org_id := l_org_id; 
l_iface_rec.order_number := NULL; --Null 
if Autonumber l_iface_rec.order_source_id := 0; 
--Online, see ont.oe_order_sources 
l_iface_rec.orig_sys_document_ref := 'HEADER0001'; 
--'UPDATE' when order_source_id/orig_sys_document_ref exists 
l_iface_rec.operation_code := 'INSERT'; 
l_iface_rec.ready_flag := 'Y'; 
l_iface_rec.ordered_date := SYSDATE; 
l_iface_rec.order_type_id := 1006; 
l_iface_rec.price_list_id := 6007; 
--Derive from order type or customer 
l_iface_rec.conversion_type_code := 'Corporate'; 
--Derive from order type 
l_iface_rec.transactional_curr_code := 'CNY'; 
l_iface_rec.tax_exempt_flag := 'S'; 
l_iface_rec.payment_term_id := 5; --Derive from order type or customer 
l_iface_rec.salesrep_id := 100000040; 
l_iface_rec.sold_from_org_id := 102; l_iface_rec.sold_to_org_id := 1040; 
l_iface_rec.ship_from_org_id := 104; l_iface_rec.ship_to_org_id := 1042; 
l_iface_rec.invoice_to_org_id := 1040; 
l_iface_rec.booked_flag := 'Y'; 
l_iface_rec.closed_flag := 'N'; --'Y' for closed order INSERT INTO 
ont.oe_headers_iface_all VALUES l_iface_rec; 
--Line 
l_iface_lines_rec.last_update_date := SYSDATE; 
l_iface_lines_rec.last_updated_by := 0; 
l_iface_lines_rec.creation_date := SYSDATE; 
l_iface_lines_rec.created_by := 0; 
l_iface_lines_rec.last_update_login := -1; 
l_iface_lines_rec.org_id := l_iface_rec.org_id; 
l_iface_lines_rec.order_source_id := l_iface_rec.order_source_id; 
l_iface_lines_rec.orig_sys_document_ref := l_iface_rec.orig_sys_document_ref; 
l_iface_lines_rec.orig_sys_line_ref := 'LINE0001'; 
l_iface_lines_rec.split_from_line_ref := NULL; 
--Used for split line 
--'UPDATE' when order_source_id/orig_sys_document_ref/orig_sys_line_ref exists 
l_iface_lines_rec.operation_code := 'INSERT'; 
l_iface_lines_rec.line_number := 1; l_iface_lines_rec.shipment_number := 1; 
l_iface_lines_rec.line_type_id := 1001; 
--can derive from header type 
l_iface_lines_rec.item_type_code := NULL; 
--default 'STANDARD' 
l_iface_lines_rec.inventory_item_id := 5; 
l_iface_lines_rec.source_type_code := NULL; 
--'EXTERNAl' or 'INTERNAL', derive using default rule
l_iface_lines_rec.ordered_quantity := 100; 
l_iface_lines_rec.order_quantity_uom := 'PCS'; 
l_iface_lines_rec.pricing_quantity := l_iface_lines_rec.ordered_quantity; 
l_iface_lines_rec.pricing_quantity_uom := l_iface_lines_rec.order_quantity_uom; 
l_iface_lines_rec.unit_list_price := 9; 
l_iface_lines_rec.unit_selling_price := 9.9; 
l_iface_lines_rec.calculate_price_flag := 'N'; 
INSERT INTO ont.oe_lines_iface_all VALUES l_iface_lines_rec; 
END;
Open API最简单例子(Book订单)(11.5.9..10环境测试通过) 胡俊奇提供
只需要提供订单头ID即可。

153368796 2024/9/15 9:23:15
21.4.
导入Close的SO
已知问题
整张Close的订单可以通过接口表;Close的订单,Oracle几乎是直接插表;其他的要做很多验证。 部分行Close的订单,可以给行Assign一个仅负责Close(Enter/Fulfill/Close/End)的工作流,这样Workflow Back Ground Process起来之后就会Close。
订单行号
非Close的订单行号不能重复,所以接口表我们给空;如果有需要待导入后Update Line表即可。
数量正负
数量正负要与Line Type的类型一致,正的对Order,负的对Return,否则接口报Inventory Item错误。
直接更新订单号
需要更新几个表:oe_order_headers_all/wsh_delivery_details/mtl_sales_orders 
UPDATE apps.mtl_sales_orders SET segment1 = l_copy_to_order_number 
WHERE segment1 = l_order_number AND segment2 = l_order_type 
AND segment3 = 'ORDER ENTRY';
直接Close
更新行Close信息代码如下: UPDATE oe_order_lines_all oel
SET oel.invoice_interface_status_code = 'YES', oel.shippable_flag = 'Y',
oel.fulfilled_flag = 'Y', 
oel.shipping_quantity_uom = oel.order_quantity_uom,
oel.shipping_interfaced_flag = decode(oel.source_type_code, 'EXTERNAL', 'N', 'Y'),
oel.open_flag = 'N', oel.calculate_price_flag = 'N',
oel.flow_status_code = 'CLOSED',
oel.fulfillment_date = a_rec.fulfillment_date, 
oel.actual_shipment_date = a_rec.actual_shipment_date, 
oel.shipped_quantity = oel.ordered_quantity, 
oel.shipping_quantity = oel.ordered_quantity, 
oel.invoiced_quantity = oel.ordered_quantity, 
oel.fulfilled_quantity = oel.ordered_quantity, 
oel.visible_demand_flag = decode(oel.flow_status_code, 'AWAITING_SHIPPING', 'N', NULL) 
WHERE oel.line_id = l_copy_to_order_line_id
自动拆行
订单行在收货或者发货不足的情况下会拆行,拆行的时候系统几乎是拷贝所有的字段,
如果碰到Unique的字段会失败。我碰到的问题是把源系统的line_id记录在弹性域上,
并给这个弹性域建了Unique索引,导致Dropship的订单不分收货老是报错。

153368796 2024/9/15 9:24:07
来源: https://www.itpub.net/thread-1812919-1-1.html

153368796 2024/9/15 9:23:03
脚本如下:
DECLARE x_debug_file VARCHAR2(100); 
x_return_status VARCHAR2(1000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(1000);
l_msg_data VARCHAR2(1000);
l_msg_index_out NUMBER;
l_action_request_tbl oe_order_pub.request_tbl_type;
x_header_rec oe_order_pub.header_rec_type;
x_header_val_rec oe_order_pub.header_val_rec_type;
x_header_adj_tbl oe_order_pub.header_adj_tbl_type;
x_header_adj_val_tbl oe_order_pub.header_adj_val_tbl_type;
x_header_price_att_tbl oe_order_pub.header_price_att_tbl_type;
x_header_adj_att_tbl oe_order_pub.header_adj_att_tbl_type;
x_header_adj_assoc_tbl oe_order_pub.header_adj_assoc_tbl_type;
x_header_scredit_tbl oe_order_pub.header_scredit_tbl_type;
x_header_scredit_val_tbl oe_order_pub.header_scredit_val_tbl_type;
x_line_tbl oe_order_pub.line_tbl_type;
x_line_val_tbl oe_order_pub.line_val_tbl_type;
x_line_adj_tbl oe_order_pub.line_adj_tbl_type;
x_line_adj_val_tbl oe_order_pub.line_adj_val_tbl_type;
x_line_price_att_tbl oe_order_pub.line_price_att_tbl_type;
x_line_adj_att_tbl oe_order_pub.line_adj_att_tbl_type;
x_line_adj_assoc_tbl oe_order_pub.line_adj_assoc_tbl_type;
x_line_scredit_tbl oe_order_pub.line_scredit_tbl_type;
x_line_scredit_val_tbl oe_order_pub.line_scredit_val_tbl_type;
x_lot_serial_tbl oe_order_pub.lot_serial_tbl_type;
x_lot_serial_val_tbl oe_order_pub.lot_serial_val_tbl_type;
x_action_request_tbl oe_order_pub.request_tbl_type;
BEGIN dbms_output.enable(1000000);
fnd_global.apps_initialize(user_id => 0, resp_id => 52459, resp_appl_id => 660);
oe_msg_pub.initialize; oe_debug_pub.initialize;
x_debug_file := oe_debug_pub.set_debug_mode('FILE');
oe_debug_pub.setdebuglevel(5); -- 5 For Most Debuging Output!!
--Action Request l_action_request_tbl(1).request_type := oe_globals.g_book_order;
l_action_request_tbl(1).entity_code := oe_globals.g_entity_header;
l_action_request_tbl(1).entity_id := 1615855;
-- SO's Header_Id 
oe_order_pub.process_order(p_api_version_number => 1.0,
p_init_msg_list => fnd_api.g_false,
p_return_values => fnd_api.g_false,
p_action_commit => fnd_api.g_false,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_action_request_tbl => l_action_request_tbl,
x_header_rec => x_header_rec,
x_header_val_rec => x_header_val_rec,
x_header_adj_tbl => x_header_adj_tbl,
x_header_adj_val_tbl => x_header_adj_val_tbl,
x_header_price_att_tbl => x_header_price_att_tbl,
x_header_adj_att_tbl => x_header_adj_att_tbl,
x_header_adj_assoc_tbl => x_header_adj_assoc_tbl,
x_header_scredit_tbl => x_header_scredit_tbl,
x_header_scredit_val_tbl => x_header_scredit_val_tbl,
x_line_tbl => x_line_tbl, x_line_val_tbl => x_line_val_tbl,
x_line_adj_tbl => x_line_adj_tbl, x_line_adj_val_tbl => x_line_adj_val_tbl,
x_line_price_att_tbl => x_line_price_att_tbl,
x_line_adj_att_tbl => x_line_adj_att_tbl,
x_line_adj_assoc_tbl => x_line_adj_assoc_tbl,
x_line_scredit_tbl => x_line_scredit_tbl,
x_line_scredit_val_tbl => x_line_scredit_val_tbl,
x_lot_serial_tbl => x_lot_serial_tbl,
x_lot_serial_val_tbl => x_lot_serial_val_tbl,
x_action_request_tbl => l_action_request_tbl);
--Check Return Status 
IF x_return_status = fnd_api.g_ret_sts_success THEN
dbms_output.put_line('Successfull.');
ELSE dbms_output.put_line('Failure.');
END IF;
--Process Message
dbms_output.put_line('Process Message');
FOR i IN 1 .. x_msg_count LOOP
oe_msg_pub.get(p_msg_index => i,
p_encoded => fnd_api.g_false,
p_data => l_msg_data,
p_msg_index_out => l_msg_index_out);
dbms_output.put_line('Messge: ' || l_msg_data);
--dbms_output.put_line('Message Index: ' || l_msg_index_out);
END LOOP;
--Debug Message
dbms_output.put_line('Debug Message');
dbms_output.put_line('Debug File: ' || oe_debug_pub.g_dir || '/' || oe_debug_pub.g_file);
FOR i IN 1 .. oe_debug_pub.g_debug_count LOOP
dbms_output.put_line(oe_debug_pub.g_debug_tbl(i)); 
END LOOP;
END;

  

标签:OM,iface,oe,Sales,tbl,rec,line,Open,order
From: https://www.cnblogs.com/samrv/p/18416873

相关文章

  • java pom两个模块需要互相引用怎么办
    一:概述 处理Java多模块项目中的互相引用:一种POM管理方式在Java的多模块项目中,模块间的互相引用是一个常见需求。本文将探讨在Maven项目管理工具中,如何有效地实现两个或多个模块之间的互相引用,并通过具体案例来展示不同方法的应用。 ava的多模块项目,通常是指一个项目包含多个子模......
  • docker-compose 安装activemq、rocketmq
    目录结构创建目录#activemq目录mkdir-p/docker/activemq/datamkdir-p/docker/activemq/conf#rocket目录mkdir-p/docker/rocketmq/broker1/confmkdir-p/docker/rocketmq/broker1/logsmkdir-p/docker/rocketmq/broker1/storemkdir-p/docker/rocketmq/names......
  • Prompt Engineering实战 AI老兵的15条经验与建议
    Author:Jason豪 编写提示时应清晰准确地传达信息。能够明确描述任务和概念至关重要。要愿意快速迭代,连续多次向模型发送提示并检测结果。优秀的提示工程师能够持续对已待优化prompt反复改进。在设计提示时要考虑边界情况和不寻常的场景。思考你的提示在非典型情况下可能会如......
  • AP Microeconomics
    Unit2-Introduction2-0Economics,Scarcity,FactorofProductionEconomicsEconomics:thesocialsciencethatstudiestheproduction,distribution,andconsumptionofgoodsandservices.Itexamineshowindividuals,businesses,governments,andother......
  • WPF DataGrid ContextMenu CommandParameter Relative x:Type ContextMenu ,Path=Plac
    //xaml<DataGrid.ContextMenu><ContextMenu><MenuItemHeader="SerializeBinary"Command="{BindingBinSerializeCmd}"CommandParameter="{BindingRelativeSource={Relativ......
  • Comsol多偶极子分析
    文章来源:DielectricMetamaterialswithToroidalDipolarResponse。添加图片注释,不超过140字(可选)在说环形偶极子之前,先来看看电偶极子和磁偶极子。电偶极子(或电荷偶极子)是由正电荷和负电荷分离产生的,而磁偶极子是由电流的闭合循环产生的。环形偶极子(toroidaldipole)......
  • vue3compute数据不响应的问题
    在vue3中,我们在写前端数据处理的时候,特别是在store中,特别容易代入后端处理思维,本身没有错,但是特别容易导致数据不响应,使用前端js的方式处理就可以解决这一问题,下面就是一些例子forEach用途:执行数组的每一项,不返回结果。示例:javascriptconstnumbers=[1,2,3];......
  • urllib自定义opener对象设置代理IP
    urllib.request.urlopen()源代码——urlopen()在干什么返回opener.open(url,data,timeout)方法的结果 _opener=None#_opener被赋值为Nonedefurlopen(url,data=None,timeout=socket._GLOBAL_DEFAULT_TIMEOUT,*,cafile=None,capath=None,cadefault=......
  • ARM SMMU原理与IOMMU技术(“VT-d” DMA、I/O虚拟化、内存虚拟化)
    名词缩写ASID:AddressSpaceID地址空间标识符CD:ContextDescriptor;上下文描述符;CTP:Context-tablepointer上下文表指针EPT:ExtendedPageTable扩展页表GPA:GuestPhyicalAddress客人的实际地址GVA:GuestVirtualAddress访客虚拟地址HPA:HostPhyicalAddress......
  • Photoshop启动故障:d3dcompiler_47.dll缺失的应对策略
    面对Photoshop因缺少d3dcompiler_47.dll文件而无法启动的问题,遵循以下细致步骤,逐一排查并修复:1.识别问题根源:•d3dcompiler_47.dll属于Direct3D编译器的一部分,通常与图形处理相关。缺失可能是由于软件更新不完全、系统文件损坏或第三方清理工具误删等原因。2.系统文件检查:......