You are on page 1of 44

1.

Order Management Overview


1.1. Enter Orders

1.1.1. Enter Header information

Enter header level information like Customer name, Customer PO, Ship To, Bill To location,
Price list, Sales rep and currency for the Order.

Fig1.1 Order Entry Screen


These field values can be set up to default from a variety of sources such as the Order Type,
Customer or Customer address record. Defaulting rules can be set up to achieve this. All defaults
can be overridden unless the business unit defines constraints preventing update. Enter Other
Header information like sales channel, warehouse, payment term, ship method, Line set ( ship or
Arrival), FOB, shipping and packing instructions, Tax exempt number and reason etc.
1.1.2. Order Actions
Fig 1.2 Additional Order Information
Other functions are available through the Actions button. The Actions include functions such as
Additional order information, Copy, Cancel, Apply and Release Holds, Price Order, etc.

1.1.3. Enter Line information

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.

1.1.4. Line Shipping information


Shipping tab shows info like warehouse, Receiving Org (for Drop ship orders), Schedule Ship
date, schedule arrival date, Source type (External for Drop ship orders and Internal otherwise),
Ship set, Arrival set, Shiping method, shipment priority, Freight terms, Shipping and Packing
Instructions etc.

1.1.5. Line Pricing information

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.

1.1.6. Order Architecture

OE_ORDER_HEADERS_ALL OE_ORDER_LINES_ALL RA_SALESREPS OE_TRANSACTION_TYPES_TL


HEADER_ID LINE_ID SALESREP_ID TRANSACTION_TYPE_ID
ORDER_NUMBER ORG_ID SALES_CREDIT_TYPE_ID NAME
ORG_ID HEADER_ID NAME DESCRIPTION
ORDER_TYPE_ID LINE_TYPE_ID SALESREP_NUMBER
VERSION_NUMBER LINE_NUMBER STATUS OE_TRANSACTION_TYPES_ALL
ORDER_SOURCE_ID ORDERED_ITEM START_DATE_ACTIVE TRANSACTION_TYPE_ID
SOURCE_DOCUMENT_TYPE_ID REQUEST_DATE END_DATE_ACTIVE TRANSACTION_TYPE_CODE
ORIG_SYS_DOCUMENT_REF PROMISE_DATE SET_OF_BOOKS_ID ORDER_CATEGORY_CODE
SOURCE_DOCUMENT_ID SCHEDULE_SHIP_DATE ORG_ID CUST_TRX_TYPE_ID
ORDERED_DATE ORDER_QUANTITY_UOM EMAIL_ADDRESS COST_OF_GOODS_SOLD_ACCOUNT
REQUEST_DATE PRICING_QUANTITY ASSIGNED_TO_USER_ID PRICE_LIST_ID
PRICING_DATE PRICING_QUANTITY_UOM COST_CENTER WAREHOUSE_ID
SHIPMENT_PRIORITY_CODE CANCELLED_QUANTITY CHARGE_TO_COST_CENTER DEMAND_CLASS_CODE
DEMAND_CLASS_CODE SHIPPED_QUANTITY PERSON_ID SHIPMENT_PRIORITY_CODE
PRICE_LIST_ID ORDERED_QUANTITY TYPE SHIPPING_METHOD_CODE
TAX_EXEMPT_FLAG FULFILLED_QUANTITY COMMISSIONABLE_FLAG FREIGHT_TERMS_CODE
TAX_EXEMPT_NUMBER SHIPPING_QUANTITY FOB_POINT_CODE
PARTIAL_SHIPMENTS_ALLOWED SHIPPING_QUANTITY_UOM SHIP_SOURCE_TYPE_CODE
DELIVERY_LEAD_TIME AGREEMENT_TYPE_CODE
TAX_EXEMPT_FLAG AGREEMENT_REQUIRED_FLAG
PO_REQUIRED_FLAG
INVOICING_RULE_ID
ACCOUNTING_RULE_ID
INVOICE_SOURCE_ID
ORG_ID
Query to find out the customer, line item, ordered Query to find customer, ship to and bill to
qty and price info of the order : information of an order :
set pages 500 col ship_address1 form a40
set lines 500 col ship_address2 form a20
set buffer 500 col bill_address1 form a40
col order_type form a16 col bill_address2 form a20
col customer_name form a30 col ship_country form a10
col segment1 form a16 col bill_country form a10
col sales_rep form a30 col ship_location_code form a30
select col ship_state form a10
h.order_number, col ship_zip form a10
org.name customer_name, col bill_location_code form a30
h.ordered_date order_date, col customer_name form a30
ot.name order_type, col freight_terms form a24
s.name sales_rep, col FOB form a16
l.line_id,
l.line_number, select
l.inventory_item_id, h.order_number,
si.segment1, c.name customer_name,
l.ordered_quantity, lk1.meaning Freight_Terms,
l.unit_selling_price, lk2.meaning FOB,
nvl(l.ordered_quantity,0) * s.location_code ship_location_code,
nvl(l.unit_selling_price,0) amount, s.address_line_1 ship_address1,
h.transactional_curr_code currency_code s.address_line_2 ship_address2,
from ra_salesreps s, s.state ship_state,
oe_transaction_types_tl ot, s.postal_code ship_zip,
oe_sold_to_orgs_v org, s.country ship_country,
mtl_system_items_vl si, b.location_code bill_location_code,
oe_order_lines_all l, b.address_line_1 bill_address1,
oe_order_headers_all h b.address_line_2 bill_address2,
where h.order_number= 14463 b.country bill_country
and h.org_id = 204 from
and l.header_id = h.header_id ar_lookups lk2,
and h.sold_to_org_id = org.organization_id oe_lookups lk1,
and (h.cancelled_flag is null or oe_sold_to_orgs_v c,
h.cancelled_flag = 'N') oe_invoice_to_orgs_v b,
and h.open_flag='Y' oe_ship_to_orgs_v s,
and l.open_flag = 'Y' oe_order_headers_all h
and l.service_reference_line_id is null where h.order_number= 14463
and l.inventory_item_id = si.inventory_item_id and h.org_id = 204
and nvl(si.organization_id,0) = 204 --Item and h.ship_to_org_id = s.organization_id
master orgn and h.invoice_to_org_id = b.organization_id
and h.order_type_id = ot.transaction_type_id and h.sold_to_org_id = c.organization_id
and h.salesrep_id=s.salesrep_id and h.freight_terms_code =
and h.org_id=s.org_id lk1.lookup_code(+)
order by l.line_id and lk1.lookup_type(+) =
/ 'FREIGHT_TERMS'
a: Oe_sold_to_orgs_v is a view based on and lk2.lookup_code(+) = h.fob_point_code
hz_parties and hz_cust_accounts. and lk2.lookup_type(+) = 'FOB'
b: Ra_salesreps is a view based on /
JTF_RS_SALESREPS and a: The oe_ship_to_orgs_v and
JTF_RS_RESOURCE_EXTNS_VL. oe_invoice_to_orgs_v views are based on
HZ_CUST_SITE_USES_ALL,
You must set the org context for the views to HZ_CUST_ACCT_SITES_ALL,
function properly as.. HZ_PARTY_SITES and HZ_LOCATIONS.
begin b: Oe_lookups and ar_lookups are views based
fnd_client_info.set_org_context('204'); on fnd_lookup_values.
end;

OE_ORDER_HOLDS_ALL OE_HOLD_DEFINITIONS OE_HOLD_SOURCES_ALL OE_HOLD_RELEASES


ORDER_HOLD_ID HOLD_ID HOLD_SOURCE_ID HOLD_RELEASE_ID
HOLD_SOURCE_ID NAME HOLD_ID HOLD_SOURCE_ID
HOLD_RELEASE_ID TYPE_CODE HOLD_ENTITY_CODE RELEASE_REASON_CODE
HEADER_ID DESCRIPTION HOLD_ENTITY_ID RELEASE_COMMENT
LINE_ID START_DATE_ACTIVE HOLD_ENTITY_CODE2 ORDER_HOLD_ID
ORG_ID END_DATE_ACTIVE HOLD_ENTITY_ID2
RELEASED_FLAG ITEM_TYPE HOLD_UNTIL_DATE
HOLD_INCLUDED_ITEMS_FLAG RELEASED_FLAG
APPLY_TO_ORDER_AND_LINE_FLAG HOLD_COMMENT
ORG_ID
HOLD_RELEASE_ID

Query to find out order and line hold information :


col ordered_item form a32
col hold_name form a24
col hold_comment form a32
select ho.name hold_name,
hs.hold_until_date,
hs.hold_comment,
h.order_number,
oh.header_id,
oh.line_id,
oh.order_hold_id,
l.item_identifier_type,
l.inventory_item_id,
l.ordered_item
from oe_order_holds_all oh,
oe_order_lines_all l,
oe_order_headers_all h,
oe_hold_definitions ho,
oe_hold_sources_all hs
where h.order_number= 14463
and oh.header_id = h.header_id
and (h.cancelled_flag is null or h.cancelled_flag = 'N')
and h.open_flag='Y'
and oh.hold_source_id = hs.hold_source_id
and hs.hold_id = ho.hold_id
and h.header_id = l.header_id(+)
and l.open_flag = 'Y'
and l.line_id = nvl(oh.line_id,l.line_id)
and l.service_reference_line_id is null
and oh.hold_release_id is null
and nvl(h.org_id,0) = 204
and nvl(l.org_id,0) = nvl(h.org_id,0)
order by ho.name,h.order_number
/

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

Query to find freight related info of order viz: freight


carrier, ship method and service level :
col shipping_method_code form a32
col carrier_name form a24

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

1.2. View Order Charges & Adjustments

1.2.1. View List Price Adjustments

Fig1.1 Order Entry Screen


The list price is derived from the price list and the selling price is calculated taking into account
other adjustments and charges info.Go to line price adjustments thru’ the actions LOV. The
modifier details like rate of adjustment, adjusted amount and extended price will appear.
1.2.2. View Adjustment Atributes
Click on adjustment attributes to find the Pricing and Qualifier attributes and their values, which
were satisfied for the previously mentioned modifier to be applied on this Order line.

1.2.3. View Charges


The charges and freight costs can be defined in Adv Pricing and automatically applied to the
Order line based on business rules.Click on actions button and choose charges from the LOV.
For a charge click on attributes button to view the pricing and qualifier attributes.
1.2.4. Order Adjustment Architecture
OE_PRICE_ADJUSTMENTS OE_PRICE_ADJ_ATTRIBS OE_CHARGE_LINES_V QP_LIST_HEADERS_VL
PRICE_ADJUSTMENT_ID HEADER_ID LIST_HEADER_ID
PRICE_ADJUSTMENT_ID LINE_ID NAME
REQUEST_ID PRICING_CONTEXT CHARGE_ID DESCRIPTION
HEADER_ID PRICING_ATTRIBUTE CHARGE_NAME AUTOMATIC_FLAG
PRICING_ATTR_VALUE_FRO CHARGE_AMOUNT LIST_TYPE_CODE
DISCOUNT_ID M TERMS_ID
DISCOUNT_LINE_ID PRICING_ATTR_VALUE_TO CURRENCY_CODE ROUNDING_FACTOR
AUTOMATIC_FLAG
COMPARISON_OPERATOR INVOICED_FLAG PRORATE_FLAG
PERCENT INTERCO_INVOICED_FLAG SOURCE_SYSTEM_CODE
LINE_ID FLEX_TITLE
ORIG_SYS_DISCOUNT_REF PRICE_ADJ_ATTRIB_ID ORG_ID ASK_FOR_FLAG
LOCK_CONTROL SOURCE_SYSTEM_CODE
CHANGE_SEQUENCE
LIST_HEADER_ID ESTIMATED_FLAG
LIST_LINE_ID INVOICED_AMOUNT
LIST_LINE_TYPE_CODE
MODIFIED_FROM
MODIFIED_TO
MODIFIER_MECHANISM_TYPE_
CODE
UPDATED_FLAG
APPLIED_FLAG
OPERAND
ARITHMETIC_OPERATOR

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

Select h.order_number, select


l.line_number, HEADER_ID ,
pa.list_line_type_code, LINE_ID ,
pa.arithmetic_operator, CHARGE_ID ,
pa.operand, CHARGE_NAME ,
DECODE(PA.MODIFIER_LEVEL_CODE,'ORDER', CHARGE_AMOUNT ,
L.UNIT_LIST_PRICE*L.ORDERED_QUANTITY CURRENCY_CODE ,
*PA.OPERAND * SIGN(PA.ADJUSTED_AMOUNT)/100, INVOICED_FLAG ,
(PA.ADJUSTED_AMOUNT* INTERCO_INVOICED_FLAG ,
NVL(L.ORDERED_QUANTITY,0) )) DISCOUNT_AMT ORG_ID ,
From SOURCE_SYSTEM_CODE ,
qp_list_headers_vl lh, ESTIMATED_FLAG ,
oe_price_adjustments pa, INVOICED_AMOUNT
oe_order_lines_all l, from OE_CHARGE_LINES_V
oe_order_headers_all h where header_id=
Where h.order_number = 14463 (select header_id
and h.header_id = l.header_id from oe_order_headers_all
and h.org_id = l.org_id where order_number=14463)
and h.header_id = pa.header_id order by line_id
and l.line_id = pa.line_id(+) /
and pa.list_header_id = lh.list_header_id a: The OE_CHARGE_LINES_V view is
AND ( PA.LIST_LINE_TYPE_CODE = 'DIS' based on oe_price_adjustments, oe_
OR PA.LIST_LINE_TYPE_CODE = 'SUR'
OR PA.LIST_LINE_TYPE_CODE = 'PBH' )
AND PA.APPLIED_FLAG='Y'
AND NOT EXISTS
(SELECT 'X'
FROM OE_PRICE_ADJ_ASSOCS PAS,
OE_PRICE_ADJUSTMENTS PA1
WHERE PAS.RLTD_PRICE_ADJ_ID =

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.

1.3. View Tax

1.3.1. View Line Tax

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.

1.2.4. Sales Tax Architecture

AR_LOCATION_COMBINATIONS AR_LOCATION_VALUES AR_LOCATION_RATES AR_SALES_TAX


LOCATION_ID LOCATION_SEGMENT_ID LOCATION_RATE_ID SALES_TAX_ID
LOCATION_STRUCTURE_ID LOCATION_STRUCTURE_ID LOCATION_SEGMENT_ID LOCATION_ID
ENABLED_FLAG LOCATION_SEGMENT_QUALIFIER TAX_RATE TAX_RATE
LOCATION_ID_SEGMENT_1 LOCATION_SEGMENT_VALUE OVERRIDE_STRUCTURE_ID LOCATION1_RATE
LOCATION_ID_SEGMENT_2 LOCATION_SEGMENT_DESCRIPTION FROM_POSTAL_CODE LOCATION2_RATE
LOCATION_ID_SEGMENT_3 PARENT_SEGMENT_ID TO_POSTAL_CODE LOCATION3_RATE
LOCATION_ID_SEGMENT_4 LOCATION_SEGMENT_USER_VALUE START_DATE ATTRIBUTE_CATEGORY
LOCATION_ID_SEGMENT_5 TAX_ACCOUNT_CCID END_DATE ATTRIBUTE1~10
LOCATION_ID_SEGMENT_6 ORG_ID REQUEST_ID RATE_CONTEXT
LOCATION_ID_SEGMENT_7 INTERIM_TAX_CCID PROGRAM_APPLICATION_ID ENABLED_FLAG
LOCATION_ID_SEGMENT_8 ADJ_CCID PROGRAM_ID START_DATE
LOCATION_ID_SEGMENT_9 EDISC_CCID PROGRAM_UPDATE_DATE END_DATE
LOCATION_ID_SEGMENT_10 UNEDISC_CCID LAST_UPDATE_LOGIN FROM_POSTAL_CODE
OVERRIDE_RATE1~10 TO_POSTAL_CODE
TAX_ACCOUNT

Query to find location based Sales tax :


For sales tax location structure of State.county.city, At first tax for these individual segment values are found as
mentioned below. Then all taxes are added up and applied to the sales order line.
Sales tax rate for State 'CA' : Sales tax rate for County 'Santa Clara' :

select distinct lv.parent_segment_id,lc.location_id_segment_1, select distinct lv.parent_segment_id,lc.location_id_segment_2,


location_segment_user_value location_segment_user_value ,
,lr.from_postal_code,lr.to_postal_code, location_segment_value,
location_segment_value, lr.tax_rate lr.from_postal_code,lr.to_postal_code,lr.tax_rate
from ar_location_rates lr, from ar_location_rates lr,
ar_location_combinations lc, ar_location_combinations lc,
ar_location_values lv ar_location_values lv
where lv.location_segment_user_value='CA' --State name where lv.location_segment_user_value='Santa Clara' --County name
and lv.location_segment_id=lc.location_id_segment_1 and lv.location_segment_id=lc.location_id_segment_2
and lv.location_structure_id= lc.location_structure_id and lv.location_structure_id= lc.location_structure_id
and lc.location_structure_id=101 and lc.location_structure_id=101
and lv.location_segment_id=lr.location_segment_id and lv.location_segment_id=lr.location_segment_id
order by 1 order by 1
/ /

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'
/ /

1.4. Order Management APIs

1.4.1. Create Order API

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;

-- CALL TO PROCESS ORDER


OE_Order_PUB.Process_Order(
p_header_rec => l_header_rec
p_line_tbl=> l_line_tbl
p_line_adj_tbl=> l_line_adj_tbl
-- OUT variables
x_header_rec=> l_header_rec
x_header_scredit_tbl=> l_header_scr_tbl
x_header_adj_tbl=> l_header_adj_tbl
x_line_tbl=> l_line_tbl
x_line_scredit_tbl=> l_line_scredit_tbl
x_line_adj_tbl=> l_line_adj_tbl
................
x_return_status=> l_return_status
x_msg_count=> l_msg_count
x_msg_data=> l_msg_data);
if l_msg_count > 0 then
for l_index in 1..l_msg_count loop
l_msg_data := oe_msg_pub.get(p_msg_index => l_index, p_encoded => ‘F’);
end loop;
end if;
-- Check the return status
if x_return_status = FND_API.G_RET_STS_SUCCESS then success;
Else failure;
end if;
End;

1.4.2. Create New Line

Inserting a new line into an existing order.


-- NEW LINE RECORD
l_line_tbl(1) := OE_ORDER_PUB.G_MISS_LINE_REC;
l_line_tbl(1).header_id := 1000;
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;

OE_ORDER_PUB.Process_Order(........
p_line_tbl=> l_line_tbl
......);

1.4.3. Update an existing Line

Updating the bill to organization and order quantity on an order line.


-- LINE RECORD WITH THE CHANGES
l_line_tbl(1) := OE_ORDER_PUB.G_MISS_LINE_REC.
l_line_tbl(1).invoice_to_org_id := 322;
l_line_tbl(1).ordered_quantity := 2;
l_line_tbl(1).line_id := 1000;
l_line_tbl(1).operation := OE_GLOBALS.G_OPR_UPDATE;

OE_ORDER_PUB.Process_Order(........
p_line_tbl=> l_line_tbl
........);

1.4.4. Delete an Order

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
........);

1.4.5. Apply Line Hold API

Apply a hold to an order line due to a defective item.


-- ACTION REQUEST RECORD
l_request_rec.entity := OE_GLOBALS.G_ENTITY_LINE; -- Indicates that it is a line level action
l_request_rec.entity_id := 100; -- Line Id
l_request_rec.request_name := OE_GLOBALS.G_APPLY_HOLD;
l_request_rec.param1 := 4; --Hold ID to identify the type of hold applied. (HOLD_ID from
OE_HOLD_DEFINITIONS)
l_request_rec.param2 = ‘I’; -- indicator that it is an item hold
l_request_rec.param3 := 3214; -- Inv_item_Id of the item since it is an Item hold
l_action_request_tbl := l_request_rec;

Apply Hold action record fields and their valid values.


request_type OE_GLOBALS.G_APPLY_HOLD
entity_code OE_GLOBALS.G_ENTITY_ORDER for order or OE_
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
param2 OE_HOLD_DEFINITIONS)
Hold entity code for the hold source to be createdviz:
C: Customer hold source
S: Bill To or Ship To hold source
I: Item hold source
O: Order hold source
param3 W: Warehouse Hold Source
Hold entity ID viz:
C, B, or S: for Org ID
O: Header ID
param4 I: Inventory Item ID
date_param1 Hold comment
parm6- Hold Until Date
param20 Attribute1-15 of the descriptive flexfield associated
with the hold source record.

1.4.6. Other APIs

Other OM APIs available are Release Hold, Book Order and for ATO models Delink Config and
Match & Reserve APIs are available.

1.5. Order Scheduling

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.1. Scheduling Features :

• Calculating Available-to-Promise (ATP)


• Scheduling
• Reserving

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.

1.5.4. Order Scheduling Transaction

WSH_DELIVERY_DETAILS For each order line scheduled, one record is created in


DELIVERY_DETAIL_ID wsh_delivery_details referencing the line as
SOURCE_CODE source_line_id.
SOURCE_HEADER_ID
SOURCE_LINE_ID
SOURCE_HEADER_TYPE_ID
SOURCE_HEADER_TYPE_NAME
CUST_PO_NUMBER
CUSTOMER_ID
INVENTORY_ITEM_ID
ITEM_DESCRIPTION

2.1. Release Sales Order

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.

2.1.1. Pick Release Transactions

WSH_PICKING_BATCHES WSH_NEW_DELIVERIES WSH_DELIVERY_ASSIGNMENTS


BATCH_ID DELIVERY_ID DELIVERY_ASSIGNMENT_ID
NAME NAME DELIVERY_ID
TRIP_ID PLANNED_FLAG DELIVERY_DETAIL_ID
TRIP_STOP_ID STATUS_CODE PARENT_DELIVERY_ID
DELIVERY_ID INITIAL_PICKUP_DATE PARENT_DELIVERY_DETAIL_ID
DELIVERY_DETAIL_ID INITIAL_PICKUP_LOCATION_ID
ACTIVE_FLAG
BACKORDERS_ONLY_FLAG ULTIMATE_DROPOFF_LOCATION_ID
DOCUMENT_SET_ID ULTIMATE_DROPOFF_DATE
EXISTING_RSVS_ONLY_FLAG CUSTOMER_ID
SHIPMENT_PRIORITY_CODE INTMED_SHIP_TO_LOCATION_ID
SHIP_METHOD_CODE POOLED_SHIP_TO_LOCATION_ID
CARRIER_ID FREIGHT_TERMS_CODE
CUSTOMER_ID FOB_CODE
SHIP_TO_LOCATION_ID FOB_LOCATION_ID
ORDER_HEADER_ID WAYBILL
ORDER_LINE_ID
Query to find out the shipper info : Query to find out shipper detail info :
select SELECT
wnd.delivery_id delivery_id, wnd.delivery_id,
substrb(party.party_name,1,50) customer, wnd.name
wpb.name batch_name, delivery_name,
wsh_util_core.get_location_description( wdd.source_header_number
wnd.INITIAL_PICKUP_LOCATION_ID, so_order_number,
'NEW UI CODE') ship_from, oola.line_number so_line_number,
wsh_util_core.get_location_description( wdd.source_header_id so_header_id,
wdd.source_line_id so_line_id,
wnd.ULTIMATE_DROPOFF_LOCATION_ID,
'NEW UI CODE') ship_to, wdd.shipping_instructions,
wnd.INITIAL_PICKUP_DATE pickup_date,
wnd.ULTIMATE_DROPOFF_DATE wdd.inventory_item_id,
dropoff_date, wdd.requested_quantity_uom,
lv.meaning ship_method, msi.description item_description,
wnd.WAYBILL waybill, msi.revision_qty_control_code ,
wnd.GROSS_WEIGHT gross_weight, wdd.ship_method_code carrier,
wnd.WEIGHT_UOM_CODE uom, wdd.shipment_priority_code priority,
wnd.status_code, wdd.organization_id,
we.message wnd.initial_pickup_location_id,
from wsh_new_deliveries wnd, wdd.released_status,
wsh_picking_batches wpb, wdd.source_code
wsh_exceptions we, FROM mtl_system_items_vl msi,
fnd_lookup_values_vl lv, oe_order_lines_all oola,
hz_cust_accounts cust_acct, wsh_delivery_details wdd,
hz_parties party wsh_delivery_assignments
where wnd.delivery_id = 12814 wda,
and wpb.batch_id = wnd.batch_id wsh_new_deliveries wnd
and we.delivery_id(+) = wnd.delivery_id WHERE wnd.delivery_id =18910
and we.exception_name(+) = AND wda.delivery_id = wnd.delivery_id(+)
'WSH_BATCH_MESSAGE' AND wdd.delivery_detail_id = wda.delivery_detail_id
and lv.lookup_code(+) = AND wdd.inventory_item_id =
wpb.ship_method_code msi.inventory_item_id(+)
and lv.lookup_type(+) = 'SHIP_METHOD' AND wdd.organization_id =
and lv.view_application_id(+) = 3 msi.organization_id(+)
and cust_acct.cust_account_id AND wdd.source_line_id = oola.line_id
(+)=wnd.customer_id AND wdd.source_header_id = oola.header_id
and party.party_id(+) = cust_acct.party_id
/ /

2.2. Order Pick Confirm

Navigate to Transact Move Orders window in Inventory.


Search the Sales order with order type, Order number and source as ‘ORDER
ENTRY’. You can also search using the Picking batch number.
After finding the Move order, click on view/update allocation to update the system generated
inventory allocations.
View the allocation done by the system. You can change the subinventory and quantity and click
on transact.View the status of the order line in Shipping transactions window. The status shoud
be changed to Staged/Pick confirmed.

2.1.1. Pick Confirm Transactions

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
/

2.3. Order Ship Confirm


Navigate to Shipping Transactions Form and query the order. All non-shipped lines will
appear. Click on the details button to see detailed line information.

Here, you can enter the actual quantity to be shipped.


Click on the Delivery tab and the details button to see detailed delivery information. You can
enter the waybill number & additional info etc. here.To ship confirm the order, select
the Actions list in the Delivery Tab, choose Ship Confirm and GO.

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.

2.3.1. Ship Confirm Transactions

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

Query to find Bill of Lading info of the


Query to find delivery leg and pick up stop info :
Delivery :
select SELECT wt.trip_id,
wnd.delivery_id delivery_id, wt.name,
wdi.sequence_number bol_number, wt.STATUS_CODE,
wdi.bol_notify_party, wt.VEHICLE_ITEM_ID,
wdi.port_of_loading, wt.VEHICLE_NUMBER,
wdi.port_of_discharge, wt.CARRIER_ID,
wnd.WAYBILL waybill, wt.SHIP_METHOD_CODE,
wnd.GROSS_WEIGHT gross_weight, wts.STOP_ID,
wnd.WEIGHT_UOM_CODE uom, wts.STOP_LOCATION_ID,
wnd.status_code wts.STATUS_CODE,
from wsh_new_deliveries wnd, wts.STOP_SEQUENCE_NUMBER,
wsh_delivery_legs wdl, wts.PLANNED_ARRIVAL_DATE,
wsh_document_instances wdi wts.PLANNED_DEPARTURE_DATE,
where wnd.delivery_id =12784 wts.ACTUAL_ARRIVAL_DATE,
and wnd.delivery_id = wdl.delivery_id (+) wts.ACTUAL_DEPARTURE_DATE,
and wdi.entity_id (+) = wdl.delivery_leg_id wts.DEPARTURE_NET_WEIGHT,
AND wdi.entity_name (+) = wts.WEIGHT_UOM_CODE,
'WSH_DELIVERY_LEGS' wdl.DELIVERY_LEG_ID,
AND wdi.document_type (+) = 'BOL' wdl.DELIVERY_ID,
AND wdi.status (+) <> 'CANCELLED' wdl.PICK_UP_STOP_ID,
/ wdl.DROP_OFF_STOP_ID,
wdl.SEQUENCE_NUMBER,
wdl.LOADING_ORDER_FLAG,
wdl.SHIPPER_TITLE,
wdl.SHIPPER_PHONE
FROM wsh_trips wt
,wsh_trip_stops wts
,wsh_delivery_legs wdl
WHERE wdl.delivery_id =12814
AND wts.stop_id = wdl.pick_up_stop_id
AND wts.trip_id = wt.trip_id;

2.4. Shipping APIs

2.4.1. Shipping Transaction Form(STF) actions and APIs mapping


A sample list of STF actions and their equivalent APIs are given here. These are used in a customiz

STF Action API A

Auto create Delivery WSH_DELIVERY_DETAILS_PUB.


-
AUTOCREATE_DELIVERIES

Pick Release Delivery WSH_DELIVERIES_PUB. DELIVERY_ACTION PICK-RELEASE

Update actual shipped WSH_DELIVERY_DETAILS_PUB.


UPDATE
quantities UPDATE_SHIPPING_ATTRIBUTES

Ship confirm delivery WSH_DELIVERIES_PUB. DELIVERY_ACTION CONFIRM

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..

Call WSH_DELIVERY_DETAILS_PUB.Update_Shipping_Attributes API to update the corresponding de


quantities in the first delivery detail; to back order all in the second; to stage all in the third delive
Call WSH_FREIGHT_COSTS_PUB.Create_Update_Freight_Costs API to create freight costs for the de
been assigned to.
Call WSH_CONTAINER_PUB.Auto_Pack to pack the delivery lines into a container.
Call WSH_DELIVERIES_PUB.Delivery_Action API to ship confirm the 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;

--Parameters for WSH_FREIGHT_COSTS_PUB.Create_Update_Freight_Costs.

action_code VARCHAR2(15);

pub_freight_costs WSH_FREIGHT_COSTS_PUB.PubFreightCostRecType;

freight_cost_id NUMBER;

--Parameters for WSH_DELIVERIES_PUB.Delivery_Action.

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

FND_GLOBAL.APPS_INITIALIZE(user_id => 1001594

,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).delivery_detail_id := 13431; -- Ship All quantities in this detail.

changed_attributes(1).shipped_quantity := 1;

changed_attributes(2).source_line_id := 13432; -- Back Order All in this detail.

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(

:::::::::::::

p_changed_attributes => changed_attributes,

p_source_code => source_code);

if (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) then

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(

::::::::::

p_pub_freight_costs => pub_freight_costs,

p_action_code => 'CREATE',

x_freight_cost_id => freight_cost_id);

if (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) then

raise fail_api;

end if;

/* Values for autopacking the delivery details to a container. */

p_entity_tab(1) := 13431;

p_entity_tab(2) := 13432;

p_entity_tab(3) := 13434;
WSH_CONTAINER_PUB.Auto_Pack(

p_api_version => 1.0,

p_init_msg_list => init_msg_list,

p_commit => p_commit,

p_validation_level => p_validation_level,

x_return_status => x_return_status,

x_msg_count => x_msg_count,

x_msg_data => x_msg_data,

p_entity_tab => p_entity_tab,

p_entity_type => 'L',

p_group_id_tab => p_group_id_tab,

p_pack_cont_flag => p_pack_cont_flag,

x_cont_inst_tab => x_cont_inst_tab);

if (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) then

raise fail_api;

end if;

/* Values for Ship Confirming the delivery.*/

p_action_code := 'CONFIRM'; -- The action code for ship confirm

p_delivery_id := 5341; -- The delivery that needs to be confirmed

p_delivery_name := '5341'; -- The delivery name,

p_sc_action_flag := 'S'; -- Ship entered quantity.

p_sc_close_trip_flag := 'Y'; -- Close the trip after ship confirm

p_sc_trip_ship_method := 'GROUND'; -- The ship method code

WSH_DELIVERIES_PUB.Delivery_Action(

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_report_set_name => p_sc_report_set_name,

p_wv_override_flag => p_wv_override_flag,

x_trip_id => x_trip_id,

::::::::::::

if (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) then

raise fail_api;

end if;

exception

when fail_api then

WSH_UTIL_CORE.get_messages('Y', x_msg_summary, x_msg_details, x_msg_count);

if x_msg_count > 1 then

x_msg_data := x_msg_summary || x_msg_details;

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
::::::::::::

if (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) then


raise fail_api;
end if;
p_delivery_id := delivery_id;
pub_freight_costs.delivery_id := delivery_id;

-- Call Detail_to_Delivery with an action code of ASSIGN to assign details to a delivery.


p_TabOfDelDets(1) := 13463;
p_TabOfDelDets(2) := 13464;
p_action := 'ASSIGN';

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;

-- Values for Ship Confirming the delivery.


p_action_code := 'CONFIRM'; -- The action code for ship confirm
p_delivery_id := 5341; -- The delivery that needs to be confirmed
p_delivery_name := '5341'; -- The delivery name,
p_sc_action_flag := 'S'; -- Ship entered quantity.
p_sc_close_trip_flag := 'Y'; -- Close the trip after ship confirm
p_sc_trip_ship_method := 'UPS'; -- The ship method code

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
::::::::::::::::::

if (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) then


raise fail_api;
end if;
exception
when fail_api then
WSH_UTIL_CORE.get_messages('Y', x_msg_summary, x_msg_details, x_msg_count);
if x_msg_count > 1 then
x_msg_data := x_msg_summary || x_msg_details;
else
x_msg_data := x_msg_summary;
end if;
END;

You might also like