192: , secondary_uom_code = p_mo_line_detail_rec.secondary_uom_code -- INVCONV change
193: WHERE move_order_line_id = p_mo_line_detail_rec.move_order_line_id
194: AND transaction_temp_id = p_mo_line_detail_rec.transaction_temp_id;
195:
196: x_return_status := fnd_api.g_ret_sts_success;
197: EXCEPTION
198: WHEN OTHERS THEN
199: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
200: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Update_Row');
199: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
200: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Update_Row');
201: END IF;
202:
203: x_return_status := fnd_api.g_ret_sts_unexp_error;
204: RAISE fnd_api.g_exc_unexpected_error;
205: END update_row;
206:
207: -- Procedure Insert_Row
200: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Update_Row');
201: END IF;
202:
203: x_return_status := fnd_api.g_ret_sts_unexp_error;
204: RAISE fnd_api.g_exc_unexpected_error;
205: END update_row;
206:
207: -- Procedure Insert_Row
208: PROCEDURE insert_row(x_return_status OUT NOCOPY VARCHAR2, p_mo_line_detail_rec IN g_mmtt_rec) IS
206:
207: -- Procedure Insert_Row
208: PROCEDURE insert_row(x_return_status OUT NOCOPY VARCHAR2, p_mo_line_detail_rec IN g_mmtt_rec) IS
209: BEGIN
210: x_return_status := fnd_api.g_ret_sts_success;
211:
212: INSERT INTO mtl_material_transactions_temp
213: (
214: transaction_header_id
606: DELETE FROM mtl_material_transactions_temp
607: WHERE move_order_line_id = p_line_id
608: AND transaction_temp_id = p_line_detail_id;
609:
610: x_return_status := fnd_api.g_ret_sts_success;
611: EXCEPTION
612: WHEN OTHERS THEN
613: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
614: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Delete_Row');
613: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
614: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Delete_Row');
615: END IF;
616:
617: x_return_status := fnd_api.g_ret_sts_unexp_error;
618: RAISE fnd_api.g_exc_unexpected_error;
619: END delete_row;
620:
621: -- Procedure lock_Row
614: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Delete_Row');
615: END IF;
616:
617: x_return_status := fnd_api.g_ret_sts_unexp_error;
618: RAISE fnd_api.g_exc_unexpected_error;
619: END delete_row;
620:
621: -- Procedure lock_Row
622: PROCEDURE lock_row(
1212:
1213: x_mo_line_detail_rec := l_mmtt_rec;
1214: -- Set return status
1215:
1216: x_return_status := fnd_api.g_ret_sts_success;
1217: ELSE
1218: -- Row has changed by another user.
1219:
1220: x_return_status := fnd_api.g_ret_sts_error;
1216: x_return_status := fnd_api.g_ret_sts_success;
1217: ELSE
1218: -- Row has changed by another user.
1219:
1220: x_return_status := fnd_api.g_ret_sts_error;
1221:
1222: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1223: fnd_message.set_name('INV', 'OE_LOCK_ROW_CHANGED');
1224: fnd_msg_pub.ADD;
1224: fnd_msg_pub.ADD;
1225: END IF;
1226: END IF;
1227:
1228: x_return_status := fnd_api.g_ret_sts_success;
1229: EXCEPTION
1230: WHEN NO_DATA_FOUND THEN
1231: x_return_status := fnd_api.g_ret_sts_error;
1232:
1227:
1228: x_return_status := fnd_api.g_ret_sts_success;
1229: EXCEPTION
1230: WHEN NO_DATA_FOUND THEN
1231: x_return_status := fnd_api.g_ret_sts_error;
1232:
1233: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1234: fnd_message.set_name('INV', 'OE_LOCK_ROW_DELETED');
1235: fnd_msg_pub.ADD;
1234: fnd_message.set_name('INV', 'OE_LOCK_ROW_DELETED');
1235: fnd_msg_pub.ADD;
1236: END IF;
1237: WHEN app_exceptions.record_lock_exception THEN
1238: x_return_status := fnd_api.g_ret_sts_error;
1239:
1240: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1241: fnd_message.set_name('INV', 'OE_LOCK_ROW_ALREADY_LOCKED');
1242: fnd_msg_pub.ADD;
1241: fnd_message.set_name('INV', 'OE_LOCK_ROW_ALREADY_LOCKED');
1242: fnd_msg_pub.ADD;
1243: END IF;
1244: WHEN OTHERS THEN
1245: x_return_status := fnd_api.g_ret_sts_unexp_error;
1246:
1247: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1248: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Lock_Row');
1249: END IF;
1256: END query_row;
1257:
1258: -- Function Query_Rows
1259: --
1260: FUNCTION query_rows(p_line_id IN NUMBER := fnd_api.g_miss_num, p_line_detail_id IN NUMBER := fnd_api.g_miss_num)
1261: RETURN g_mmtt_tbl_type IS
1262: l_mmtt_rec g_mmtt_rec;
1263: l_mmtt_tbl g_mmtt_tbl_type;
1264:
1655: WHERE transaction_temp_id = p_line_detail_id;
1656:
1657: l_debug NUMBER := NVL(fnd_profile.VALUE('INV_DEBUG_TRACE'), 0);
1658: BEGIN
1659: IF (p_line_id IS NOT NULL AND p_line_id <> fnd_api.g_miss_num)
1660: AND(p_line_detail_id IS NOT NULL AND p_line_detail_id <> fnd_api.g_miss_num) THEN
1661: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1662: fnd_msg_pub.add_exc_msg(
1663: g_pkg_name
1656:
1657: l_debug NUMBER := NVL(fnd_profile.VALUE('INV_DEBUG_TRACE'), 0);
1658: BEGIN
1659: IF (p_line_id IS NOT NULL AND p_line_id <> fnd_api.g_miss_num)
1660: AND(p_line_detail_id IS NOT NULL AND p_line_detail_id <> fnd_api.g_miss_num) THEN
1661: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1662: fnd_msg_pub.add_exc_msg(
1663: g_pkg_name
1664: , 'Query Rows'
1665: , 'Keys are mutually exclusive: line_id = ' || p_line_id || ', line_detail_id = ' || p_line_detail_id
1666: );
1667: END IF;
1668:
1669: RAISE fnd_api.g_exc_unexpected_error;
1670: END IF;
1671:
1672: IF (p_line_id IS NOT NULL AND p_line_id <> fnd_api.g_miss_num) THEN
1673: FOR l_implicit_rec IN l_mmtt_csr LOOP
1668:
1669: RAISE fnd_api.g_exc_unexpected_error;
1670: END IF;
1671:
1672: IF (p_line_id IS NOT NULL AND p_line_id <> fnd_api.g_miss_num) THEN
1673: FOR l_implicit_rec IN l_mmtt_csr LOOP
1674: l_mmtt_rec.transaction_header_id := l_implicit_rec.transaction_header_id;
1675: l_mmtt_rec.transaction_temp_id := l_implicit_rec.transaction_temp_id;
1676: l_mmtt_rec.source_code := l_implicit_rec.source_code;
2062: l_mmtt_tbl(l_mmtt_tbl.COUNT + 1) := l_mmtt_rec;
2063: END LOOP;
2064: END IF;
2065:
2066: IF (p_line_detail_id IS NOT NULL AND p_line_detail_id <> fnd_api.g_miss_num)
2067: AND(l_mmtt_tbl.COUNT = 0) THEN
2068: RAISE NO_DATA_FOUND;
2069: END IF;
2070:
2071: -- Return fetched table
2072:
2073: RETURN l_mmtt_tbl;
2074: EXCEPTION
2075: WHEN fnd_api.g_exc_unexpected_error THEN
2076: RAISE fnd_api.g_exc_unexpected_error;
2077: WHEN OTHERS THEN
2078: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2079: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Query_Rows');
2072:
2073: RETURN l_mmtt_tbl;
2074: EXCEPTION
2075: WHEN fnd_api.g_exc_unexpected_error THEN
2076: RAISE fnd_api.g_exc_unexpected_error;
2077: WHEN OTHERS THEN
2078: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2079: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Query_Rows');
2080: END IF;
2078: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2079: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Query_Rows');
2080: END IF;
2081:
2082: RAISE fnd_api.g_exc_unexpected_error;
2083: END query_rows;
2084:
2085: -- This API currently works only for no control and lot controlled items
2086: PROCEDURE update_quantity_allocations(
2141: l_current_table VARCHAR2(30);
2142: l_debug NUMBER := NVL(fnd_profile.VALUE('INV_DEBUG_TRACE'), 0);
2143: BEGIN
2144: SAVEPOINT update_qty;
2145: x_return_status := fnd_api.g_ret_sts_success;
2146:
2147: IF p_move_order_line_id IS NULL THEN
2148: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2149: fnd_msg_pub.ADD;
2146:
2147: IF p_move_order_line_id IS NULL THEN
2148: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2149: fnd_msg_pub.ADD;
2150: RAISE fnd_api.g_exc_unexpected_error;
2151: END IF;
2152:
2153: i := p_mold_table.FIRST;
2154:
2154:
2155: IF i IS NULL THEN
2156: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2157: fnd_msg_pub.ADD;
2158: RAISE fnd_api.g_exc_unexpected_error;
2159: END IF;
2160:
2161: WHILE i IS NOT NULL LOOP
2162: IF p_mold_table(i).organization_id IS NULL
2159: END IF;
2160:
2161: WHILE i IS NOT NULL LOOP
2162: IF p_mold_table(i).organization_id IS NULL
2163: OR p_mold_table(i).organization_id = fnd_api.g_miss_num THEN
2164: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2165: fnd_msg_pub.ADD;
2166: RAISE fnd_api.g_exc_unexpected_error;
2167: END IF;
2162: IF p_mold_table(i).organization_id IS NULL
2163: OR p_mold_table(i).organization_id = fnd_api.g_miss_num THEN
2164: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2165: fnd_msg_pub.ADD;
2166: RAISE fnd_api.g_exc_unexpected_error;
2167: END IF;
2168:
2169: IF p_mold_table(i).subinventory_code IS NULL
2170: OR p_mold_table(i).subinventory_code = fnd_api.g_miss_char THEN
2166: RAISE fnd_api.g_exc_unexpected_error;
2167: END IF;
2168:
2169: IF p_mold_table(i).subinventory_code IS NULL
2170: OR p_mold_table(i).subinventory_code = fnd_api.g_miss_char THEN
2171: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2172: fnd_msg_pub.ADD;
2173: RAISE fnd_api.g_exc_unexpected_error;
2174: END IF;
2169: IF p_mold_table(i).subinventory_code IS NULL
2170: OR p_mold_table(i).subinventory_code = fnd_api.g_miss_char THEN
2171: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2172: fnd_msg_pub.ADD;
2173: RAISE fnd_api.g_exc_unexpected_error;
2174: END IF;
2175:
2176: IF p_mold_table(i).locator_id = fnd_api.g_miss_num THEN
2177: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2172: fnd_msg_pub.ADD;
2173: RAISE fnd_api.g_exc_unexpected_error;
2174: END IF;
2175:
2176: IF p_mold_table(i).locator_id = fnd_api.g_miss_num THEN
2177: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2178: fnd_msg_pub.ADD;
2179: RAISE fnd_api.g_exc_unexpected_error;
2180: END IF;
2175:
2176: IF p_mold_table(i).locator_id = fnd_api.g_miss_num THEN
2177: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2178: fnd_msg_pub.ADD;
2179: RAISE fnd_api.g_exc_unexpected_error;
2180: END IF;
2181:
2182: IF p_mold_table(i).inventory_item_id IS NULL
2183: OR p_mold_table(i).locator_id = fnd_api.g_miss_num THEN
2179: RAISE fnd_api.g_exc_unexpected_error;
2180: END IF;
2181:
2182: IF p_mold_table(i).inventory_item_id IS NULL
2183: OR p_mold_table(i).locator_id = fnd_api.g_miss_num THEN
2184: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2185: fnd_msg_pub.ADD;
2186: RAISE fnd_api.g_exc_unexpected_error;
2187: END IF;
2182: IF p_mold_table(i).inventory_item_id IS NULL
2183: OR p_mold_table(i).locator_id = fnd_api.g_miss_num THEN
2184: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2185: fnd_msg_pub.ADD;
2186: RAISE fnd_api.g_exc_unexpected_error;
2187: END IF;
2188:
2189: IF p_mold_table(i).revision = fnd_api.g_miss_char THEN
2190: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2185: fnd_msg_pub.ADD;
2186: RAISE fnd_api.g_exc_unexpected_error;
2187: END IF;
2188:
2189: IF p_mold_table(i).revision = fnd_api.g_miss_char THEN
2190: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2191: fnd_msg_pub.ADD;
2192: RAISE fnd_api.g_exc_unexpected_error;
2193: END IF;
2188:
2189: IF p_mold_table(i).revision = fnd_api.g_miss_char THEN
2190: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2191: fnd_msg_pub.ADD;
2192: RAISE fnd_api.g_exc_unexpected_error;
2193: END IF;
2194:
2195: IF p_mold_table(i).lot_number = fnd_api.g_miss_char THEN
2196: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2191: fnd_msg_pub.ADD;
2192: RAISE fnd_api.g_exc_unexpected_error;
2193: END IF;
2194:
2195: IF p_mold_table(i).lot_number = fnd_api.g_miss_char THEN
2196: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2197: fnd_msg_pub.ADD;
2198: RAISE fnd_api.g_exc_unexpected_error;
2199: END IF;
2194:
2195: IF p_mold_table(i).lot_number = fnd_api.g_miss_char THEN
2196: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2197: fnd_msg_pub.ADD;
2198: RAISE fnd_api.g_exc_unexpected_error;
2199: END IF;
2200:
2201: IF p_mold_table(i).serial_number = fnd_api.g_miss_char THEN
2202: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2197: fnd_msg_pub.ADD;
2198: RAISE fnd_api.g_exc_unexpected_error;
2199: END IF;
2200:
2201: IF p_mold_table(i).serial_number = fnd_api.g_miss_char THEN
2202: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2203: fnd_msg_pub.ADD;
2204: RAISE fnd_api.g_exc_unexpected_error;
2205: END IF;
2200:
2201: IF p_mold_table(i).serial_number = fnd_api.g_miss_char THEN
2202: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2203: fnd_msg_pub.ADD;
2204: RAISE fnd_api.g_exc_unexpected_error;
2205: END IF;
2206:
2207: IF p_mold_table(i).transaction_uom = fnd_api.g_miss_char THEN
2208: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2203: fnd_msg_pub.ADD;
2204: RAISE fnd_api.g_exc_unexpected_error;
2205: END IF;
2206:
2207: IF p_mold_table(i).transaction_uom = fnd_api.g_miss_char THEN
2208: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2209: fnd_msg_pub.ADD;
2210: RAISE fnd_api.g_exc_unexpected_error;
2211: END IF;
2206:
2207: IF p_mold_table(i).transaction_uom = fnd_api.g_miss_char THEN
2208: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2209: fnd_msg_pub.ADD;
2210: RAISE fnd_api.g_exc_unexpected_error;
2211: END IF;
2212:
2213: IF p_mold_table(i).transaction_quantity IS NULL
2214: OR p_mold_table(i).transaction_quantity = 0
2211: END IF;
2212:
2213: IF p_mold_table(i).transaction_quantity IS NULL
2214: OR p_mold_table(i).transaction_quantity = 0
2215: OR p_mold_table(i).locator_id = fnd_api.g_miss_num THEN
2216: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2217: fnd_msg_pub.ADD;
2218: RAISE fnd_api.g_exc_unexpected_error;
2219: END IF;
2214: OR p_mold_table(i).transaction_quantity = 0
2215: OR p_mold_table(i).locator_id = fnd_api.g_miss_num THEN
2216: fnd_message.set_name('INV', 'INV_MISSING_REQUIRED_PARAMETER');
2217: fnd_msg_pub.ADD;
2218: RAISE fnd_api.g_exc_unexpected_error;
2219: END IF;
2220:
2221: BEGIN
2222: SELECT primary_uom_code
2233: EXCEPTION
2234: WHEN NO_DATA_FOUND THEN
2235: fnd_message.set_name('INV', 'INV-NO ITEM RECORD');
2236: fnd_msg_pub.ADD;
2237: RAISE fnd_api.g_exc_error;
2238: WHEN OTHERS THEN
2239: RAISE;
2240: END;
2241:
2243: IF l_serial_control_code IN(2, 5) THEN
2244: fnd_message.set_name('INV', 'INV_FIELD_INVALID');
2245: fnd_message.set_token('ENTITY1', 'SERIAL_CONTROL', TRUE);
2246: fnd_msg_pub.ADD;
2247: RAISE fnd_api.g_exc_error;
2248: END IF;
2249:
2250: -- Get the primary quantity
2251: l_primary_quantity :=
2263: fnd_message.set_name('INV', 'INV-CANNOT CONVERT');
2264: fnd_message.set_token('UOM', p_mold_table(i).transaction_uom);
2265: fnd_message.set_token('ROUTINE', 'inv_mo_line_detail_util.update_quantity_allocations');
2266: fnd_msg_pub.ADD;
2267: RAISE fnd_api.g_exc_error;
2268: END IF;
2269:
2270: IF l_lot_control_code = 1
2271: AND l_serial_control_code IN(1, 6) THEN
2315: WHERE ROWID = l_mmtt_rowid;
2316: ELSIF l_mmtt_transaction_quantity < p_mold_table(i).transaction_quantity THEN
2317: fnd_message.set_name('INV', 'INV_QUANTITY_TOO_BIG');
2318: fnd_msg_pub.ADD;
2319: RAISE fnd_api.g_exc_error;
2320: END IF;
2321: ELSIF l_lot_control_code = 2
2322: AND l_serial_control_code IN(1, 6) THEN
2323: -- Lot controlled item
2394: WHERE ROWID = l_mtlt_rowid;
2395: ELSIF l_mtlt_transaction_quantity < p_mold_table(i).transaction_quantity THEN
2396: fnd_message.set_name('INV', 'INV_QUANTITY_TOO_BIG');
2397: fnd_msg_pub.ADD;
2398: RAISE fnd_api.g_exc_error;
2399: END IF;
2400: END IF; -- Type of item control
2401:
2402: i := p_mold_table.NEXT(i);
2451: -- Get message count and data
2452: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2453: EXCEPTION
2454: WHEN TOO_MANY_ROWS THEN
2455: x_return_status := fnd_api.g_ret_sts_error;
2456: fnd_message.set_name('INV', 'INV_MGD_MVT_TOO_MANY_TRANS');
2457: fnd_msg_pub.ADD;
2458: ROLLBACK TO update_qty;
2459: WHEN NO_DATA_FOUND THEN
2456: fnd_message.set_name('INV', 'INV_MGD_MVT_TOO_MANY_TRANS');
2457: fnd_msg_pub.ADD;
2458: ROLLBACK TO update_qty;
2459: WHEN NO_DATA_FOUND THEN
2460: x_return_status := fnd_api.g_ret_sts_error;
2461: fnd_message.set_name('INV', 'INV_NO_RECORDS');
2462: fnd_message.set_token('ENTITY', l_current_table);
2463: fnd_msg_pub.ADD;
2464: -- Get message count and data
2463: fnd_msg_pub.ADD;
2464: -- Get message count and data
2465: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2466: ROLLBACK TO update_qty;
2467: WHEN fnd_api.g_exc_error THEN
2468: x_return_status := fnd_api.g_ret_sts_error;
2469: -- Get message count and data
2470: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2471: ROLLBACK TO update_qty;
2464: -- Get message count and data
2465: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2466: ROLLBACK TO update_qty;
2467: WHEN fnd_api.g_exc_error THEN
2468: x_return_status := fnd_api.g_ret_sts_error;
2469: -- Get message count and data
2470: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2471: ROLLBACK TO update_qty;
2472: WHEN fnd_api.g_exc_unexpected_error THEN
2468: x_return_status := fnd_api.g_ret_sts_error;
2469: -- Get message count and data
2470: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2471: ROLLBACK TO update_qty;
2472: WHEN fnd_api.g_exc_unexpected_error THEN
2473: x_return_status := fnd_api.g_ret_sts_unexp_error;
2474: -- Get message count and data
2475: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2476: ROLLBACK TO update_qty;
2469: -- Get message count and data
2470: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2471: ROLLBACK TO update_qty;
2472: WHEN fnd_api.g_exc_unexpected_error THEN
2473: x_return_status := fnd_api.g_ret_sts_unexp_error;
2474: -- Get message count and data
2475: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2476: ROLLBACK TO update_qty;
2477: WHEN OTHERS THEN
2474: -- Get message count and data
2475: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2476: ROLLBACK TO update_qty;
2477: WHEN OTHERS THEN
2478: x_return_status := fnd_api.g_ret_sts_unexp_error;
2479: -- Get message count and data
2480: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2481: ROLLBACK TO update_qty;
2482: END;
2497: SELECT transaction_temp_id
2498: FROM mtl_material_transactions_temp
2499: WHERE (p_transaction_temp_id IS NOT NULL AND transaction_temp_id = p_transaction_temp_id);
2500: BEGIN
2501: x_return_status := fnd_api.g_ret_sts_success;
2502: IF p_mo_line_id IS NULL AND p_transaction_temp_id IS NULL THEN
2503: debug('Either Move Order Line ID or Transaction Temp ID has to be passed','DELETE_ALLOCATIONS');
2504: fnd_message.set_name('INV','INV_MISSING_REQUIRED_PARAMETER');
2505: fnd_msg_pub.ADD;
2502: IF p_mo_line_id IS NULL AND p_transaction_temp_id IS NULL THEN
2503: debug('Either Move Order Line ID or Transaction Temp ID has to be passed','DELETE_ALLOCATIONS');
2504: fnd_message.set_name('INV','INV_MISSING_REQUIRED_PARAMETER');
2505: fnd_msg_pub.ADD;
2506: RAISE fnd_api.g_exc_error;
2507: END IF;
2508:
2509: FOR l_mmtt IN c_mmtt_info LOOP
2510: inv_trx_util_pub.delete_transaction(
2514: , p_transaction_temp_id => l_mmtt.transaction_temp_id
2515: );
2516: END LOOP;
2517: EXCEPTION
2518: WHEN fnd_api.g_exc_error THEN
2519: x_return_status := fnd_api.g_ret_sts_error;
2520: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2521: WHEN fnd_api.g_exc_unexpected_error THEN
2522: x_return_status := fnd_api.g_ret_sts_unexp_error;
2515: );
2516: END LOOP;
2517: EXCEPTION
2518: WHEN fnd_api.g_exc_error THEN
2519: x_return_status := fnd_api.g_ret_sts_error;
2520: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2521: WHEN fnd_api.g_exc_unexpected_error THEN
2522: x_return_status := fnd_api.g_ret_sts_unexp_error;
2523: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2517: EXCEPTION
2518: WHEN fnd_api.g_exc_error THEN
2519: x_return_status := fnd_api.g_ret_sts_error;
2520: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2521: WHEN fnd_api.g_exc_unexpected_error THEN
2522: x_return_status := fnd_api.g_ret_sts_unexp_error;
2523: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2524: WHEN OTHERS THEN
2525: x_return_status := fnd_api.g_ret_sts_unexp_error;
2518: WHEN fnd_api.g_exc_error THEN
2519: x_return_status := fnd_api.g_ret_sts_error;
2520: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2521: WHEN fnd_api.g_exc_unexpected_error THEN
2522: x_return_status := fnd_api.g_ret_sts_unexp_error;
2523: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2524: WHEN OTHERS THEN
2525: x_return_status := fnd_api.g_ret_sts_unexp_error;
2526: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2521: WHEN fnd_api.g_exc_unexpected_error THEN
2522: x_return_status := fnd_api.g_ret_sts_unexp_error;
2523: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2524: WHEN OTHERS THEN
2525: x_return_status := fnd_api.g_ret_sts_unexp_error;
2526: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2527: END delete_allocations;
2528:
2529: PROCEDURE reduce_allocation_quantity(
2715: inv_convert.inv_um_convert(l_inventory_item_id, 5, l_new_lot_quantity, l_transaction_uom_code
2716: , l_primary_uom_code, NULL, NULL);
2717:
2718: IF l_new_prim_quantity = -99999 THEN
2719: RAISE fnd_api.g_exc_error;
2720: END IF;
2721:
2722: UPDATE mtl_transaction_lots_temp
2723: SET transaction_quantity = l_new_lot_quantity
2733: inv_convert.inv_um_convert(l_inventory_item_id, 5, l_new_quantity, l_transaction_uom_code, l_primary_uom_code
2734: , NULL, NULL);
2735:
2736: IF l_new_prim_quantity = -99999 THEN
2737: RAISE fnd_api.g_exc_error;
2738: END IF;
2739:
2740: UPDATE mtl_material_transactions_temp
2741: SET transaction_quantity = l_new_quantity
2741: SET transaction_quantity = l_new_quantity
2742: , primary_quantity = l_new_prim_quantity
2743: WHERE transaction_temp_id = p_transaction_temp_id;
2744:
2745: x_return_status := fnd_api.g_ret_sts_success;
2746: EXCEPTION
2747: WHEN OTHERS THEN
2748: ROLLBACK TO reduce_sp;
2749: x_return_status := fnd_api.g_ret_sts_unexp_error;
2745: x_return_status := fnd_api.g_ret_sts_success;
2746: EXCEPTION
2747: WHEN OTHERS THEN
2748: ROLLBACK TO reduce_sp;
2749: x_return_status := fnd_api.g_ret_sts_unexp_error;
2750: END reduce_allocation_quantity;
2751:
2752: /* Bug 2427514: To get the Lot Qty for a Given Transaction Temp ID */
2753: PROCEDURE get_lot_quantity(
2771: FETCH lot_records INTO l_lot_quantity;
2772: CLOSE lot_records;
2773: x_lot_quantity := l_lot_quantity;
2774: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2775: x_return_status := fnd_api.g_ret_sts_success;
2776: EXCEPTION
2777: WHEN fnd_api.g_exc_error THEN
2778: x_lot_quantity := 0;
2779: x_return_status := fnd_api.g_ret_sts_error;
2773: x_lot_quantity := l_lot_quantity;
2774: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2775: x_return_status := fnd_api.g_ret_sts_success;
2776: EXCEPTION
2777: WHEN fnd_api.g_exc_error THEN
2778: x_lot_quantity := 0;
2779: x_return_status := fnd_api.g_ret_sts_error;
2780: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2781: WHEN fnd_api.g_exc_unexpected_error THEN
2775: x_return_status := fnd_api.g_ret_sts_success;
2776: EXCEPTION
2777: WHEN fnd_api.g_exc_error THEN
2778: x_lot_quantity := 0;
2779: x_return_status := fnd_api.g_ret_sts_error;
2780: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2781: WHEN fnd_api.g_exc_unexpected_error THEN
2782: x_lot_quantity := 0;
2783: x_return_status := fnd_api.g_ret_sts_unexp_error;
2777: WHEN fnd_api.g_exc_error THEN
2778: x_lot_quantity := 0;
2779: x_return_status := fnd_api.g_ret_sts_error;
2780: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2781: WHEN fnd_api.g_exc_unexpected_error THEN
2782: x_lot_quantity := 0;
2783: x_return_status := fnd_api.g_ret_sts_unexp_error;
2784: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2785: WHEN OTHERS THEN
2779: x_return_status := fnd_api.g_ret_sts_error;
2780: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2781: WHEN fnd_api.g_exc_unexpected_error THEN
2782: x_lot_quantity := 0;
2783: x_return_status := fnd_api.g_ret_sts_unexp_error;
2784: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2785: WHEN OTHERS THEN
2786: x_lot_quantity := 0;
2787: x_return_status := fnd_api.g_ret_sts_unexp_error;
2783: x_return_status := fnd_api.g_ret_sts_unexp_error;
2784: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2785: WHEN OTHERS THEN
2786: x_lot_quantity := 0;
2787: x_return_status := fnd_api.g_ret_sts_unexp_error;
2788:
2789: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2790: fnd_msg_pub.add_exc_msg(g_pkg_name, l_procedure_name);
2791: END IF;
2815: FETCH serial_records INTO l_serial_quantity;
2816: CLOSE serial_records;
2817: x_serial_quantity := l_serial_quantity;
2818: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2819: x_return_status := fnd_api.g_ret_sts_success;
2820: EXCEPTION
2821: WHEN fnd_api.g_exc_error THEN
2822: x_serial_quantity := 0;
2823: x_return_status := fnd_api.g_ret_sts_error;
2817: x_serial_quantity := l_serial_quantity;
2818: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2819: x_return_status := fnd_api.g_ret_sts_success;
2820: EXCEPTION
2821: WHEN fnd_api.g_exc_error THEN
2822: x_serial_quantity := 0;
2823: x_return_status := fnd_api.g_ret_sts_error;
2824: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2825: WHEN fnd_api.g_exc_unexpected_error THEN
2819: x_return_status := fnd_api.g_ret_sts_success;
2820: EXCEPTION
2821: WHEN fnd_api.g_exc_error THEN
2822: x_serial_quantity := 0;
2823: x_return_status := fnd_api.g_ret_sts_error;
2824: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2825: WHEN fnd_api.g_exc_unexpected_error THEN
2826: x_serial_quantity := 0;
2827: x_return_status := fnd_api.g_ret_sts_unexp_error;
2821: WHEN fnd_api.g_exc_error THEN
2822: x_serial_quantity := 0;
2823: x_return_status := fnd_api.g_ret_sts_error;
2824: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2825: WHEN fnd_api.g_exc_unexpected_error THEN
2826: x_serial_quantity := 0;
2827: x_return_status := fnd_api.g_ret_sts_unexp_error;
2828: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2829: WHEN OTHERS THEN
2823: x_return_status := fnd_api.g_ret_sts_error;
2824: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2825: WHEN fnd_api.g_exc_unexpected_error THEN
2826: x_serial_quantity := 0;
2827: x_return_status := fnd_api.g_ret_sts_unexp_error;
2828: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2829: WHEN OTHERS THEN
2830: x_serial_quantity := 0;
2831: x_return_status := fnd_api.g_ret_sts_unexp_error;
2827: x_return_status := fnd_api.g_ret_sts_unexp_error;
2828: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2829: WHEN OTHERS THEN
2830: x_serial_quantity := 0;
2831: x_return_status := fnd_api.g_ret_sts_unexp_error;
2832:
2833: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2834: fnd_msg_pub.add_exc_msg(g_pkg_name, l_procedure_name);
2835: END IF;
2871: l_temp_quantity NUMBER := 0;
2872: l_lot_control_code NUMBER := 1;
2873: l_serial_number_control_code NUMBER := 1;
2874: l_serial_transaction_temp_id NUMBER;
2875: l_return_status VARCHAR2(10) := fnd_api.g_ret_sts_unexp_error;
2876: l_msg_data VARCHAR2(1000);
2877: l_msg_count NUMBER := 0;
2878: l_lot_number mtl_lot_numbers.lot_number%TYPE;
2879: l_lot_expiration_date DATE;
2890: CLOSE item_properties;
2891:
2892: /* Changed for 2462679 */
2893: IF l_lot_control_code = 1 AND l_serial_number_control_code IN(1, 6) THEN
2894: x_return_status := fnd_api.g_ret_sts_success;
2895: GOTO success;
2896: END IF;
2897:
2898: /*
2910: l_lot_quantity := l_quantity;
2911: ELSE
2912: get_lot_quantity(l_return_status, l_msg_data, l_msg_count, p_transaction_temp_id, l_lot_quantity);
2913:
2914: IF l_return_status = fnd_api.g_ret_sts_error THEN
2915: RAISE fnd_api.g_exc_error;
2916: END IF;
2917:
2918: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2911: ELSE
2912: get_lot_quantity(l_return_status, l_msg_data, l_msg_count, p_transaction_temp_id, l_lot_quantity);
2913:
2914: IF l_return_status = fnd_api.g_ret_sts_error THEN
2915: RAISE fnd_api.g_exc_error;
2916: END IF;
2917:
2918: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2919: RAISE fnd_api.g_exc_unexpected_error;
2914: IF l_return_status = fnd_api.g_ret_sts_error THEN
2915: RAISE fnd_api.g_exc_error;
2916: END IF;
2917:
2918: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2919: RAISE fnd_api.g_exc_unexpected_error;
2920: END IF;
2921: END IF;
2922:
2915: RAISE fnd_api.g_exc_error;
2916: END IF;
2917:
2918: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2919: RAISE fnd_api.g_exc_unexpected_error;
2920: END IF;
2921: END IF;
2922:
2923: IF l_lot_quantity <> l_quantity THEN
2920: END IF;
2921: END IF;
2922:
2923: IF l_lot_quantity <> l_quantity THEN
2924: RAISE fnd_api.g_exc_error;
2925: ELSE
2926: GOTO success;
2927: END IF;
2928: END IF;
2934: /* Changed for 2462679 */
2935: IF l_lot_control_code = 1 AND l_serial_number_control_code NOT IN(1, 6) THEN
2936: get_serial_quantity(l_return_status, l_msg_data, l_msg_count, p_transaction_temp_id, l_serial_quantity);
2937:
2938: IF l_return_status = fnd_api.g_ret_sts_error THEN
2939: RAISE fnd_api.g_exc_error;
2940: END IF;
2941:
2942: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2935: IF l_lot_control_code = 1 AND l_serial_number_control_code NOT IN(1, 6) THEN
2936: get_serial_quantity(l_return_status, l_msg_data, l_msg_count, p_transaction_temp_id, l_serial_quantity);
2937:
2938: IF l_return_status = fnd_api.g_ret_sts_error THEN
2939: RAISE fnd_api.g_exc_error;
2940: END IF;
2941:
2942: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2943: RAISE fnd_api.g_exc_unexpected_error;
2938: IF l_return_status = fnd_api.g_ret_sts_error THEN
2939: RAISE fnd_api.g_exc_error;
2940: END IF;
2941:
2942: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2943: RAISE fnd_api.g_exc_unexpected_error;
2944: END IF;
2945:
2946: /*Bug 6790396 added nvl to l_serial_quantity*/
2939: RAISE fnd_api.g_exc_error;
2940: END IF;
2941:
2942: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2943: RAISE fnd_api.g_exc_unexpected_error;
2944: END IF;
2945:
2946: /*Bug 6790396 added nvl to l_serial_quantity*/
2947: IF NVL(l_serial_quantity,0) <> l_quantity THEN
2944: END IF;
2945:
2946: /*Bug 6790396 added nvl to l_serial_quantity*/
2947: IF NVL(l_serial_quantity,0) <> l_quantity THEN
2948: RAISE fnd_api.g_exc_error;
2949: ELSE
2950: GOTO success;
2951: END IF;
2952: END IF;
2956: ** Allocated Serials for each Lot must match transaction quantity of each lot
2957: ** Sum of all allocated lots must match transaction quantity
2958: */
2959: IF l_lot_number IS NOT NULL THEN
2960: x_return_status := fnd_api.g_ret_sts_success;
2961: GOTO success;
2962: END IF;
2963:
2964: OPEN lot_records(p_transaction_temp_id);
2967: FETCH lot_records INTO l_serial_transaction_temp_id, l_lot_quantity;
2968: EXIT WHEN lot_records%NOTFOUND;
2969: get_serial_quantity(l_return_status, l_msg_data, l_msg_count, l_serial_transaction_temp_id, l_serial_quantity);
2970:
2971: IF l_return_status = fnd_api.g_ret_sts_error THEN
2972: RAISE fnd_api.g_exc_error;
2973: END IF;
2974:
2975: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2968: EXIT WHEN lot_records%NOTFOUND;
2969: get_serial_quantity(l_return_status, l_msg_data, l_msg_count, l_serial_transaction_temp_id, l_serial_quantity);
2970:
2971: IF l_return_status = fnd_api.g_ret_sts_error THEN
2972: RAISE fnd_api.g_exc_error;
2973: END IF;
2974:
2975: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2976: RAISE fnd_api.g_exc_unexpected_error;
2971: IF l_return_status = fnd_api.g_ret_sts_error THEN
2972: RAISE fnd_api.g_exc_error;
2973: END IF;
2974:
2975: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2976: RAISE fnd_api.g_exc_unexpected_error;
2977: END IF;
2978:
2979: /*Bug 6790396 added nvl to l_serial_quantity*/
2972: RAISE fnd_api.g_exc_error;
2973: END IF;
2974:
2975: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2976: RAISE fnd_api.g_exc_unexpected_error;
2977: END IF;
2978:
2979: /*Bug 6790396 added nvl to l_serial_quantity*/
2980: IF NVL(l_serial_quantity,0) <> l_lot_quantity THEN
2977: END IF;
2978:
2979: /*Bug 6790396 added nvl to l_serial_quantity*/
2980: IF NVL(l_serial_quantity,0) <> l_lot_quantity THEN
2981: RAISE fnd_api.g_exc_error;
2982: ELSE
2983: l_temp_quantity := l_temp_quantity + l_lot_quantity;
2984: END IF;
2985: END LOOP;
2986:
2987: CLOSE lot_records;
2988:
2989: IF (l_temp_quantity <> l_quantity) THEN
2990: RAISE fnd_api.g_exc_error;
2991: END IF;
2992:
2993: <
2994: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2991: END IF;
2992:
2993: <
2994: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2995: x_return_status := fnd_api.g_ret_sts_success;
2996: EXCEPTION
2997: WHEN fnd_api.g_exc_error THEN
2998: x_return_status := fnd_api.g_ret_sts_error;
2999: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2993: <
2994: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2995: x_return_status := fnd_api.g_ret_sts_success;
2996: EXCEPTION
2997: WHEN fnd_api.g_exc_error THEN
2998: x_return_status := fnd_api.g_ret_sts_error;
2999: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3000: WHEN fnd_api.g_exc_unexpected_error THEN
3001: x_return_status := fnd_api.g_ret_sts_unexp_error;
2994: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2995: x_return_status := fnd_api.g_ret_sts_success;
2996: EXCEPTION
2997: WHEN fnd_api.g_exc_error THEN
2998: x_return_status := fnd_api.g_ret_sts_error;
2999: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3000: WHEN fnd_api.g_exc_unexpected_error THEN
3001: x_return_status := fnd_api.g_ret_sts_unexp_error;
3002: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2996: EXCEPTION
2997: WHEN fnd_api.g_exc_error THEN
2998: x_return_status := fnd_api.g_ret_sts_error;
2999: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3000: WHEN fnd_api.g_exc_unexpected_error THEN
3001: x_return_status := fnd_api.g_ret_sts_unexp_error;
3002: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3003: WHEN OTHERS THEN
3004: x_return_status := fnd_api.g_ret_sts_unexp_error;
2997: WHEN fnd_api.g_exc_error THEN
2998: x_return_status := fnd_api.g_ret_sts_error;
2999: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3000: WHEN fnd_api.g_exc_unexpected_error THEN
3001: x_return_status := fnd_api.g_ret_sts_unexp_error;
3002: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3003: WHEN OTHERS THEN
3004: x_return_status := fnd_api.g_ret_sts_unexp_error;
3005:
3000: WHEN fnd_api.g_exc_unexpected_error THEN
3001: x_return_status := fnd_api.g_ret_sts_unexp_error;
3002: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3003: WHEN OTHERS THEN
3004: x_return_status := fnd_api.g_ret_sts_unexp_error;
3005:
3006: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3007: fnd_msg_pub.add_exc_msg(g_pkg_name, l_procedure_name);
3008: END IF;
3038: EXIT WHEN mmtt_records%NOTFOUND;
3039: l_detail_records_exist := TRUE;
3040: are_allocations_complete(l_return_status, l_msg_count, l_msg_data, l_transaction_temp_id);
3041:
3042: IF l_return_status = fnd_api.g_ret_sts_error THEN
3043: RAISE fnd_api.g_exc_error;
3044: END IF;
3045:
3046: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
3039: l_detail_records_exist := TRUE;
3040: are_allocations_complete(l_return_status, l_msg_count, l_msg_data, l_transaction_temp_id);
3041:
3042: IF l_return_status = fnd_api.g_ret_sts_error THEN
3043: RAISE fnd_api.g_exc_error;
3044: END IF;
3045:
3046: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
3047: RAISE fnd_api.g_exc_unexpected_error;
3042: IF l_return_status = fnd_api.g_ret_sts_error THEN
3043: RAISE fnd_api.g_exc_error;
3044: END IF;
3045:
3046: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
3047: RAISE fnd_api.g_exc_unexpected_error;
3048: END IF;
3049: END LOOP;
3050:
3043: RAISE fnd_api.g_exc_error;
3044: END IF;
3045:
3046: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
3047: RAISE fnd_api.g_exc_unexpected_error;
3048: END IF;
3049: END LOOP;
3050:
3051: IF NOT l_detail_records_exist THEN
3048: END IF;
3049: END LOOP;
3050:
3051: IF NOT l_detail_records_exist THEN
3052: RAISE fnd_api.g_exc_unexpected_error;
3053: END IF;
3054:
3055: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3056: x_return_status := fnd_api.g_ret_sts_success;
3052: RAISE fnd_api.g_exc_unexpected_error;
3053: END IF;
3054:
3055: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3056: x_return_status := fnd_api.g_ret_sts_success;
3057: EXCEPTION
3058: WHEN fnd_api.g_exc_error THEN
3059: x_return_status := fnd_api.g_ret_sts_error;
3060: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3054:
3055: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3056: x_return_status := fnd_api.g_ret_sts_success;
3057: EXCEPTION
3058: WHEN fnd_api.g_exc_error THEN
3059: x_return_status := fnd_api.g_ret_sts_error;
3060: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3061: WHEN fnd_api.g_exc_unexpected_error THEN
3062: x_return_status := fnd_api.g_ret_sts_unexp_error;
3055: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3056: x_return_status := fnd_api.g_ret_sts_success;
3057: EXCEPTION
3058: WHEN fnd_api.g_exc_error THEN
3059: x_return_status := fnd_api.g_ret_sts_error;
3060: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3061: WHEN fnd_api.g_exc_unexpected_error THEN
3062: x_return_status := fnd_api.g_ret_sts_unexp_error;
3063: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3057: EXCEPTION
3058: WHEN fnd_api.g_exc_error THEN
3059: x_return_status := fnd_api.g_ret_sts_error;
3060: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3061: WHEN fnd_api.g_exc_unexpected_error THEN
3062: x_return_status := fnd_api.g_ret_sts_unexp_error;
3063: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3064: WHEN OTHERS THEN
3065: x_return_status := fnd_api.g_ret_sts_unexp_error;
3058: WHEN fnd_api.g_exc_error THEN
3059: x_return_status := fnd_api.g_ret_sts_error;
3060: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3061: WHEN fnd_api.g_exc_unexpected_error THEN
3062: x_return_status := fnd_api.g_ret_sts_unexp_error;
3063: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3064: WHEN OTHERS THEN
3065: x_return_status := fnd_api.g_ret_sts_unexp_error;
3066:
3061: WHEN fnd_api.g_exc_unexpected_error THEN
3062: x_return_status := fnd_api.g_ret_sts_unexp_error;
3063: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3064: WHEN OTHERS THEN
3065: x_return_status := fnd_api.g_ret_sts_unexp_error;
3066:
3067: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3068: fnd_msg_pub.add_exc_msg(g_pkg_name, l_procedure_name);
3069: END IF;