Académique Documents
Professionnel Documents
Culture Documents
Order Entry
This is first stage, When the order is entered in the system, it creates a record in order headers
and Order Lines table.
Enter header details: Once you enter details on the order header and save it or move it to
lines, record goes to one table oe_order_headers_all
o No record exists in any other table for this order till now.
Enter Line details for this order: Enter different item numbers, quantity and other details
in line tab. When the record gets saved, it goes to one table. Order header details will be
linked with line details by order HEADER_ID.
2. Order Booking
This is next stage, when Order is booked then the Flow status changed from Entered to Booked.
At this stage, these below table get affected.
oe_order_headers_alL
oe_order_lines_all
wsh_delivery_details
wsh_delivery_assignments
wsh_new_deliveries
wsh_delivery_assignments
wsh_delivery_details
MTL_TXN_REQUEST_HEADERS
MTL_TXN_REQUEST_LINES
Mtl_material_transactions_temp
MTL_SERIAL_NUMBERS_TEMP
MTL_SERIAL_NUMBERS
*In shipping transaction form order status remains Released to Warehouse and all the material
still remains in source sub-inventory. We need to do Move Order Transaction for this order. Till
this no material transaction has been posted to MTL_MATERIAL_TRANSACTIONS
5. Pick Confirm/ Move Order Transaction
Items are transferred from source sub-inventory to staging Sub-inventory. Here material
transaction occurs.
Order line status becomes Picked on Sales Order and Staged/Pick Confirmed on Shipping
Transaction Form.
MTL_MATERIAL_TRANSACTIONS_TEMP
oe_order_lines_all
MTL_MATERIAL_TRANSACTIONS
mtl_transaction_accounts
wsh_delivery_details
wsh_delivery_assignments
MTL_ONHAND_QUANTITIES
MTL_SERIAL_NUMBERS_TEMP
MTL_SERIAL_NUMBERS
* This step can be eliminated if we set Pick Confirm=YES at the time of Pick Release
6. Ship Confirm
Here ship confirm interface program runs in background. Data removed from
wsh_new_deliveries.
The items on the delivery gets shipped to customer at this stage.
oe_order_lines_all
wsh_delivery_details
WSH_SERIAL_NUMBERS
mtl_transaction_interface
mtl_material_TRANSACTIONS
mtl_transaction_accounts
mtl_demand, MTL_reservations
MTL_ONHAND_QUANTITIES
MTL_SERIAL_NUMBERS_TEMP
MTL_SERIAL_NUMBERS
7. Enter Invoice
After shipping the order the order lines gets eligible to get transferred to
RA_INTERFACE_LINES_ALL. Workflow background engine picks those records and post it to
RA_INTERFACE_LINES_ALL. This is also called Receivables interface, that mean information
moved to accounting area for invoicing details. Invoicing workflow activity transfers shipped
item information to Oracle Receivables. At the same time records also goes in the table
RA_INTERFACE_SALESCREDITS_ALL which hold details of sales credit for the particular
order.
ra_interface_lines_all (interface table into which the data is transferred from order management)
Then Auto-invoice program imports data from this table which get affected into this stage are
receivables base table. At the same time records goes in ra_customer_trx_all and
ra_customer_trx_lines_all
8. Complete Line
In this stage order line level table get updated with Flow status and open flag.
oe_order_lines_all
9. Close Order
This is last step of Order Processing. In this stage only oe_order_lines_all table get updated.
These are the table get affected in this step.
oe_order_lines_all
oe_order_HEADERS_all
Query to Join OM and requisition Interface table for Back 2 back Order
select l.line_id, l.flow_status_code ,
l.open_flag,pr.interface_source_code,pr.interface_source_line_id,pr.note_to_buyer,
pr.note_to_receiver
from
oe_order_lines_all l,
po_requisitions_interface_all pr
where l.line_id = pr.interface_source_line_id
and pr.interface_source_code='CTO'
Query to Join OM and Purchase Order tables for Back 2 Back Order
select ph.segment1,a. supply_source_line_id, a.supply_source_header_id
from
mtl_reservations a,
oe_order_lines_all l,
po_headers_all ph
where demand_source_line_id = &Enter_Order_lineID
and l.line_id = a.demand_source_line_id
and a.supply_source_header_id = ph.po_header_id
Query to Join OM and PO Requisition table for Back 2 Back Order
select ph.segment1,a. supply_source_line_id, a.supply_source_header_id
from
mtl_reservations a,
oe_order_lines_all l,
po_requisition_headers_all pqh
where demand_source_line_id = &Enter_Order_lineID
and l.line_id = a.demand_source_line_id
function xxcreateOrder
(
p_order_type_id NUMBER,
p_sold_to_org_id NUMBER,
p_ship_to_org_id NUMBER,
p_price_list_id NUMBER,
p_transactional_curr_code VARCHAR2,
p_flow_status_code VARCHAR2,
p_cust_po_number VARCHAR2,
p_order_source_id NUMBER,
p_inventory_item_id NUMBER,
p_ordered_quantity NUMBER,
p_tax_code VARCHAR2,
p_code VARCHAR2,
p_header_id NUMBER,
p_line_id NUMBER
)
return VARCHAR2 is
l_api_version_number NUMBER := 1;
l_return_status VARCHAR2(2000);
l_msg_count NUMBER;
l_msg_data VARCHAR2(2000);
l_xxstatus VARCHAR2(1000);
/*****************PARAMETERS***********************************************
*****/
l_debug_level number := 1; -- OM DEBUG LEVEL (MAX 5)
l_org number := 204; -- OPERATING UNIT
l_user number := 1318; -- USER
l_resp number := 21623; -- RESPONSIBLILTY
l_appl number := 660; -- ORDER MANAGEMENT
/***INPUT VARIABLES FOR PROCESS_ORDER API*************************/
l_header_rec oe_order_pub.header_rec_type;
l_line_tbl oe_order_pub.line_tbl_type;
l_action_request_tbl oe_order_pub.Request_Tbl_Type;
/***OUT VARIABLES FOR PROCESS_ORDER API***************************/
l_header_rec_out oe_order_pub.header_rec_type;
l_header_val_rec_out oe_order_pub.header_val_rec_type;
l_header_adj_tbl_out oe_order_pub.header_adj_tbl_type;
l_header_adj_val_tbl_out oe_order_pub.header_adj_val_tbl_type;
l_header_price_att_tbl_out oe_order_pub.header_price_att_tbl_type;
l_header_adj_att_tbl_out oe_order_pub.header_adj_att_tbl_type;
l_header_adj_assoc_tbl_out oe_order_pub.header_adj_assoc_tbl_type;
l_header_scredit_tbl_out oe_order_pub.header_scredit_tbl_type;
l_header_scredit_val_tbl_out oe_order_pub.header_scredit_val_tbl_type;
l_line_tbl_out oe_order_pub.line_tbl_type;
l_line_val_tbl_out oe_order_pub.line_val_tbl_type;
l_line_adj_tbl_out oe_order_pub.line_adj_tbl_type;
l_line_adj_val_tbl_out oe_order_pub.line_adj_val_tbl_type;
l_line_price_att_tbl_out oe_order_pub.line_price_att_tbl_type;
l_line_adj_att_tbl_out oe_order_pub.line_adj_att_tbl_type;
l_line_adj_assoc_tbl_out oe_order_pub.line_adj_assoc_tbl_type;
l_line_scredit_tbl_out oe_order_pub.line_scredit_tbl_type;
l_line_scredit_val_tbl_out oe_order_pub.line_scredit_val_tbl_type;
l_lot_serial_tbl_out oe_order_pub.lot_serial_tbl_type;
l_lot_serial_val_tbl_out oe_order_pub.lot_serial_val_tbl_type;
l_action_request_tbl_out oe_order_pub.request_tbl_type;
l_msg_index NUMBER;
l_data VARCHAR2(2000);
l_loop_count NUMBER;
l_debug_file VARCHAR2(200);
-- book API vars
b_return_status VARCHAR2(200);
b_msg_count NUMBER;
b_msg_data VARCHAR2(2000);
BEGIN
dbms_application_info.set_client_info(l_org);
--MO_GLOBAL.set_policy_context('S',l_org);
/*****************INITIALIZE DEBUG
INFO*************************************/
if (l_debug_level > 0) then
l_debug_file := OE_DEBUG_PUB.Set_Debug_Mode('FILE');
oe_debug_pub.initialize;
oe_debug_pub.setdebuglevel(l_debug_level);
Oe_Msg_Pub.initialize;
end if;
/*****************INITIALIZE
ENVIRONMENT*************************************/
fnd_global.apps_initialize(l_user, l_resp, l_appl); -- pass in user_id, responsibility_id, and
application_id
/*****************INITIALIZE HEADER RECORD******************************/
l_header_rec := oe_order_pub.G_MISS_HEADER_REC;
/***********POPULATE REQUIRED ATTRIBUTES
**********************************/
dbms_output.put_line('Start'||'--'||p_code||'--'||substr(p_code,1));
IF p_code = 'AL' THEN -- add Create Shippable Line
dbms_output.put_line('Add New Ship Line');
---Create 1 Line
l_line_tbl(1) := oe_order_pub.G_MISS_LINE_REC;
l_line_tbl(1).operation := OE_GLOBALS.G_OPR_CREATE;
l_line_tbl(1).inventory_item_id := p_inventory_item_id;--149 ;
l_line_tbl(1).ordered_quantity := p_ordered_quantity;--1;
l_line_tbl(1).ship_to_org_id := p_ship_to_org_id;--1024 ;
l_line_tbl(1).tax_code := p_tax_code;--'Location' ;
l_line_tbl(1).header_id := p_header_id;
END IF;
/*****************CALLTO PROCESS ORDER
API*********************************/
dbms_output.put_line('Calling API');
oe_order_pub.Process_Order( p_api_version_number => l_api_version_number,
p_header_rec => l_header_rec,
p_line_tbl => l_line_tbl,
p_action_request_tbl => l_action_request_tbl,
--OUT variables
x_header_rec => l_header_rec_out,
x_header_val_rec => l_header_val_rec_out,
x_header_adj_tbl => l_header_adj_tbl_out,
x_header_adj_val_tbl => l_header_adj_val_tbl_out,
x_header_price_att_tbl => l_header_price_att_tbl_out,
x_header_adj_att_tbl => l_header_adj_att_tbl_out,
x_header_adj_assoc_tbl => l_header_adj_assoc_tbl_out,
x_header_scredit_tbl => l_header_scredit_tbl_out,
x_header_scredit_val_tbl => l_header_scredit_val_tbl_out,
x_line_tbl => l_line_tbl_out,
x_line_val_tbl => l_line_val_tbl_out,
x_line_adj_tbl => l_line_adj_tbl_out,
x_line_adj_val_tbl => l_line_adj_val_tbl_out,
x_line_price_att_tbl => l_line_price_att_tbl_out,
x_line_adj_att_tbl => l_line_adj_att_tbl_out,
x_line_adj_assoc_tbl => l_line_adj_assoc_tbl_out,
x_line_scredit_tbl => l_line_scredit_tbl_out,
x_line_scredit_val_tbl => l_line_scredit_val_tbl_out,
x_lot_serial_tbl => l_lot_serial_tbl_out,
x_lot_serial_val_tbl => l_lot_serial_val_tbl_out,
x_action_request_tbl => l_action_request_tbl_out,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data);
/*****************CHECK RETURN STATUS***********************************/
if l_return_status = FND_API.G_RET_STS_SUCCESS then
-----------------------declare
l_status VARCHAR2(1000);
p_header_id NUMBER;
p_line_id NUMBER:=197953;
p_code VARCHAR2(10):='AL';
BEGIN
l_status:= xxorderprocess.xxcreateOrder(1437,1005,1024,1000,'USD','ENTERED',
'PO-9090',0,149,100,'Location',
p_code,p_header_id,p_line_id);
dbms_output.put_line('l_status ='||l_status);
end;