Importing Sales Orders or Returns

IMPORTING SALES ORDERS AND/OR RETURNS :

     Order Import is an open interface owned by Oracle Order Management. Order Import consists of interface tables and a set of APIs. You can import new, change and completed sales orders or returns from legacy applications, EDI Transactions processed through the Gateway, or internal orders created from Oracle Purchasing’s internal requisitions, or returns. In addition, Order Import provides forms that allow you to query orders from the interface tables, make corrections or changes to the date, and re-initiate the import process. Messages are provided to give you the details why the order did not import.

The features of Order Import include validation and defaulting, processing constraint checks, applying and releasing of order holds, shipment scheduling, then ultimately inserting, updating or deleting the orders in the base Order Management tables. All data is checked for validity during the import process.

Order Import uses the Process Orders API to validate and process order date in the interface tables. Valid transactions are converted into orders with lines, reservations, price adjustments and sales credits.

The following parameter and profile options must be defined in order to use Order Import.

Order Management System Parameter:
– OM: Item Validation Organization

Order Management Profile Options:
– OM: Reservation Time Fence
– OM: Apply Automatic Attachments 

Using Interface tables or API’s one can import orders in an entered, booked or closed status. If an order is imported as booked, the order is automatically eligible to progress to the next step the the workflow. If any of the fields required for a booked order are not supplied then Order Management places the order in an entered states and notifies the error.

One can indicate whether you want to manually enter prices for imported orders or allow Order Management to automatically price the order.

If you want to use automatice pricing, set the column OE_LINES_INTERFACE.
CALCULATE_PRICE_FLAG to Calculate Price. All pricing information must be set up in Oracle Pricing and Order Management. If you want to use manual pricing, set the column OE_LINES_INTERFACE. CALCULATE_PRICE_FLAG to Freeze Price. If you want the system to only calculate Freight Charges, set the column OE_LINES_INTERFACE.CALCULATE_PRICE_FLAG to Partial Price.

Order Import can also perform a price comparison on your imported orders. For example, you can provide a selling price and also have the system calculate a price. Order Import will WARN you of any differences. Please see table 24-1 in the Oracle Order Management Implementation Manual for examples of differences in the customer price and system price and how the Calculate Price Flag affects the process.

You can run the Order Import process in validation-only mode. This mode allows the transaction to be validated against all of the Order Management rules but does not pass any valid transactions into the Order Management tables.

The Order Import window consists of the Find and Summary windows. The Find window allows you to find orders to be imported based on certain attributes such as Request ID, Order Source, Original System, Document Reference and Change sequence.

The summary window displays order headers, lines, sales credits, price adjustments, lot serial numbers, reservations and action requests. You can use Oracle Application Folder functionality to limit or display fields. You can perform the following actions from this form:
– modify orders. 
– insert, update and delete the orders and lines in the interface tables.
– update one or multiple orders or lines at the same time using the multi-select functionality.
– mark an order or line to be rejected by setting the rejected flag.
– submit a request by selecting Order Import Request and select the appropriate parameter and choose Submit.

Order Import has the following paramters
1. Order Source
2. Order Reference
3. Validate Only
4. Processing Results

Customer items numbers or UPC numbers can be entered in Order Import the same way as a manually entered sales order as long as all cross-reference data is defined before the order import process is run. Set the OE_LINES_IFACE_ALL. CUSTOMER_ITEM_NAME to the ‘item ordered’. If you know what kind of item number it is (for example customer or inventory), you can set the
OE_LINES_IFACE_ALL.CUSTOMER_ITEM_TYPE.

You can import changes and cancellations to existing imported orders by setting the OPERATION_CODE in each of the interface tables. A NULL value is equivalent to INSERT. If you want to make changes, use an OPERATION_CODE of UPDATE. To cancel a line set the OPERATION_CODE to UPDATE and make ordered quantity = 0. To cancel an order in its entirety, set the OPERATION_CODE at the Header to UPDATE and set the CANCEL_FLAG to Y.

Import sales order returns just like you import standard orders choosing an order type that supports return line types. You can also import mixed orders, orders which have both standard sales order lines and return order lines.

To import orders you will need to load the Order Import Interface Tables. In most situations, you will develop a program or script to convert data from the feeder system into the standard format that Order Import is expecting. You can import orders with any external source defined in the Define Document Sequences window.

Oracle Purchasing contains a program, Create Internal Sales Orders, that takes the data from the Purchasing schema for internal requisitions and loads the Order Import tables. The eCommerce Gateway also provides a program, Purchase Order Inbound, that loads the import tables for the Inbound Purchase Order EDI transactions set.

It is recommended that you set up Defaulting Rules in Order Management that will default as much of the order and line information as possible for you environment. This will reduce the amount of data that needs to be populated into the Order Management Interface tables. Please review Note 198900.1 for comprehensive information detailing the definition of Defaulting Rules.

Please tables 2-1 through 2-10 for all required columns and settings.

Overview of Process Order API

Process Order API is a PL/SQL packaged procedure which can be used to manipulate the sales order data by performing Insert, update or delete operation on the following sales Order business object entities. Analogous to other public APIs available to the users), Process Order API also validates the data before inserting them into the application tables.
Though Process Order API has packaged procedures which will insert, update, delete data into the tables, they can not be run on their own. Either they need to be called from another package procedure or can be executed as PL/SQL block via the sql*plus.

 

Structure of PL/SQL block to call process Order API


 

Detailed explanation to each of these section is discussed as follows 


 

 

Process Order Usage

This section is intended to help the users of the process order API in identifying the required parameters for some common operations and to give an understanding of the business flow behind each of these operations.

 CREATE Operation

In order to create new entities in order management using process_order API, it is necessary that the operation OE_GLOBALS.G_OPR_CREATE is passed alone with the necessary entity records and entity tables.

Create an Order with one line: 
The following code snippet shows the various attributes required to create an order with one header and line

Adding a new line to an existing order


 

IMP Note: It is not possible to insert new lines (or, process any other entity) belonging to different orders in one process order call

UPDATE Operation

In order to update the entities in order management using process_order API, it is necessary that the operation OE_GLOBALS.G_OPR_UPDATE is passed alone with the necessary entity records and entity tables.

Cancelling an existing Order:
In order to cancel an order set the cancelled_flag to Y
The following sections describe the code required to cancel an order.


 

Cancelling an existing Order Line: 

In order to cancel an order line, set the cancelled_flag to Y
The following sections describe the code required to cancel an order line.


 

Updating the Line Quantity:

Updates or cancels a quantity on a sales Order Line


 

Reserve an existing order line : 
Reservation can be done by providing the reserved_quantity to some non zero value.


 

Unreserve a reserved order line: 
Unreservation can be done by reducing reserved quantity or make reserved quantity to zero.


 

Splitting an Order Line: 
To split an order line using Process_Order API, It is required to pass the following parameters :


 

 In R12 out parameters are to be used separately .

ie.,instead of x_header_rec => l_header_rec use x_header_rec => p_header_rec and so on for all other OUT parameters.

 

 DELETE Operation

In order to delete the entity record, its necessary to pass the operation like OE_GLOBALS.G_OPR_DELETE. The only attribute which needs to be passed is either the header id or the line id depending on the whether deletion is done for the order or the line. Deletes are cascaded down to the child entities. For example to delete a header record all the child entities i.e. lines, header sales credits, header adjustments are deleted. Deleting the lines results in the deletion of line adjustments, line sales credits and line lot serial numbers as well.
Deletes would also result in the deletion of any holds and attachments associated with the deleted entity and its child entities. The workflow status information for this entity is also purged.

Delete Order: 
–This is to delete an order


 

Delete Line: 
— This is to delete an order line


 

 Other Action Requests

Book Order: 
Following are the details of the requests used to book the order

request_type –> OE_GLOBALS.G_BOOK_ORDER
Entity_code –> This should be always set to OE_GLOBALS.G_ENTITY_HEADER as booking is an order level action.
Entity_id –> Header ID of the order to be booked.

If the order is also being created in the same call to process order, then the user does not need to
provide this value.

 

l_line_tbl_index := 1;
l_action_request_tbl(l_line_tbl_index).request_type := oe_globals.g_book_order;
l_action_request_tbl(l_line_tbl_index).entity_code := oe_globals.g_entity_header;
l_action_request_tbl(l_line_tbl_index).entity_id := <>;

Apply Hold: 
Following are the details of the requests used to apply hold to the sales Order Header or Line depending on the parameters passed to the Process_Order .

request_type –> OE_GLOBALS.G_APPLY_HOLD
Entity_code –> OE_GLOBALS.G_ENTITY_ORDER for order or OE_GLOBALS.G_ENTITY_LINE for line.
Entity_id –> ID of the order or line to be held
Param1 –> Hold ID to identify the type of hold that should be applied. (HOLD_ID from OE_HOLD_DEFINITIONS)
Param2 –> Hold entity code for the hold source to be created.
C: Customer hold source
S: Bill To or Ship To hold source
I: Item hold source
O: Order hold source
W: Warehouse Hold Source 

Param3 –> Hold entity ID
C, B, or S: for Org ID
O: Header ID
I: Inventory Item ID 

param4 –> Hold comment
date_param1 –> Hold Until Date
parm6-param20 –> Attribute1-15 of the descriptive flex field associated with the hold source record.
–This is to create a hold on an order header
l_request_rec.entity_id := &Order Header ID;
l_request_rec.entity_code := OE_GLOBALS.G_ENTITY_HEADER;
l_request_rec.request_type := OE_GLOBALS.G_APPLY_HOLD;
— hold_id must be passed
l_request_rec.param1 := &Hold ID;
— indicator that it is an order hold
l_request_rec.param2 := ‘O’ ;
— Header ID of the order
l_request_rec.param3 := &Order Header ID;
l_action_request_tbl(l_line_tbl_index) := l_request_rec;

Release Hold:
Following are the details of the requests used to release hold from the sales Order Header or Line depending on the parameters passed to the Process_Order .

request_type –> OE_GLOBALS.G_RELEASE_HOLD
Entity_code –> OE_GLOBALS.G_ENTITY_HEADER for order or OE_GLOBALS.G_ENTITY_LINE for line.
Entity_id –> ID of the order or line to be released from hold
Param1 –> Hold ID to specify the type of hold that is to be removed.
Param2 –> Hold entity code on the hold source associated with the hold to be released
C: Customer hold source
S: Bill To or Ship To hold source
I: Item hold source
O: Order hold source
W: Warehouse Hold Source 

param3 –> Hold entity ID:
C or S: for Org ID
O: Header ID
I: Inventory Item ID

param4 –> Release Reason Code
param5 –> Release Comment

 

— This is to release a hold on the order
l_request_rec.entity_id := &Order Header ID;
l_request_rec.entity_code := OE_GLOBALS.G_ENTITY_HEADER;
l_request_rec.request_type := OE_GLOBALS.G_RELEASE_HOLD;
— hold_id must be passed
l_request_rec.param1 := &Hold ID;
— indicator that it is an order hold
l_request_rec.param2 := ‘O’ ;
— Header ID of the order
l_request_rec.param3 := &Order Header ID;
l_request_rec.param4 :=’OM_APPROVE’;
l_action_request_tbl(l_line_tbl_index) := l_request_rec;

 

Leave a Reply