Professional Documents
Culture Documents
WSH API Migrate
WSH API Migrate
OVERVIEW
This document provides information about migrating your shipment process from
the Releases 10.7 and 11 Delivery-based Ship Confirm Open Interface to the
Release 12 public APIs. It contains the following:
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 2
The Shipping Execution public API process is :
1. Call
WSH_DELIVERY_DETAILS_PUB.UPDATE_SHIPPING_ATTRIBUTES
to modify data in WSH DELIVERY DETAILS. Setting the parameters of this
API is similar to populating the WSH_PICKING_DETAILS_INTERFACE
table in Release 11.
2. Call
WSH_FREIGHT_COSTS_PUB.CREATE_UPDATE_FREIGHT_COSTS
to create or update freight cost records in WSH_FREIGHT_COSTS. Setting
the parameters of this API is similar to populating the
WSH_FREIGHT_CHARGES_INTERFACE table in Release 11.
3. Call WSH_CONTAINER_PUB.CREATE_CONTAINERS to update the
container information. Setting the parameters of this API is similar to
populating the WSH_PACKED_CONTAINER_INTERFACE table.
4. Call WSH_DELIVERIES_PUB.CONFIRM_DELIVERY to carry out
different actions on the delivery and
WSH_DELIVERIES_PUB.CREATE_UPDATE_DELIVERY to update the
delivery information. Setting the parameters of these APIs is similar to
populating the WSH_DELIVERIES_INTERFACE table.
This table relates Release 11 open interface tables to Release 12 public APIs.
WSH_PICKING_DETAILS_INTER WSH_DELIVERY_DETAILS_PUB.
FACE UPDATE_SHIPPING_ATTRIBUTE
S
WSH_FREIGHT_CHARGES_INTE WSH_FREIGHT_COSTS_PUB.CRE
RFACE ATE_UPDATE_FREIGHT_COSTS
WSH_PACKED_CONTAINER_IN WSH_CONTAINER_PUB.CREATE
TERFACE _CONTAINERS
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 3
Release 11 Interface Table Release 12 Public API
WSH_DELIVERIES_INTERFACE WSH_DELIVERIES_PUB.DELIVER
Y_ACTION and
WSH_DELIVERIES_PUB.CREATE_
UPDATE_DELIVERY
In Release 12, you do not need to populate any interface tables or to launch
any concurrent program to load data into interface tables.
WSH_CONTAINER_PUB.CREATE_CONTAINERS creates a container
(LPN). To pack a delivery detail with a container call
WSH_CONTAINER_PUB.container_actions.
WSH_DELIVERY_DETAILS_PUB.UPDATE_SHIPPING_ATTRIBUTES
WSH_DELIVERY_DETAILS_PUB.UPDATE_SHIPPING_ATTRIBUTES is
called from the source system to modify data in WSH_DELIVERY_DETAILS
and is detailed in another section of this chapter.
A key parameter is p_changed_attributes, which:
• Is of type WSH_DELIVERY_DETAILS_PUB.ChangedAttrributesTabType
• Is a table of ChangedAttributeRecType indexed by Binary_Integer.
• Specifies the modifications for the WSH_DELIVERY_DETAILS table.
This chart shows the mapping between the columns in
WSH_PICKING_DETAILS_INTERFACE table (from Release 11) and the
parameters of ChangedAttributeRecType.
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 4
UPDATE_SHIPPING_ATTRIBUTES Mapping
WSH_PICKING_DETAILS_INTER ChangedAttributeRecType
FACE Column Parameters
TRANSACTION_ID ‐
PROCESS_FLAG ‐
PICKING_LINE_DETAIL_ID DELIVERY_DETAIL_ID
SOURCE_CODE ‐
SOURCE_HEADER_ID SOURCE_HEADER_ID
TRANSACTION_MODE ‐
TRANSACTION_TYPE_ID ‐
INVENTORY_ITEM_ID ‐
WAREHOUSE_ID ‐
SUBINVENTORY SUBINVENTORY
LOT_NUMBER LOT_NUMBER
REVISION REVISION
LOCATOR_ID LOCATOR_ID
SERIAL_NUMBER SERIAL_NUMBER
SHIPPED_QUANTITY SHIPPED_QUANTITY
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 5
WSH_PICKING_DETAILS_INTER ChangedAttributeRecType
FACE Column Parameters
‐ CYCLE_COUNT_QUANTITY
(This specifies the backorder
quantity at ship confirm; the
quantity not shipped backordered
becomes staged. This must be
added when you enter Shipped
Quantity.)
TRANSACTION_UOM ‐
TRANSACTION_DATE ‐
ATTRIBUTE_CATEGORY ATTRIBUTE_CATEGORY
ATTRIBUTE1‐15 ATTRIBUTE1‐15
CREATED_BY ‐
CREATION_DATE ‐
LAST_UPDATED_BY ‐
LAST_UPDATE_DATE ‐
LAST_UPDATE_LOGIN ‐
ERROR_EXPLANATION ‐
ERROR_CODE ‐
CONTAINER_SEQUENCE ‐
CONTAINER_ID ‐
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 6
WSH_DELIVERIES_PUB.DELIVERY_ACTION
WSH_DELIVERIES_PUB.DELIVERY_ACTION is called to carry out different
actions on a delivery and is described in another section of this chapter. The
important parameters specify the action to be performed on the delivery; they are
p_action_code and p_sc_action_flag.
WSH_DELIVERIES_INTERFACE
WSH_DELIVERIES_INTERFACE has some columns which indicate the action
to be performed on the delivery and some columns which update the delivery
information, such as Waybill Number and attributes.
WSH_DELIVERIES_PUB.DELIVERY_ACTION and
CREATE_UPDATE_DELIVERY
WSH_DELIVERIES_PUB.DELIVERY_ACTION is to be called to perform an
action on the delivery and
WSH_DELIVERIES_PUB.CREATE_UPDATE_DELIVERY is called to update
the delivery information. Parameter p_delivery_info of
CREATE_UPDATE_DELIVERY specifies the updates for
WSH_NEW_DELIVERIES.
This chart shows the mapping between the columns in
WSH_DELIVERIES_INTERFACE table (from Release 11) and the parameters to
the procedure WSH_DELIVERIES_PUB.DELIVERY_ACTION.
DELIVERY_ACTION Mapping
WSH_DELIVERIES_INTERFACE WSH_DELIVERIES_PUB.DELIVE
RY_ACTION Parameters
TRANSACTION_ID ‐
PROCESS_FLAG ‐
REQUEST_ID ‐
DELIVERY_ID P_delivery_id
DELIVERY_NAME P_delivery_name
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 7
WSH_DELIVERIES_INTERFACE WSH_DELIVERIES_PUB.DELIVE
RY_ACTION Parameters
ORGANIZATION_ID ‐
ORGANIZATION_CODE ‐
ACTION_CODE P_action_code, p_sc_action_flag
REPORT_SET_ID P_sc_report_set_id
REPORT_SET P_sc_report_set_name
DATE_CLOSED P_sc_actual_dep_date
SEQUENCE_NUMBER ‐
CUSTOMER_ID ‐
CUSTOMER_NUMBER ‐
CREATE_UPDATE_DELIVERY Mapping
WSH_DELIVERIES_INTERFACE p_delivery_info
(DELIVERY_PUB_REC_TYPE)
Attribute
LOADING_ORDER_FLAG Loading_order_flag
LOADING_ORDER_DESC Loading_order_desc
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 8
WSH_DELIVERIES_INTERFACE p_delivery_info
(DELIVERY_PUB_REC_TYPE)
Attribute
FREIGHT_CARRIER_CODE Carrier_code
ULTIMATE_SHIP_TO_ID Ultimate_dropoff_location_id
FREIGHT_TERMS_CODE Freight_terms_code
CURRENCY_CODE Currency_code
CURRENCY_NAME Currency_name
FOB_CODE Fob_code
ERROR_EXPLANATION ‐
ERROR_CODE ‐
ACTION_CODE ‐
INTERMEDIATE_SHIP_TO_ID Intmed_ship_to_location_id
POOLED_SHIP_TO_ID Pooled_ship_to_location_id
WAYBILL_NUM Waybill
GROSS_WEIGHT Gross_weight
WEIGHT_UOM_CODE Weight_uom_code
WEIGHT_UNIT_OF_MEASURE ‐
VOLUME Volume
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 9
WSH_DELIVERIES_INTERFACE p_delivery_info
(DELIVERY_PUB_REC_TYPE)
Attribute
VOLUME_UOM_CODE Volume_uom_code
VOLUME_UNIT_OF_MEASURE ‐
PICKED_BY_ID ‐
ATTRIBUTE_CATEGORY Attribute_category
ATTRIBUTE1‐15 Attribute1‐15
CLOBAL_ATTRIBUTE_CATEGO global_attribute_category
RY
GLOBAL_ATTRIBUTE1‐15 Global_attribute1‐15
Action Codes
This chart shows the mapping between the Release 11 action codes and the Release
12 public API parameters of WSH_DELIVERIES_PUB.DELIVERY_ACTION.
WSH_DELIVERIES_PUB.DELIVERY_ACTION Parameters
NULL Do not perform ‐ ‐ ‐
ship confirm
1 PACK PACK ‐ ‐
ENTERED ,
UNASSIGN
REMAINDER
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 10
R11 R11 R12 R12 R12 Other
Action Description P_action_code P_sc_act Parameters
Code ion_flag
2 PACK ALL, PACK ‐ ‐
UNASSIGN
REMAINDER
4 SHIP ALL, CONFIRM A ‐
UNASSIGN
REMAINDER
5 BACKORDER CONFIRM C ‐
ALL
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 11
R11 R11 R12 R12 R12 Other
Action Description P_action_code P_sc_act Parameters
Code ion_flag
9 PACK ‐ ‐ ‐
ENTERED
10 PACK ALL PACK ‐ ‐
11 SHIP ENTERED CONFIRM B ‐
, BACKORDER
REMAINDER
12 SHIP ALL, CONFIRM A ‐
BACKORDER
REMAINDER
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 12
delivery details requires two containers then the process creates two container
instances and splits the delivery details.
In Release 12, the auto-packing feature does packing based on the defaults. For
more information, see Oracle Shipping Execution User's Guide.
In Release 11, the data elements ultimate_ship_to_id, intermediate_ship_to_id, and
pooled_ship_to_id_locations are the site use IDs. In Release 12, these data
elements correspond to the location IDs and you need to pass the location IDs.
Generally, ship from (internal) locations have location_code and ship to (external)
locations need location_id.
Package Specification
Create or replace package WSH_SHIP_API as
procedure SHIP_CONFIRM_EXAMPLE(
x_return_status OUT VARCHAR2,
x_msg_count OUT NUMBER,
x_msg_data OUT VARCHAR2);
END WSH_SHIP_API;
/
Package Body
Create or replace package body WSH_SHIP_API as
/*
Example 1:
This procedure can be used as an example on how to ship confirm a delivery
consisting of delivery details that have already been pick released and assigned
to a delivery.
Call WSH_DELIVERY_DETAILS_PUB.Update_Shipping_Attributes API to
update the corresponding delivery details to ship partial quantity and backorder the
remaining qty.
Call WSH_FREIGHT_COSTS_PUB.Create_Update_Freight_Costs API to
create freight costs for the delivery that the details have 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
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 13
delivery.
*/
procedure SHIP_CONFIRM_EXAMPLE(
x_return_status OUT VARCHAR2,
x_msg_count OUT NUMBER,
x_msg_data OUT VARCHAR2) IS
--Standard Parameters.
p_api_version_number NUMBER;
init_msg_list VARCHAR2(30);
x_msg_details VARCHAR2(3000);
x_msg_summary VARCHAR2(3000);
p_validation_level NUMBER;
p_commit VARCHAR2(30);
--Parameters for
WSH_DELIVERY_DETAILS_PUB.Update_Shipping_Attributes.
source_code VARCHAR2(15);
changed_attributes
WSH_DELIVERY_DETAILS_PUB.ChangedAttributeTabType;
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 14
p_sc_stage_del_flag VARCHAR2(10);
p_sc_trip_ship_method VARCHAR2(30);
p_sc_actual_dep_date VARCHAR2(30);
p_sc_report_set_id NUMBER;
p_sc_report_set_name VARCHAR2(60);
p_wv_override_flag VARCHAR2(10);
x_trip_id VARCHAR2(30);
x_trip_name VARCHAR2(30);
/*Handle exceptions*/
fail_api EXCEPTION;
BEGIN
--Call to WSH_DELIVERY_DETAILS_PUB.Update_Shipping_Attributes.
WSH_DELIVERY_DETAILS_PUB.Update_Shipping_Attributes(
p_api_version_number => 1.0,
p_init_msg_list => init_msg_list,
p_commit => p_commit,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 15
x_msg_data => x_msg_data,
p_changed_attributes => changed_attributes,
p_source_code => source_code);
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;
--Call to WSH_FREIGHT_COSTS_PUB.Create_Update_Freight_Costs.
WSH_FREIGHT_COSTS_PUB.Create_Update_Freight_Costs(
p_api_version_number => 1.0,
p_init_msg_list => init_msg_list,
p_commit => p_commit,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_pub_freight_costs => pub_freight_costs,
p_action_code => 'CREATE',
x_freight_cost_id => freight_cost_id);
p_entity_tab(1) := 13431;
p_entity_tab(2) := 13432;
p_entity_tab(3) := 13434;
--Call to WSH_CONTAINER_PUB.Auto_Pack
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);
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 16
if (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) then
raise fail_api;
end if;
/*Call to WSH_DELIVERIES_PUB.Delivery_Action. */
WSH_DELIVERIES_PUB.Delivery_Action(
p_api_version_number => 1.0,
p_init_msg_list => init_msg_list,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_action_code => p_action_code,
p_delivery_id => p_delivery_id,
p_delivery_name => p_delivery_name,
p_asg_trip_id => p_asg_trip_id,
p_asg_trip_name => p_asg_trip_name,
p_asg_pickup_stop_id => p_asg_pickup_stop_id,
p_asg_pickup_loc_id => p_asg_pickup_loc_id,
p_asg_pickup_loc_code => p_asg_pickup_loc_code,
p_asg_pickup_arr_date => p_asg_pickup_arr_date,
p_asg_pickup_dep_date => p_asg_pickup_dep_date,
p_asg_dropoff_stop_id => p_asg_dropoff_stop_id,
p_asg_dropoff_loc_id => p_asg_dropoff_loc_id,
p_asg_dropoff_loc_code => p_asg_dropoff_loc_code,
p_asg_dropoff_arr_date => p_asg_dropoff_arr_date,
p_asg_dropoff_dep_date => p_asg_dropoff_dep_date,
p_sc_action_flag => p_sc_action_flag,
p_sc_close_trip_flag => p_sc_close_trip_flag,
p_sc_create_bol_flag => p_sc_create_bol_flag,
p_sc_stage_del_flag => p_sc_stage_del_flag,
p_sc_trip_ship_method => p_sc_trip_ship_method,
p_sc_actual_dep_date => p_sc_actual_dep_date,
p_sc_report_set_id => p_sc_report_set_id,
p_sc_report_set_name => p_sc_report_set_name,
p_wv_override_flag => p_wv_override_flag,
x_trip_id => x_trip_id,
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 17
x_trip_name => x_trip_name);
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_CONFIRM_EXAMPLE;
END WSH_SHIP_API;
/
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs Page 18
Oracle Shipping Execution: Migration from Open Interfaces to Public APIs
April 2007
OracleMetaLink note 422084.1
Oracle
World Headquarters
500 Oracle Parkway
Redwood Shores, CA 94065
U.S.A.
Worldwide Inquiries:
Phone: +1.650.506.7000
Fax: +1.650.506.7200
oracle.com