Pick Pack and Ship Using Shipping Application Programming Interface
Pick Pack and Ship Using Shipping Application Programming Interface
Introduction:
The shipping Public APIs(Application Program Interface) are pl/sql packages which when called using wrapper files will perform the same actions possible from the Shipping applications UI. The real time nature of the shipping APIs in Release 11i and R12 has provided options for the customers to customize their shipping flows as per the business needs. In order to call these APIs we only need to pass the required parameters. It is mandatory that all the required parameters need to be initialized before they are passed to the called shipping API. The optional parameters are optional and can be passed as additional information if needed. The parameters can also be classified as standard parameters and specific parameters. Standard parameters are almost common to all the shipping APIs and the Specific Parameters are specific to a particular shipping API and are discussed seperately for each of the API called in the flow. These standard and specific parameters can be one of the madatory or option parameter.
Standard Parameters:
1. p_api_version_number: This is used to compare the incoming API call's version number with the current version number (always set to 1.0). 2. p_init_msg_list: This is used to Initialize message list and use FND_API.G_TRUE to reset the list. 3. p_commit: Will commit the changes to the database. The Default Value is FND_API.G_FALSE 4. x_return_status: Requests that the API return the status of the data after it completes its function. Valid values include: Success : FND_API.G_RET_STS_SUCCESS Error : FND_API.G_RET_STS_ERROR Unexpected Error: FND_API.G_RET_STS_UNEXP_ERROR 5. x_msg_count: Indicates number of error messages API has encountered. 6. x_msg_data: Returns error message text. If the x_msg_count is equal to 1, then this contains the actual message.
You can obtain the valid values for each of these parameters from the application forms session.
1. 2. 3. 4. 5.
Arguments (input) USER_ID - User ID number. RESP_ID - ID number of the responsibility. RESP_APPL_ID - ID number of the application to which the responsibility belongs. SECURITY_GROUP_ID - ID number of the security group. This argument is automatically defaulted by the API. The caller need not pass a value for it.
Book order:
Create an Order from order management Super User, Vision Operations (USA) responsibility with the following details Customer Number :1006 Warehouse : M1 Ship Method : DHL Line Item : AS54888 Ordered Quantity : 2
Create Delivery:
As a next step to booking, a new delivery needs to be created. In order to create a new delivery we need to call the shipping API WSH_DELIVERIES_PUB.Create_update_delivery by passing the required and optional parameter values. Specific parameters: P_api_version_number => 1.0 p_action_code => CREATE -- for creating new delivery p_delivery_info => Attributes of the delivery entity of type Delivery_Pub_Rec_Type
The sample script attached here can be used to create a new delivery.
CREATE_DELIVERY.s ql
(Please note it is necessary to make the changes suggested in these scripts for them to work correctly in your application environment)
The sample script attached here can be used to assign the delivery detail to the newly created delivery.
ASSIGN_DETAIL_TO _DELIVERY.sql
Pick Release:
The shipping public API "WSH_DELIVERIES_PUB. Delivery_Action, enables pick release of the sales order line. The relevant pick release parameters are retrieved from the Shipping and Organization Parameter setup. Specific Parameters: p_action_code = > PICK_RELEASE p_delivery_id/p_delivery_name => Id/name of delivery Refer to the attached PICK_RELEASE.sql sample script which will pick releases lines for a given delivery.
PICK_RELEASE.sql
Manual Pack:
Before advancing to this step, Please refer to metalink Note 124593.1(Containerization in Shipping Execution) for all the necessary needed for packing/containerization Manual Packing involves two steps 1. Creation of LPNs: LPN creation is done using the public API WSH_CONTAINER_PUB. Create_Container Specific Parameters: p_container_item_id => Key flexfield Id for the container p_organization_id => Organization ID for the container. p_quantity => Number of containers created p_container_name => Container name if creating just one container x_container_ids => Table of the newly created container IDs of type WSH_UTIL_CORE.ID_TAB_TYPE, which is a table of type number indexed by binary integers
Refer to the attached CREATE_CONTAINER.sql sample script, which will enable the creation of containers
CREATE_CONTAINE R.sql
LPN Created
2. Perform Manual Pack operation using the LPN created previously In order to pack the delivery detail line item using the LPN created previously, we can use the public API WSH_CONTAINER_PUB.Container_Actions. Specific Parameters: p_container_name => Name of the container p_action_code => Action code PACK p_detail_tab => Delivery detail to be packed. Input table of delivery detail ids of type WSH_UTIL_CORE.ID_TAB_TYPE, which is a table of type Number indexed by binary integers. Refer to the attached MANUAL_PACK.sql sample script, which will enable the packing action on the created LPNs.
MANUAL_PACK.sql
Packing completed. LPN (CT-13) is displayed in the Parent LPN field of the delivery detail
Unpack:
We can unpack the packed delivery line by making call to the container public API WSH_CONTAINER_PUB.Container_Actions Specific Parameters: p_container_name=> Name of the container p_action_code => Action code UNPACK p_detail_tab => Delivery detail to be unpacked. Input table of delivery detail ids of type WSH_UTIL_CORE.ID_TAB_TYPE which is a table of type Number indexed by binary integers.
UNPACK.sql
UNASSIGN_FROM_D ELIVERY.sql
Specific Parameters: P_entity_tab => Table of ids of either lines or containers or deliveries that need to be autopacked of type WSH_UTIL_CORE.ID_TAB_TYPE which is a table of type Number indexed by binary integers. P_entity_type => Type of entity id contained in the entity_tab that needs to be autopacked ('L' - lines, 'C' -containers or 'D' - deliveries). P_group_id_tab => Table of ids (numbers that determine the grouping of lines for packing into containers) of type WSH_UTIL_CORE.ID_TAB_TYPE which is a table of type Number indexed by binary integers. P_pack_cont_flag=> A 'Y' or 'N' value to determine whether to autopack the detail containers that are created into parent containers. X_cont_inst_tab => Table of container IDs created during the autopacking process of type
AUTOPACK_MASTER .sql
Autopack completed. The item being shipped is packed in LPN 251 and the LPN 251 is further packed on to Master LPN 252 (shown under Parent LPN field) Update Delivery Details:
The WSH_DELIVERY_DETAILS_PUB.Update_Shipping_Attributes API enables you to modify data in wsh_delivery_details. In this specific example we have used this API to update the shipped_quantity field in the wsh_delivery_details table to ship all quantities. Specific Parameters: p_changed_attributes=>Attributes of ChangedAttributesTabType that are to be updated. p_source_code => Code for source system which updates wsh_delivery_details table(always set to OE) In order to specify in your logic about backorder or staged quantities you can use the following logic
-- Ship all quantities changed_attributes(1).delivery_detail_id := <<Enter the detail id>>; changed_attributes(1).shipped_quantity := <<Enter the full quantity to be shipped>>; -- Back order all quantities changed_attributes(2).delivery_detail_id := <<Enter the detail id>>; changed_attributes(2).shipped_quantity := 0; changed_attributes(2).cycle_count_quantity := <<Enter the full quantity to be shipped>>; -- Stage all the quantities changed_attributes(3).delivery_detail_id := <<Enter the full quantity to be shipped>>; changed_attributes(3).shipped_quantity := 0; changed_attributes(3).cycle_count_quantity := 0;
UPDATE_SHIPPING_ ATTRIBUTES.sql
Ship Confirm:
As a final step, call WSH_DELIVERIES_PUB.Delivery_Action API in order to ship confirm the delivery. Specific Parameters: p_action_code(Required) => action to be performed on Delivery p_delivery_id (Required) => delivery id on which the action is performed p_trip_name => Trip identifier for assignment of trip to delivery p_asg_pickup_loc_code => Stop location code for pickup assignment p_asg_pickup_dep_date => Stop location departure date for pickup assignment p_asg_dropoff_loc_code=> Stop location code for dropoff assignment p_asg_dropoff_dep_date=> Stop location departure date for dropoff assignment p_sc_action_flag => Ship Confirm option - S, B, T, A, C. Used p_sc_intransit_flag => Ship Confirm set in-transit flag. p_sc_close_trip_flag => Ship Confirm close trip flag. p_sc_create_bol_flag => Ship Confirm create Bill of Lading flag p_sc_stage_del_flag => Ship Confirm create delivery for stage quantity flag p_sc_trip_ship_method => Ship Confirm trip ship method. p_wv_override_flag => Override flag for weight volume calculations. x_trip_name => Name of autocreated trip.
SHIP_CONFIRM.sql
02. Set the Profiles OM: Debug Level - set to 5 INV: Debug Level - set to 10 WSH: Debug Enabled - set to Yes WSH: Debug Level - set to Statement WSH: Debug Log Directory - set to a valid writeable directory path 03. Execute the shipping action via API 04. Navigate to the respective directories specified using the profile WSH: Debug Log Directory 05. Obtain the Debug
Debugging Scenario We are trying to create a delivery and have ensured that the organization passed is not valid. The wrapper file has been embedded with lines calling the Shipping Debugger. The Debug file generated in this case has the relevant debug messages.
Refer to the sample wrapper file with enabled debugging and the debug log file generated as a result of passing invalid organization id.
R3_10370163.dbg
References: Oracle Order management Open Interfaces, API, & Electronic Messaging Guide Release 12 Oracle Order Management Implementation Manual - Release 12 Oracle Shipping Execution User Guide - Release 12
The above documents can be accessed via http://www.oracle.com/technology/documentation/applications.html . Click on the Link Oracle E-Business Suite Online Documentation Library Release 12 and navigate to the Documentation tab. Note 124593.1 Containerization in Shipping Execution. Note 290432.1 How to Create a Debug File in Shipping Execution