Introduction:
This Post illustrates the steps required to get the Item Available to Transact Quantity in Inventory using API.
Script
FUNCTION xx_item_availble_to_transact (
p_inventory_item_id NUMBER,
p_organization_id NUMBER,
p_subinventory_code VARCHAR2,
p_locater NUMBER
)
RETURN NUMBER
IS
l_api_return_status VARCHAR2 (1);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (1000);
l_qty_oh NUMBER; — v_qoh
l_qty_res_oh NUMBER; — v_rqoh
l_qty_res NUMBER; –v_atr
l_qty_sug NUMBER; –v_rqoh
l_qty_att NUMBER; –v_att
l_qty_atr NUMBER; –v_atr
is_lot_control_code BOOLEAN;
is_serioal_control_code BOOLEAN;
att NUMBER;
BEGIN
inv_quantity_tree_grp.clear_quantity_cache;
apps.inv_quantity_tree_pub.query_quantities
(p_api_version_number => 1.0,
p_init_msg_lst => apps.fnd_api.g_false,
x_return_status => l_api_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_organization_id => p_organization_id,
p_inventory_item_id => p_inventory_item_id,
p_tree_mode => apps.inv_quantity_tree_pub.g_transaction_mode,
p_onhand_source => 3,
p_is_revision_control => FALSE,
p_is_lot_control => FALSE,
p_is_serial_control => FALSE,
p_revision => NULL,
p_lot_number => NULL,
p_subinventory_code => p_subinventory_code,
p_locator_id => p_locater,
x_qoh => l_qty_oh,
x_rqoh => l_qty_res_oh,
x_qr => l_qty_res,
x_qs => l_qty_sug,
x_att => l_qty_att,
x_atr => l_qty_atr
);
IF l_api_return_status <> fnd_api.g_ret_sts_success
THEN
att := 0;
ELSE
att := l_qty_att;
END IF;
RETURN att;
END;
/
SELECT xx_item_avail_to_reserve
(p_inventory_item_id,
p_organization_id,
p_subinventory_code,
p_inventory_location_id
) available_to_reserve
FROM DUAL
Got any queries?
Do drop a note by writing us at venkatesh.b@staging.doyensys.com or use the comment section below to ask your questions