OM: Order Import using OE_ORDER_PUB.PROCESS_ORDER

This article discusses som tips in importing sales order using oe_order_pub.process_order. The example is to import sales order with price adjustment.

1. to update price_adjustments, the existing price_adjustment_id is necessary , otherwise, oracle reports 'No data found'

 

2. processing constraints will be checked during import/update, to avoid this, we can either authorize the responsibility runing the program or make the processing constraint using OE_GLOBAL.G_UI_FALG sensitive API, and in custom program, manually set G_UI_FLAG= false.

 

3. use oe_msg_pub to get all the messages during process.

 

4. to pass unit_selling_price, unit_list_price into order line, calculate_price_flag need to be set to N, otherwise, process_order will automatically pick the price from price list, even unit_selling_price is assigned to the line_tbl variable.

 

5. although process_order can insert rows into oe_price_adjustments table, it never apply it to the explicitly entered unit_selling_price .

 

6, in view adjustment screen, one modifier can only be entered once, future price modification will change the modifier rate.

 

7. to map line level price adjustments when creating order, since the line is not yet created , so in line_adj_tbl, we need to put line_index to instruct oracle that this price adjustment maps to which line, so when later the line is create, when oracle create price adjustments, it can know while line to link price adjustment to.

 

8. in API, if a price adjustment is created with applied_flag='N', it will not display in view adjustment screen.

 

9. even the automatic_flag is passed in as 'N' for header level adjustment, it will automatically apply to line when a new line is created. strang, don't know what this automatic_flag is for.

 

10. due to a stupid bug of oracle, return_attributes will have some value if we pass data into attrubutes, for example, if we pass 'ABC' to attribute3, then return_attribute3 will have 'ABC' too. How stupid!. When user modifies any data in such lines, it will prompt for return reason.  To avoid this issue, before calling process_order , explicitly pass NULL into all those return_context and return_attributes, then the order will be created correctly.

future tips to be added

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
你可以编写一个存储过程来执行这个查询。下面是一个示例: ```sql CREATE OR REPLACE PROCEDURE get_data AS BEGIN -- 创建临时表来保存结果 CREATE GLOBAL TEMPORARY TABLE temp_data ( order_id NUMBER, done_date DATE, cust_id NUMBER, subscriber_ins_id NUMBER, access_num VARCHAR2(100), dev_id NUMBER, dev_name VARCHAR2(100), corp_org VARCHAR2(100), company_name VARCHAR2(100), department_code VARCHAR2(100), department_name VARCHAR2(100), remarks VARCHAR2(100) ) ON COMMIT PRESERVE ROWS; -- 第一个查询 INSERT INTO temp_data SELECT a.order_id, a.done_date, a.cust_id, a.subscriber_ins_id, a.access_num, c.dev_id, c.dev_name, c.corp_org, c.company_name, c.department_code, c.department_name, c.remarks FROM JOUR1.Om_Subscriber_202301 a LEFT JOIN JOUR1.om_order_202301 b ON a.order_id = b.order_id LEFT JOIN params1.sec_developer c ON b.dev_id = c.dev_id; -- 后续查询使用UNION ALL连接 INSERT INTO temp_data SELECT a.order_id, a.done_date, a.cust_id, a.subscriber_ins_id, a.access_num, c.dev_id, c.dev_name, c.corp_org, c.company_name, c.department_code, c.department_name, c.remarks FROM JOUR1.Om_Subscriber_202302 a LEFT JOIN JOUR1.om_order_202302 b ON a.order_id = b.order_id LEFT JOIN params1.sec_developer c ON b.dev_id = c.dev_id; INSERT INTO temp_data SELECT a.order_id, a.done_date, a.cust_id, a.subscriber_ins_id, a.access_num, c.dev_id, c.dev_name, c.corp_org, c.company_name, c.department_code, c.department_name, c.remarks FROM JOUR1.Om_Subscriber_202303 a LEFT JOIN JOUR1.om_order_202303 b ON a.order_id = b.order_id LEFT JOIN params1.sec_developer c ON b.dev_id = c.dev_id; INSERT INTO temp_data SELECT a.order_id, a.done_date, a.cust_id, a.subscriber_ins_id, a.access_num, c.dev_id, c.dev_name, c.corp_org, c.company_name, c.department_code, c.department_name, c.remarks FROM JOUR1.Om_Subscriber_202304 a LEFT JOIN JOUR1.om_order_202304 b ON a.order_id = b.order_id LEFT JOIN params1.sec_developer c ON b.dev_id = c.dev_id; -- 查询结果 SELECT * FROM temp_data; -- 删除临时表 DROP TABLE temp_data; END; / ``` 这个存储过程创建了一个临时表 `temp_data` 来保存查询结果,并将每个查询的结果插入到临时表中。最后,通过查询 `temp_data` 表来获取结果。 请注意,根据你的实际需求和数据库结构,你可能需要修改表和列的定义,以及查询的逻辑。确保在执行存储过程之前,已经创建了所需的表和索引。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值