Procedure get_att (p_sub_inv in varchar2, p_locator_id in number, p_lot in varchar2, x_avi_qty out number, x_avi_qty2 out number)
Is
Rochelle available_quantity number: = NULL;
Rochelle hand_quantity number: = NULL;
Rochelle available_onhand number: = NULL;
Rochelle available_quantity2 number: = NULL;
Rochelle onhand_quantity2 number: = NULL;
Rochelle available_onhand2 number: = NULL;
Rochelle return_status varchar2 (1): = NULL;
Rochelle message_data varchar2 (2000): = NULL;
Rochelle message_count number: = NULL;
Rochelle RET number: = NULL;
Rochelle rev_ctl number;
Rochelle _ CTL number;
Rochel_ctl number;
Begin
Select MSB. revision_qty_control_code,
MSB. lot_control_code,
MSB. serial_number_control_code
Into l_rev_ctl,
Rochelle _ CTL,
L_ser_ctl
From mtl_system_items_ B MSB
Where MSB. inventory_item_id =: gme_batch.inventory_item_id
And MSB. organization_id =: parameter.org _ id;
Rochelle RET: = inv_quantity_tree_ue.create_tree (p_organization_id =>: parameter.org _ id
, P_inventory_item_id =>: gme_batch.inventory_item_id
, P_revision_control => l_rev_ctl
, P_lot_control => l_lot_ctl
, P_serial_control => l_ser_ctl
, P_grade_code => null
, P_lot_active => 2
, P_demand_header_id =>: gme_batch.batch_id
, P_demand_header_type => 5
, P_tree_mode => 2
, P_negative_inv_allowed =>: parameter. neg_inv_rec_code
, P_demand_source_name => null
, P_demand_source_line_id =>: gme_batch.material_detail_id
, X_available_quantity => l_available_quantity
, X_onhand_quantity => l_onhand_quantity
, X_available_quantity2 => l_available_quantity2
, X_onhand_quantity2 => l_onhand_quantity2
, X_return_status => l_return_status
, X_message_count => l_message_count
, X_message_data => l_message_data );
If l_ret = 0 or l_return_status <>'s 'then
Fnd_message.set_name ('inv', 'inv _ user_exit_error2 ');
Fnd_message.show;
Raise form_trigger_failure;
Else
/*
Copy (l_available_quantity, 'mtl _ trx_line.att ');
Copy (l_onhand_quantity, 'mtl _ trx_line.qoh ');
Copy (l_available_quantity2, 'mtl _ trx_line.satt '); -- invconv change
Copy (maid); -- invconv change
*/
NULL;
End if;
Rochelle RET: = inv_quantity_tree_ue.query_tree (p_organization_id =>: parameter.org _ id
, P_inventory_item_id =>: gme_batch.inventory_item_id
, P_revision_control => l_rev_ctl
, P_lot_control => l_lot_ctl
, P_serial_control => l_ser_ctl -- invconv change
, P_demand_header_id =>: gme_batch.batch_id
, P_demand_header_type => 5
, P_revision => null
, P_subinventory => p_sub_inv
, P_locator => p_locator_id
, P_transfer_subinventory => null
, P_uom_code => name_in ('gme _ batch. primary_uom_code ')
, P_lot_active => 2
, P_lot => p_lot
, P_demand_source_name => null
, P_demand_source_line_id =>: gme_batch.material_detail_id
, X_available_onhand => l_available_onhand
, X_available_quantity => l_available_quantity
, X_onhand_quantity => l_onhand_quantity
, X_available_onhand2 => l_available_onhand2
, X_available_quantity2 => l_available_quantity2
, X_onhand_quantity2 => l_onhand_quantity2
, X_return_status => l_return_status
, X_message_count => l_message_count
, X_message_data => l_message_data );
If l_ret = 0 or l_return_status <>'s 'then
Fnd_message.set_name ('inv', 'inv _ user_exit_error4 ');
Fnd_message.show;
Raise form_trigger_failure;
End if;
-- Return l_available_quantity;
X_avi_qty: = l_available_quantity;
X_avi_qty2: = l_available_quantity2;
Exception
When others then
-- Return 0;
X_avi_qty: = 0;
X_avi_qty2: = 0;
End;