195: IF (mol_id IS NOT NULL) THEN
196: BEGIN
197: SELECT line_status
198: INTO line_status
199: FROM mtl_txn_request_lines
200: WHERE line_id = mol_id;
201:
202: IF (l_debug = 1) THEN
203: mydebug(' Status ' || line_status);
204: END IF;
205: EXCEPTION
206: WHEN NO_DATA_FOUND THEN
207: IF (l_debug = 1) THEN
208: mydebug('No data found in mtl_txn_request_lines');
209: END IF;
210:
211: line_status := -1;
212: END;
264: mydebug(' alloc quantity deleted ' || l_del_quantity);
265: mydebug(' alloc quantity deleted ' || l_sec_del_quantity);
266: END IF;
267:
268: UPDATE mtl_txn_request_lines
269: SET quantity_detailed =(quantity_detailed - l_del_quantity),
270: secondary_quantity_detailed =(secondary_quantity_detailed - l_sec_del_quantity)
271: WHERE line_id = mol_id;
272:
291: mydebug('No more allocations in mmtt left for this mo line ' || mol_id);
292: mydebug(' so closing the mo line ' || mol_id);
293: END IF;
294:
295: UPDATE mtl_txn_request_lines
296: SET line_status = inv_globals.g_to_status_closed
297: WHERE line_id = mol_id;
298:
299: IF (l_debug = 1) THEN
393: SELECT NVL(mr.lot_number, mtrl.lot_number)
394: INTO l_reserved_lot
395: FROM mtl_material_transactions_temp mmtt,
396: mtl_reservations mr,
397: mtl_txn_request_lines mtrl
398: WHERE mmtt.transaction_temp_id = p_temp_id
399: AND mmtt.organization_id = l_org_id
400: AND mmtt.reservation_id = mr.reservation_id (+)
401: AND mtrl.line_id = mmtt.move_order_line_id
791: , mmtt.transaction_uom
792: , mmtt.move_order_line_id
793: , mtrl.uom_code
794: FROM mtl_material_transactions_temp mmtt
795: , mtl_txn_request_lines mtrl
796: WHERE mmtt.parent_line_id = p_temp_id
797: AND mtrl.line_id = mmtt.move_order_line_id
798: AND mtrl.line_status = 9
799: UNION ALL
1091: ELSE
1092: l_conv_qty := l_quantity;
1093: END IF;
1094:
1095: UPDATE mtl_txn_request_lines
1096: SET quantity_detailed = (quantity_detailed - l_conv_qty)
1097: WHERE line_id = l_mo_line_id;
1098:
1099: IF (l_debug = 1) THEN
1109: IF (l_debug = 1) THEN
1110: mydebug('No more allocations for mo line ' || to_char(l_mo_line_id));
1111: END IF;
1112:
1113: UPDATE mtl_txn_request_lines
1114: SET line_status = inv_globals.g_to_status_closed
1115: WHERE line_id = l_mo_line_id;
1116: ELSE
1117: IF (l_debug = 1) THEN