Professional Documents
Culture Documents
Enter header level information like Customer name, Customer PO, Ship To, Bill To location,
Price list, Sales rep and currency for the Order.
Enter the line information like Item, Quantity, Request Date, Schedule Ship Date etc. Other line
info like Line Type, Cancelled Qty, Shipped Qty, Sales Rep, Order Source, Tax code etc. get
defaulted based on defaulting rules.
Pricing tab shows info like Unit Selling Price, Extended Price, Price List, List Price, Line
Charges, Tax Amount, Payment terms, Pricing Agreement etc. In view price adjustments we will
see the adjustments and charges applied on the list price, after applying all these the unit selling
price is derived.
WSH_CARRIERS_V WSH_CARRIER_SHIP_METHODS_V
CARRIER_ID CARRIER_SHIP_METHOD_ID
FREIGHT_CODE CARRIER_ID
CURRENCY_CODE SHIP_METHOD_CODE
CARRIER_NAME SERVICE_LEVEL
ACTIVE ENABLED_FLAG
SCAC_CODE FREIGHT_CODE
MANIFESTING_ENABLED_FLAG ORGANIZATION_ID
ORGANIZATION_CODE
CARRIER_SITE_ID
WEB_ENABLED
START_DATE_ACTIVE
END_DATE_ACTIVE
select
h.order_number,
h.shipping_method_code,
wc.carrier_name,
wcsm.SERVICE_LEVEL ,
wcsm.freight_code
from
wsh_carrier_ship_methods_v wcsm,
wsh_carriers_v wc,
oe_order_headers_all h
where h.order_number= 14463
and h.org_id = 204
and h.shipping_method_code =
wcsm.ship_method_code(+)
and nvl(wcsm.organization_id(+),0) = 204 --Master
Organization
and wcsm.freight_code = wc.freight_code(+)
order by h.order_number
Query to find price discounts and surcharges on order lines Query to find freight charges on
: order lines :
col list_line_type_code form a12 col charge_name form a24
col arithmetic_operator form a12 col source_system_code form a12
PA.PRICE_ADJUSTMENT_ID
AND PA1.PRICE_ADJUSTMENT_ID=
PAS.PRICE_ADJUSTMENT_ID
AND PA1.LIST_LINE_TYPE_CODE ='PBH')
Order by l.line_id
/
a: Qp_list_headers_vl is view based on qp_list_headers_b and
qp_list_headers_tl tables.
The tax amount appears while entering the order. The tax method, rate or amount of tax is
decided by the Receivables system options.
Oracle Receivables system option determines tax method.. i• Sales Tax ii• Value Added Tax
(VAT). For value added tax, taxes are based on tax rates assigned to user- defined codes. For
Sales tax location based tax is used as maintained below..
Here tax rates are maintained at state and zip code level. Usually third party softwares like
Taxware keeps updating the tax rates time to time.
Tax calculation in OM can occur at Entry, Booking or Invoicing which can only be controlled at
the order level. In "Tax event", you specify when to calculate the tax . The default value for Tax
Calculation Event Code is null which is same as Entry. The Receivables Transaction Type
associated here decides whether the order is taxable.
The tax calculation flag associated with the previous Receivables Transaction Type will
determine if tax is required on an order.
Sales tax rate for city 'San Jose' : Table ar_sales_tax contains location wise total tax- rates w
tax break up ..
select lv.parent_segment_id,lc.location_id_segment_3, select distinct
location_segment_user_value , location_id,
location_segment_value, lr.tax_rate rate_context,
from ar_location_rates lr, tax_rate,
ar_location_combinations lc, location1_rate,
ar_location_values lv location2_rate,
where lv.location_segment_user_value='San Jose' --City name location3_rate,
and lv.location_segment_id=lc.location_id_segment_3 from_postal_code,
and lv.location_structure_id= lc.location_structure_id to_postal_code
and lc.location_structure_id=101 from ar_sales_tax
and lv.location_segment_id=lr.location_segment_id where location_id=1000
order by 1 and enabled_flag='Y'
/ /
Creating a new order with 2 lines and 1 line adjustment and the adjustment belongs to the second
line.
Declare
l_header_rec := OE_ORDER_PUB.G_MISS_HEADER_REC; -- Required attributes (e.g. Order Type and Customer)
l_header_rec.order_type_id := 1000;
l_header_rec.sold_to_org_id := 100;
l_header_rec.price_list_id := 10;
l_header_rec.freight_term_code = NULL;
l_header_rec.operation := OE_GLOBALS.G_OPR_CREATE;
-- FIRST LINE RECORD. Initialize record to missing
l_line_tbl(1) := OE_ORDER_PUB.G_MISS_LINE_REC;
l_line_tbl(1).inventory_item_id := 311;
l_line_tbl(1).ordered_quantity := 1;
l_line_tbl(1).operation := OE_GLOBALS.G_OPR_CREATE;
-- SECOND LINE RECORD
l_line_tbl(2) := OE_ORDER_PUB.G_MISS_LINE_REC;
l_line_tbl(2)inventory_item_id := 312;
l_line_tbl(2).ordered_quantity := 2;
l_line_tbl(2).operation := OE_GLOBALS.G_OPR_CREATE;
-- LINE ADJUSTMENT RECORD
l_line_adj_tbl(1) := OE_ORDER_PUB.G_MISS_LINE_ADJ_REC;
l_line_adj_tbl(1).discount_id := 1;
l_line_adj_tbl(1).percent := 5;
l_line_adj_tbl(1).operation := OE_GLOBALS.G_OPR_CREATE;
-- Indicator that this adjustment belongs to the second line
l_line_adj_tbl(1).line_index := 2;
OE_ORDER_PUB.Process_Order(........
p_line_tbl=> l_line_tbl
......);
OE_ORDER_PUB.Process_Order(........
p_line_tbl=> l_line_tbl
........);
Deleting an order.
l_header_rec := OE_ORDER_PUB.G_MISS_HEADER_REC;
l_header_rec.header_id:=1000;
l_header_rec.operation := OE_GLOBALS.G_OPR_DELETE;
OE_ORDER_PUB.Process_Order(
p_header_rec=> l_header_rec
........);
Other OM APIs available are Release Hold, Book Order and for ATO models Delink Config and
Match & Reserve APIs are available.
Scheduling determines the source (warehouse) for an order line. If the warehouse is already
entered on the line, the scheduling action uses the requested warehouse to determine the
scheduled ship date, scheduled arrival date etc. If the warehouse is blank, the scheduling action
determines the best warehouse based on the sourcing rules.
1.5.2. Scheduling
Scheduling determines the schedule ship date, the schedule arrival date, the delivery lead time
and the shipping method. It makes the line visible to the planning applications and consumes
supply for the item. When a line is successfully scheduled the VISIBLE_DEMAND_FLAG is
set to Yes. If the reservation time fence is set and the schedule ship date is within the reservation
time fence, automatically reserves the line.
1.5.2.1. Autoschedule
The sales order line is scheduled when it is saved, if either the Autoschedule check box on the
order transaction type is checked or the OM: Autoschedule profile option is Yes. You can turn
Autoschedule on or off from the sales order window by going to the Tools menu. Note that if
autoschedule is turned on the availability window is automatically displayed when the sales
order window is opened. You can close the availability window, but the lines will still be
autoscheduled unless the autoschedule check box on the tools menu is unchecked.
1.5.3. Reserving
You can reserve on-hand inventory to a sales order. Reserved inventory cannot be used for any
other purpose. The reserved quantity for a sales order line is displayed on the shipping tab. You
may reserve part or all of the ordered quantity. A line must be scheduled before it can be
reserved. If you try to reserve an unscheduled line, the system will first try to schedule the line. If
the line is successfully scheduled then the system will try to reserve it.
There are two ways to reserve manually from the sales order window.
• Select reserve from the scheduling option under the tools menu
• Select reserve from the scheduling sub menu which is displayed when you select the context
menu.
If you are on an order line the line will be reserved. If you are on the header, all the lines will be
reserved.
Manual reservations are affected by a scheduling parameter that lets you control whether to
apply a partial reservation manually. If 9 out of 10 are available, and if you have set the
parameters to allow partials, you can right mouse click to bring up the context menu and select
Reserve to reserve the 9.
Once the order is scheduled and booked then we need to release the order to warehouse for
shipping.
Pick release the order from Release Sales Orders window. Enter the order number
and clear out the default scheduled ship date and requested date.
Make sure to include a Warehouse, based on this the order lines available on
the order will be filtered. Choose Auto Allocate as "Yes" such that the system
will suggest from which sibinventory or locator the goods can be shipped.
Set Autocreate delivery to Yes, such that a shipper/Delivery is automatically created.Check Auto
Pick Confirm box for accepting the suggestions given by system and staging the goods at staging
subinventory. If you don't want to use the suggestions made by the system then say Auto pick
confirm as "No". Then you need to go to Transact move order screen in Inventory and modify
the suggestions made by the system and thus manually pick confirm.
MTL_TXN_REQUEST_HEADERS MTL_TXN_REQUEST_LINES
HEADER_ID LINE_ID
REQUEST_NUMBER HEADER_ID
TRANSACTION_TYPE_ID LINE_NUMBER
MOVE_ORDER_TYPE ORGANIZATION_ID
ORGANIZATION_ID INVENTORY_ITEM_ID
DESCRIPTION REVISION
DATE_REQUIRED FROM_SUBINVENTORY_CODE
FROM_SUBINVENTORY_CODE FROM_LOCATOR_ID
TO_SUBINVENTORY_CODE TO_SUBINVENTORY_CODE
TO_ACCOUNT_ID TO_LOCATOR_ID
HEADER_STATUS LOT_NUMBER
STATUS_DATE SERIAL_NUMBER_START
GROUPING_RULE_ID SERIAL_NUMBER_END
SHIP_TO_LOCATION_ID UOM_CODE
FREIGHT_CODE QUANTITY
SHIPMENT_METHOD QUANTITY_DELIVERED
AUTO_RECEIPT_FLAG QUANTITY_DETAILED
REFERENCE_ID DATE_REQUIRED
REFERENCE_DETAIL_ID REASON_ID
ASSIGNMENT_ID REFERENCE
Query to find out Move order line details :
SELECT
wnd.delivery_id,
wnd.name delivery_name,
wnd.initial_pickup_location_id,
mtrh.request_number mo_number,
mtrl.line_number mo_line_number,
mtrl.line_id mo_line_id,
mtrl.from_subinventory_code,
mtrl.to_subinventory_code,
mtrl.lot_number,
mtrl.serial_number_start,
mtrl.serial_number_end,
mtrl.uom_code,
mtrl.quantity,
mtrl.quantity_delivered,
mtrl.quantity_detailed,
wdd.source_header_number
so_order_number,
oola.line_number so_line_number,
wdd.source_header_id so_header_id,
wdd.source_line_id so_line_id,
wdd.shipping_instructions,
wdd.inventory_item_id,
wdd.requested_quantity_uom,
msi.description item_description,
msi.revision_qty_control_code ,
wdd.ship_method_code carrier,
wdd.shipment_priority_code priority,
wdd.organization_id,
wdd.released_status,
wdd.source_code
FROM mtl_system_items_vl msi,
oe_order_lines_all oola,
mtl_txn_request_lines mtrl,
mtl_txn_request_headers mtrh,
wsh_delivery_details wdd,
wsh_delivery_assignments wda,
wsh_new_deliveries wnd
WHERE wnd.delivery_id =18910
AND wda.delivery_id = wnd.delivery_id(+)
AND wdd.delivery_detail_id = wda.delivery_detail_id
AND wdd.move_order_line_id = mtrl.line_id
AND mtrl.header_id = mtrh.header_id
AND wdd.inventory_item_id = msi.inventory_item_id(+)
AND wdd.organization_id = msi.organization_id(+)
AND wdd.source_line_id = oola.line_id
AND wdd.source_header_id = oola.header_id
/
The ship confirmation window will appear and give you the options to
backorder, ship all or ship partial quantities and set user defined shipping
documents to print. Enter the trip creation options viz: Ship method,
departure date, close trip and defer interface.The ship confirm process
triggers the inventory interface automatically to update quantities, and
triggers the Order Management Interface to update the status of the order lines.
Invoicing the order:
Once the Fulfillment activity completes, a Background Workflow Process
processes the order line(s) to the Invoice Interface activity. The invoice
interface activity places the information from the sales order line into the
Receivables Interface tables. The invoice is not generated until the
Autoinvoice program in Receivables has been run. The invoice will then be
viewable in the Sales Orders window. The line will be eligible to close after
the Invoice interface workflow is run.
WSH_NEW_DELIVERIES WSH_DELIVERY_DETAILS
DELIVERY_ID DELIVERY_DETAIL_ID
NAME SOURCE_CODE
PLANNED_FLAG SOURCE_HEADER_ID
STATUS_CODE SOURCE_LINE_ID
INITIAL_PICKUP_DATE SOURCE_HEADER_TYPE_ID
INITIAL_PICKUP_LOCATION_ID SOURCE_HEADER_TYPE_NAME
ULTIMATE_DROPOFF_LOCATION_ID CUST_PO_NUMBER
ULTIMATE_DROPOFF_DATE CUSTOMER_ID
CUSTOMER_ID INVENTORY_ITEM_ID
INTMED_SHIP_TO_LOCATION_ID ITEM_DESCRIPTION
POOLED_SHIP_TO_LOCATION_ID
FREIGHT_TERMS_CODE
FOB_CODE
FOB_LOCATION_ID
WAYBILL
WSH_DELIVERY_LEGS WSH_TRIPS WSH_TRIP_STOPS
DELIVERY_LEG_ID TRIP_ID STOP_ID
DELIVERY_ID NAME TRIP_ID
PICK_UP_STOP_ID PLANNED_FLAG STOP_LOCATION_ID
DROP_OFF_STOP_ID ARRIVE_AFTER_TRIP_ID STATUS_CODE
SEQUENCE_NUMBER STATUS_CODE STOP_SEQUENCE_NUMBER
LOADING_ORDER_FLAG VEHICLE_ITEM_ID PLANNED_ARRIVAL_DATE
GROSS_WEIGHT VEHICLE_NUMBER PLANNED_DEPARTURE_DATE
NET_WEIGHT CARRIER_ID ACTUAL_ARRIVAL_DATE
WEIGHT_UOM_CODE SHIP_METHOD_CODE ACTUAL_DEPARTURE_DATE
VOLUME ROUTE_ID DEPARTURE_GROSS_WEIGHT
VOLUME_UOM_CODE ROUTING_INSTRUCTIONS DEPARTURE_NET_WEIGHT
LOAD_TENDER_STATUS VEHICLE_ORGANIZATION_ID WEIGHT_UOM_CODE
SHIPPER_TITLE DEPARTURE_VOLUME
SHIPPER_PHONE
2.4.1.1 Scenario 1
Assume a scenario where an Enterprise uses a legacy system to ship the goods and then need t
with actual shipment data.We will use the above APIs and keep Oracle tables in sync with the lega
At first the actual shipment data is staged in a temporary table. You need to identify the actual de
shipment and call "Auto-create delivery" API which will group the delivery details and create the D
"Pick release Delivery" API to pick the delivery. Now your delivery deails are staged/pick confirmed
quantity. Now call "Update actual shipped qty" API to update the actual shipped quantities as per
need to call "Ship confirm Delivery" API to confirm the Shipper. This completes the shipment synch
Oracle.
2.4.1.2 Scenario 2
An example of how to ship confirm a delivery consisting of delivery details that have already been
a delivery..
Procedure SHIP_CONFIRM1
::::::::::::
changed_attributes WSH_DELIVERY_DETAILS_PUB.ChangedAttributeTabType;
p_entity_tab WSH_UTIL_CORE.id_tab_type;
p_group_id_tab WSH_UTIL_CORE.id_tab_type;
p_pack_cont_flag varchar2(30);
x_cont_inst_tab WSH_UTIL_CORE.id_tab_type;
action_code VARCHAR2(15);
pub_freight_costs WSH_FREIGHT_COSTS_PUB.PubFreightCostRecType;
freight_cost_id NUMBER;
p_action_code VARCHAR2(15);
p_delivery_id NUMBER;
p_delivery_name VARCHAR2(30);
p_asg_trip_id NUMBER;
::::::::::::::::::::::::::::::::::::::::::::::::::
/*Handle exceptions*/
fail_api EXCEPTION;
BEGIN
,resp_id =>52892
,resp_appl_id =>660);
/* Values for updating delivery details to ship all quantities in the first line, stage everything in the second lin
It is assumed that the user knows the quantities in each line. */
source_code := 'OE'; -- The only source code that should be used by the API
changed_attributes(1).shipped_quantity := 1;
changed_attributes(2).shipped_quantity := 0;
changed_attributes(2).cycle_count_quantity := 2;
changed_attributes(3).source_line_id := 13433; -- Stage All in this detail.
changed_attributes(3).shipped_quantity := 0;
changed_attributes(3).cycle_count_quantity := 0;
WSH_DELIVERY_DETAILS_PUB.Update_Shipping_Attributes(
:::::::::::::
raise fail_api;
end if;
/* Values for creating freight costs for the delivery created for the above delivery details. The delivery can b
delivery detail through wsh_delivery_assignments. */
pub_freight_costs.freight_cost_type_id := 1;
pub_freight_costs.unit_amount := 20;
pub_freight_costs.currency_code := 'USD';
pub_freight_costs.delivery_id := 5341;
WSH_FREIGHT_COSTS_PUB.Create_Update_Freight_Costs(
::::::::::
raise fail_api;
end if;
p_entity_tab(1) := 13431;
p_entity_tab(2) := 13432;
p_entity_tab(3) := 13434;
WSH_CONTAINER_PUB.Auto_Pack(
raise fail_api;
end if;
WSH_DELIVERIES_PUB.Delivery_Action(
::::::::::::
raise fail_api;
end if;
exception
else
x_msg_data := x_msg_summary;
end if;
END SHIP_CONFIRM1;
2.4.1.2. Scenario 3
Ship confirm delivery details that have originally not been assigned to a delivery.
Call WSH_DELIVERIES_PUB.CREATE_UPDATE_DELIVERY to create a new delivery.
Call WSH_DELIVERY_DETAILS_PUB.Detail_to_Delivery to assign the delivery details to the new deliv
Call WSH_DELIVERIES_PUB.Delivery_Action to ship confim.
Procedure SHIP_CONFIRM2
::::::::::::::::::
Begin
FND_GLOBAL.APPS_INITIALIZE(user_id => 1001594
,resp_id =>52892
,resp_appl_id =>660);
::::::::::
-- Values for WSH_DELIVERIES_PUB.CREATE_UPDATE_DELIVERY to create a new delivery
delivery_info.initial_pickup_location_id := 204;
delivery_info.ultimate_dropoff_location_id := 840;
delivery_info.gross_weight := 10;
delivery_info.ship_method_code := 'UPS';
p_action_code := 'CREATE';
WSH_DELIVERIES_PUB.CREATE_UPDATE_DELIVERY(
p_api_version_number => 1.0,
::::::::::::::::::
p_action_code => p_action_code,
p_delivery_info => delivery_info,
x_delivery_id => delivery_id
::::::::::::
WSH_DELIVERY_DETAILS_PUB.Detail_to_Delivery(
p_api_version => 1.0,
::::::::::::::::::::::::::::
p_TabOfDelDets => p_TabOfDelDets,
p_action => p_action,
p_delivery_id => p_delivery_id,
:::::::::::::
if (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) then
raise fail_api;
end if;
WSH_DELIVERIES_PUB.Delivery_Action(
p_api_version_number => 1.0,
::::::::::::::::::
p_action_code => p_action_code,
p_delivery_id => p_delivery_id,
p_delivery_name => p_delivery_name,
p_sc_action_flag => p_sc_action_flag,
p_sc_close_trip_flag => p_sc_close_trip_flag,
p_sc_trip_ship_method => p_sc_trip_ship_method
::::::::::::::::::