48: l_mapping_context VARCHAR2(30);
49:
50: BEGIN
51: SAVEPOINT inv_new_lot;
52: x_return_status := fnd_api.g_ret_sts_success;
53: x_is_new_lot := 'N';
54:
55: BEGIN
56: select lot_number
75: l_in_lot_rec.lot_number := p_lot_number;
76: l_in_lot_rec.parent_lot_number := p_parent_lot_number;
77: l_source := p_source;
78: l_api_version := 1.0;
79: l_init_msg_list := fnd_api.g_false;
80: l_commit := fnd_api.g_false;
81: -- l_validation_level := fnd_api.g_valid_level_full;
82: l_validation_level := fnd_api.g_valid_level_none; -- for testing
83:
76: l_in_lot_rec.parent_lot_number := p_parent_lot_number;
77: l_source := p_source;
78: l_api_version := 1.0;
79: l_init_msg_list := fnd_api.g_false;
80: l_commit := fnd_api.g_false;
81: -- l_validation_level := fnd_api.g_valid_level_full;
82: l_validation_level := fnd_api.g_valid_level_none; -- for testing
83:
84: l_origin_txn_id := NULL;
77: l_source := p_source;
78: l_api_version := 1.0;
79: l_init_msg_list := fnd_api.g_false;
80: l_commit := fnd_api.g_false;
81: -- l_validation_level := fnd_api.g_valid_level_full;
82: l_validation_level := fnd_api.g_valid_level_none; -- for testing
83:
84: l_origin_txn_id := NULL;
85:
78: l_api_version := 1.0;
79: l_init_msg_list := fnd_api.g_false;
80: l_commit := fnd_api.g_false;
81: -- l_validation_level := fnd_api.g_valid_level_full;
82: l_validation_level := fnd_api.g_valid_level_none; -- for testing
83:
84: l_origin_txn_id := NULL;
85:
86: -- copy the lot attributes from the reference lot to the current lot
383:
384: IF g_debug = 1 THEN
385: mydebug('Program Create_Inv_lot return ' || l_return_status);
386: END IF;
387: IF l_return_status = fnd_api.g_ret_sts_error THEN
388: IF g_debug = 1 THEN
389: mydebug('Program Create_Inv_lot has failed with a user defined exception');
390: END IF;
391: RAISE g_exc_error;
388: IF g_debug = 1 THEN
389: mydebug('Program Create_Inv_lot has failed with a user defined exception');
390: END IF;
391: RAISE g_exc_error;
392: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
393: IF g_debug = 1 THEN
394: mydebug('Program Create_Inv_lot has failed with a Unexpected exception');
395: END IF;
396: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
403:
404:
405: EXCEPTION
406: WHEN NO_DATA_FOUND THEN
407: x_return_status := fnd_api.g_ret_sts_error;
408: ROLLBACK TO inv_new_lot;
409: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
410: if( x_msg_count > 1 ) then
411: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
405: EXCEPTION
406: WHEN NO_DATA_FOUND THEN
407: x_return_status := fnd_api.g_ret_sts_error;
408: ROLLBACK TO inv_new_lot;
409: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
410: if( x_msg_count > 1 ) then
411: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
412: end if;
413: mydebug('In No data found ' || SQLERRM);
407: x_return_status := fnd_api.g_ret_sts_error;
408: ROLLBACK TO inv_new_lot;
409: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
410: if( x_msg_count > 1 ) then
411: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
412: end if;
413: mydebug('In No data found ' || SQLERRM);
414: WHEN g_exc_error THEN
415: x_return_status := fnd_api.g_ret_sts_error;
411: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
412: end if;
413: mydebug('In No data found ' || SQLERRM);
414: WHEN g_exc_error THEN
415: x_return_status := fnd_api.g_ret_sts_error;
416: ROLLBACK TO inv_new_lot;
417: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
418: if( x_msg_count > 1 ) then
419: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
413: mydebug('In No data found ' || SQLERRM);
414: WHEN g_exc_error THEN
415: x_return_status := fnd_api.g_ret_sts_error;
416: ROLLBACK TO inv_new_lot;
417: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
418: if( x_msg_count > 1 ) then
419: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
420: end if;
421: mydebug('In g_exc_error ' || SQLERRM);
415: x_return_status := fnd_api.g_ret_sts_error;
416: ROLLBACK TO inv_new_lot;
417: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
418: if( x_msg_count > 1 ) then
419: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
420: end if;
421: mydebug('In g_exc_error ' || SQLERRM);
422: WHEN g_exc_unexpected_error THEN
423: x_return_status := fnd_api.g_ret_sts_unexp_error;
419: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
420: end if;
421: mydebug('In g_exc_error ' || SQLERRM);
422: WHEN g_exc_unexpected_error THEN
423: x_return_status := fnd_api.g_ret_sts_unexp_error;
424: ROLLBACK TO inv_new_lot;
425: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
426: if( x_msg_count > 1 ) then
427: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
421: mydebug('In g_exc_error ' || SQLERRM);
422: WHEN g_exc_unexpected_error THEN
423: x_return_status := fnd_api.g_ret_sts_unexp_error;
424: ROLLBACK TO inv_new_lot;
425: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
426: if( x_msg_count > 1 ) then
427: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
428: end if;
429: mydebug('In g_exc_unexpected_error ' || SQLERRM);
423: x_return_status := fnd_api.g_ret_sts_unexp_error;
424: ROLLBACK TO inv_new_lot;
425: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
426: if( x_msg_count > 1 ) then
427: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
428: end if;
429: mydebug('In g_exc_unexpected_error ' || SQLERRM);
430: WHEN OTHERS THEN
431: x_return_status := fnd_api.g_ret_sts_unexp_error;
427: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
428: end if;
429: mydebug('In g_exc_unexpected_error ' || SQLERRM);
430: WHEN OTHERS THEN
431: x_return_status := fnd_api.g_ret_sts_unexp_error;
432: ROLLBACK TO inv_new_lot;
433: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
434: if( x_msg_count > 1 ) then
435: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
429: mydebug('In g_exc_unexpected_error ' || SQLERRM);
430: WHEN OTHERS THEN
431: x_return_status := fnd_api.g_ret_sts_unexp_error;
432: ROLLBACK TO inv_new_lot;
433: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
434: if( x_msg_count > 1 ) then
435: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
436: end if;
437: mydebug('In others ' || SQLERRM);
431: x_return_status := fnd_api.g_ret_sts_unexp_error;
432: ROLLBACK TO inv_new_lot;
433: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
434: if( x_msg_count > 1 ) then
435: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
436: end if;
437: mydebug('In others ' || SQLERRM);
438:
439: END preprocess_lot;
453: and inventory_item_id = p_inventory_item_id
454: and lot_number = p_lot_number;
455: EXCEPTION
456: WHEN OTHERS THEN
457: x_return_status := fnd_api.g_ret_sts_unexp_error;
458: mydebug('In g_exc_unexpected_error ' || SQLERRM);
459: END delete_lot;
460:
461: