Back Order Custom Hook

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

Vision Demo - Custom Hook for generating Source Location for

Backordered Material
- Filename : WSHCSPBB.pls
- Package : WSH_CUSTOM_PUB
- Procedure : Change_Backorder_Sub_Locator
- Description : This procedure is designed for the user to customize and change the destination
subinventory and locator for move order lines created during backorder process.
- Procedure Parameters
Parameter Name In/Out Description
p_delivery_detail_id IN Backordering Delivery Detail ID
p_organization_id IN Inventory Organization id
p_inventory_item_id IN Inventory Item Id
p_from_subinventory IN From Subinventory (Source) i.e. Staging Subinventory
p_to_subinventory IN To Subinventory (Destination) i.e. Subinventory from
where quantity was picked
p_from_locator_id IN From Locator Id
p_to_locator_id IN To Locator Id
p_reason_id IN Backorder Reason
p_transaction_id IN The material transaction id in mtl_material_transactions
table
x_move_to_subinventory OUT Change the destination Subinventory for Move Order
created for Backorder Delivery details
x_move_to_locator_id OUT Change the destination Destination locator for Move
Order created for Backorder Delivery details
x_customized_flag OUT Please pass value 'Y' if custom code is to be used.
- Sample Script used for Demo to return to Stores Subinventory
PROCEDURE Change_Backorder_Sub_Locator (p_delivery_detail_id IN NUMBER,
p_organization_id IN NUMBER,
p_inventory_item_id IN NUMBER,
p_from_subinventory IN VARCHAR2,
p_to_subinventory IN VARCHAR2,
p_from_locator_id IN NUMBER,
p_to_locator_id IN NUMBER,
p_reason_id IN NUMBER,
p_transaction_id IN NUMBER,
x_move_to_subinventory OUT NOCOPY VARCHAR2,
x_move_to_locator_id OUT NOCOPY NUMBER,
x_customized_flag OUT NOCOPY VARCHAR2) IS

l_debug_on BOOLEAN;
l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.'
||'Change_Backorder_Sub_Locator';
BEGIN

l_debug_on := WSH_DEBUG_INTERFACE.g_debug;

IF l_debug_on IS NULL
THEN
l_debug_on := WSH_DEBUG_SV.is_debug_enabled;
END IF;

IF l_debug_on THEN
WSH_DEBUG_SV.push(l_module_name);
WSH_DEBUG_SV.logmsg(l_module_name, 'Delivery Detail p_delivery_detail_id : '||p_delivery_detail_id);
WSH_DEBUG_SV.logmsg(l_module_name, 'Delivery Detail p_organization_id : '||p_organization_id);
WSH_DEBUG_SV.logmsg(l_module_name, 'Delivery Detail p_inventory_item_id : '||p_inventory_item_id);
WSH_DEBUG_SV.logmsg(l_module_name, 'Delivery Detail p_from_subinventory : '||p_from_subinventory);
WSH_DEBUG_SV.logmsg(l_module_name, 'Delivery Detail p_to_subinventory : '||p_to_subinventory);
WSH_DEBUG_SV.logmsg(l_module_name, 'Delivery Detail p_from_locator_id: '|| p_from_locator_id);
WSH_DEBUG_SV.logmsg(l_module_name, 'Delivery Detail p_to_locator_id: '||p_to_locator_id);
WSH_DEBUG_SV.logmsg(l_module_name, 'Delivery Detail p_reason_id : '||p_reason_id );
WSH_DEBUG_SV.logmsg(l_module_name, 'Delivery Detail p_transaction_id : '||p_transaction_id );
WSH_DEBUG_SV.log(l_module_name,'Before call '||to_char(sysdate,'MM/DD/YYYY HH24:MI:SS'));
END IF;

x_customized_flag :='Y';
x_move_to_subinventory := 'Stores';
x_move_to_locator_id := NULL;

IF l_debug_on THEN
WSH_DEBUG_SV.log(l_module_name,'After call '||to_char(sysdate,'MM/DD/YYYY HH24:MI:SS'));
WSH_DEBUG_SV.pop(l_module_name);
END IF;
--
EXCEPTION
WHEN OTHERS THEN
IF l_debug_on THEN
WSH_DEBUG_SV.log(l_module_name,'Inside Exception', sqlerrm);
WSH_DEBUG_SV.pop(l_module_name);
END IF;

END Change_Backorder_Sub_Locator;
Vision Demo - Backorder Delivery Line with Automatic Movement of
Material to a location derived by Custom Hook
1. Create Sales Order with a line as shown below and book the sales order

2. Query for Delivery Lines on Shipping Transactions form. Select Actions as “Launch Pick Release” and
click on “Go” button.
3. Wait for “Pick Slip Report” concurrent request to complete.
4. The delivery line is in status “Staged/Pick Confirmed”
5. If item is Serial Controlled, check for Lot and Serial Numbers Staged from Tools -> Serial Numbers

6. Check the Material Transactions for Sales Oder Pick. Note that, 4 quantity is picked from FGI and
moved to Staging1 subinventory.
7. Note down the Serial Numbers that are pick released
8. Backorder the delivery by Selecting Action as “Ship Confirm” against Delivery and in “Confirm
Delivery” form Select “Backorder All” radio button
9. Observe that there are 2 concurrent requests - “Process Move Order for Backorder” and “Move
Order Pick Slip”.

10. Log file of “Move Order Pick Slip” shows the Move Order generated to transfer the staged quantity

11. Output of “Move Order Pick Slip” shows the details of the material that will be moved.
Task Status is Completed because of “Auto Transact” Yes on Shipping Transactions. Destination
Subinventory is “Stores” which is derived from WSH_CUSTOM_PUB.Change_Backorder_Sub_Locator
12. Query for Delivery Lines from Shipping Transactions form.
It shows Delivery Line for Backordered quantity.

13. Check the Backorder Move Order.


For every SKU and Backorder Reason combination, one move order line is created in the Backorder
Move Order.
14. Observe that the source is the Staging1 Subinventory. Destination is “Stores” even though Pick
release process has sourced from FGI.
15. Check the Material Transactions for the backorder move order.

Material is moved from “Staging1” to “Stores” subinventory.


Transaction Type is “Reverse Staging Transfer”.

The same Serial Numbers which were pick released were moved by Backorder Move order.

You might also like