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