Category Archives: Scripts

Manual Pack creation of LPN’s

Manually Pack the Items by creating LPN’s using WSH_CONTAINER_PUB.create_containers:

To Manually Pack the items and Create the LPN or Container for the Particular Item we need to ensure that the Item attribute in Physical Attributes has container flag checked. Continue reading


Related posts:


Creating Move Order using API’s:

Creating Move Order using INV_PICK_WAVE_PICK_CONFIRM API’s:

Sample Script to Populate data into MTL_MATERIAL_TRANSACTIONS_TEMP and serial numbers temp tables: Continue reading


Related posts:

Pick Release the Sales Order using WSH_DELIVERIES_PUB.Delivery_Action

Pick Release a Delivery using wsh_deliveries_pub.delivery_action API:

Once the Delivery Details are assigned to a Delivery the Next Step is to Pick Release the Delivery.

Sample code to Pick Release the Delivery:

    -- Standard Parameters.    
    p_api_version             NUMBER;          
    p_init_msg_list           VARCHAR2(30);    
    p_commit                  VARCHAR2(30);

    --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;
    p_asg_trip_name           VARCHAR2(30);
    p_asg_pickup_stop_id      NUMBER;
    p_asg_pickup_loc_id       NUMBER;
    p_asg_pickup_loc_code     VARCHAR2(30);
    p_asg_pickup_arr_date     DATE;
    p_asg_pickup_dep_date     DATE;
    p_asg_dropoff_stop_id     NUMBER;
    p_asg_dropoff_loc_id      NUMBER;
    p_asg_dropoff_loc_code    VARCHAR2(30);
    p_asg_dropoff_arr_date    DATE;
    p_asg_dropoff_dep_date    DATE;
    p_sc_action_flag          VARCHAR2(10);
    p_sc_close_trip_flag      VARCHAR2(10);
    p_sc_create_bol_flag      VARCHAR2(10);
    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);

    -- outparameters   
    x_return_status           VARCHAR2(10);    
    x_msg_count               NUMBER;          
    x_msg_data                VARCHAR2(2000);  
    x_msg_details             VARCHAR2(3000);
    x_msg_summary             VARCHAR2(3000);

    -- Handle exceptions   
    vApiErrorException        EXCEPTION;


    -- Initialize return status    
    x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;

    -- Call this procedure to initialize applications parameters.     
									  user_id      => 1318
								   ,  resp_id      => 21623
								   ,  resp_appl_id => 660

    -- Values for WSH_DELIVERIES_PUB.delivery_action   
    p_action_code := 'PICK-RELEASE';  -- Releases Lines related to a delivery
    p_delivery_id := 3773373;         -- delivery ID that action is performed on

    -- Call to WSH_DELIVERIES_PUB.Delivery_Action.   
    WSH_DELIVERIES_PUB.Delivery_Action  (
											p_api_version_number           => 1.0,
											p_init_msg_list                => P_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,
											x_trip_name                    => x_trip_name

        IF (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) 
            RAISE vApiErrorException;
            DBMS_OUTPUT.PUT_LINE('The delivery '||p_delivery_id || ' is successfully pick released');
        END IF;
    WHEN vApiErrorException 
        WSH_UTIL_CORE.get_messages('Y', x_msg_summary, x_msg_details,x_msg_count);
        IF x_msg_count > 1 
            x_msg_data := x_msg_summary || x_msg_details;
            DBMS_OUTPUT.PUT_LINE('Message Data : '||x_msg_data);
            x_msg_data := x_msg_summary;
            DBMS_OUTPUT.PUT_LINE('Message Data : '||x_msg_data);
        END IF;

The delivery 3773373 is successfully pick released

Test the API:

 select * from wsh_new_deliveries where delivery_id = 3773373;
 Here the STATUS_CODE will be 'OP'

 select RELEASED_STATUS from WSH_DELIVERY_DETAILS where delivery_detail_id = 3963468;


  • (move order tables. Here request is generated to move item from Source (RM or FG) sub-inventory to staging sub-inventory)
  • MTL_MATERIAL_TRANSACTIONS_TEMP (link to above tables through MOVE_ORDER_HEADER_ID/LINE_ID, this table holds the record temporally)
  • MTL_SERIAL_NUMBERS_TEMP (if item is serial controlled at receipt then record goes in this table)
  • MTL_SERIAL_NUMBERS (enter value in GROUP_MARK_ID )

In shipping transaction form order status remains “Released to Warehouse” and all the material still remains in source sub-inventory. We need to do Move Order Transaction for this order. Till this no material transaction has been posted to MTL_MATERIAL_TRANSACTIONS.

Below post will give you the details about the pick release status
Instance: 11i or R12
Possible Values:
B: Backordered- Line failed to be allocated in Inventory
C: Shipped -Line has been shipped
D: Cancelled -Line is Cancelled
N: Not Ready for Release -Line is not ready to be released
R: Ready to Release: Line is ready to be released
S: Released to Warehouse: Line has been released to Inventory for processing
X: Not Applicable- Line is not applicable for Pick Release
Y: Staged- Line has been picked and staged by Inventory
Delivery line statuses in detail
Not Applicable (Code X)  
The delivery line can be invoiced but non-shippable, for example, a service line or a warranty line.
Not Ready for Release (Code N)
 The delivery line is not eligible for pick release. This happens when the order line is manually imported into Oracle Shipping Execution using the Import Delivery Line concurrent process or the corresponding order line has not reached the Awaiting Shipping workflow activity.
Ready for Release (Code R)
  The delivery line is eligible for pick release.  Occurs when the order line has reached the Awaiting Shipping workflow activity (it is booked, scheduled, and in Oracle Shipping Execution).
Submitted to Warehouse (Code S)
Pick release has processed the delivery line and has:
1.       Created move order headers and lines.
2.       Found available quantity and created inventory allocations.
3.       Not pick confirmed. If you are using auto-pick confirm, it changes release status to Staged. If you are not using auto-pick confirm and want to progress the delivery lines, navigate to Oracle Inventory Move Order Transaction window and perform manual pick confirm.
Staged (Code Y)
 The delivery line is pick confirmed; inventory is transferred from storage sub-inventory to staging sub-inventory.  It remains staged until ship confirm.
Backordered (Code B)
Some of the circumstances that can causes this status are listed below
a. Pick release has processed the delivery line and cannot find the entire quantity.  This typically occurs when the Oracle Inventory indicates that there is not enough material (either because there is not enough material or because the inventory balance is incorrect).
b. At ship confirm, you: Enter Shipped Quantity that is less than Original Requested Quantity Backorder the entire delivery quantity transfer a reservation to cycle count.
c. This typically occurs when the material that you want to ship:
1.       Has become unavailable, for example, damaged, between picking and shipping.
2.       Is available and you backorder material for specific business reasons. For example, all available material has been allocated to a specific customer when you find out additional supply for other orders will be delayed.
Shipped (Code C)
  The delivery line’s delivery is ship confirmed and posted as in-transit, OM Interface and Inventory Interface have processed, and the trip is closed.
Cancelled (Code D)

The order line that the delivery line supports is cancelled.


Related posts:

Assign Delivery Details to Delivery

Assigning Delivery Details to Delivery

Based on the delivery details assigned to the sales Order find the delivery detail id. Now we are trying to attach the Delivery Details to the New delivery which is created.

The delivery detail can be assigned to the newly created delivery by using the public API “WSH_DELIVERY_DETAILS_PUB. Detail_to_Delivery”. Continue reading


Related posts:

Create a New Delivery for an Existing Order

Create a New delivery for an existing Sales Order

We have created a Sales Order from Back End using the Sales Order API in Booked Status. The order Number Is: 66401. When an Order is in Booked status a delivery detail’s are created and which can be viewed from Shipping –> Transactions form from Front End.

Find out the existing Ship To Location Id, ship from location id, Organization id using the following Script:

SELECT  delivery_detail_id,
	ship_to_location_id ,
        customer_id   ,
  FROM wsh_delivery_details 
 WHERE source_header_id = 198316;



Sample script to create Deliveries:

    -- Standard Parameters.   
    pApiVersion              NUMBER := 1.0;   
    pInitMsgList             VARCHAR2(30);

    -- Sepcific Parameters for WSH_DELIVERIES_PUB.create_update_delivery
    pActionCode              VARCHAR2(15);                             
    xDeliveryId              NUMBER;
    pDeliveryName            VARCHAR2(30);

    -- out parameters
    xReturnStatus            VARCHAR2(10);
    xMsgCount                NUMBER;
    xMsgData                 VARCHAR2(2000);
    xMsgDetails              VARCHAR2(3000);
    xMsgSummary              VARCHAR2(3000);

   -- Handle exceptions
   vFailApiException         EXCEPTION;
    -- Initialize return status   

    -- Call this procedure to initialize applications parameters.
       user_id      => 1318
    ,  resp_id      => 21623
    ,  resp_appl_id => 660);

    -- Create a new delivery for the following                            := 'AOATestDelvryAPI-1'; -- Pass delivery name 
    pDeliveryInfo.organization_id                 := 204;      -- Pass Organization ID
    pDeliveryInfo.initial_pickup_location_id      := 20795;      -- Pass the Pick up location ID 
    pDeliveryInfo.ultimate_dropoff_location_id    := 16879;     -- pass the Drop off location ID 
    pDeliveryInfo.ship_method_code                := 'DHL';    -- pass Ship Method
    pDeliveryInfo.CUSTOMER_ID                     := 5371;
    pDeliveryInfo.intmed_ship_to_location_id      := 16879;
    pDeliveryInfo.freight_terms_code              := 'Due';
    pDeliveryInfo.fob_code := 'Destination';
    pDeliveryInfo.weight_uom_code := 'Lbs';
    pDeliveryInfo.volume_uom_code := 'FT3';
    pDeliveryInfo.ultimate_dropoff_date := SYSDATE;
    pDeliveryInfo.initial_pickup_date   := SYSDATE;
    pActionCode                                   := 'CREATE'; -- Action Code 

    -- Call to WSH_DELIVERIES_PUB.create_update_delivery
     WSH_DELIVERIES_PUB.create_update_delivery   (
	 											  p_api_version_number  => pApiVersion,
	 											  p_init_msg_list       => pInitMsgList,
	 											  x_return_status       => xReturnStatus,
	 											  x_msg_count           => xMsgCount,
	 											  x_msg_data            => xMsgData,
	 											  p_action_code         => pActionCode,
	 											  p_delivery_info       => pDeliveryInfo,
	 											  p_delivery_name       => pDeliveryName,
	 											  x_delivery_id         => xDeliveryId,
	 											  x_name                => pDeliveryName 

    -- If the return status is not success(S) then raise exception

    IF (xReturnStatus <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) 
       RAISE vFailApiException;
       DBMS_OUTPUT.PUT_LINE('New Delivery ID  : '||xDeliveryId);
       DBMS_OUTPUT.PUT_LINE('New Delivery Name: '||pDeliveryName);
    END IF;

    WHEN vFailApiException 
        WSH_UTIL_CORE.get_messages('Y', xMsgSummary, xMsgDetails,xMsgCount);
        IF xMsgCount > 1 
            xMsgData := xMsgSummary || xMsgDetails;
            DBMS_OUTPUT.PUT_LINE('Message Data : '||xMsgData);
            xMsgData := xMsgSummary;
            DBMS_OUTPUT.PUT_LINE('Message Data : '||xMsgData);
        END IF;

New Delivery ID  : 3773373
New Delivery Name: AOATestDelvryAPI-1

Once the delivery is Created look at wsh_new_deliveries for this delivery_id:

  FROM wsh_new_deliveries 
 WHERE delivery_id = 3772376;



Related posts: