131: , p_secondary_uom_code IN VARCHAR2
132: , x_return_status OUT NOCOPY VARCHAR2
133: ) IS
134: BEGIN
135: x_return_status := FND_API.G_RET_STS_SUCCESS;
136:
137: IF g_mti_tbl.COUNT > 0 THEN
138: g_mti_tbl.DELETE;
139: END IF;
165: g_mti_tbl(0).secondary_uom_code := p_secondary_uom_code;
166:
167: EXCEPTION
168: WHEN OTHERS THEN
169: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
170: IF (l_debug = 1) THEN
171: mydebug('WHEN OTHERS exception : '||SQLERRM, 'GET_TXN_ID');
172: END IF;
173: END assign_mti_rec;
216: , p_secondary_uom_code IN VARCHAR2
217: , x_return_status OUT NOCOPY VARCHAR2
218: ) IS
219: BEGIN
220: x_return_status := FND_API.G_RET_STS_SUCCESS;
221:
222: IF g_mmtt_tbl.COUNT > 0 THEN
223: g_mmtt_tbl.DELETE;
224: END IF;
250: g_mmtt_tbl(0).secondary_uom_code := p_secondary_uom_code;
251:
252: EXCEPTION
253: WHEN OTHERS THEN
254: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
255: IF (l_debug = 1) THEN
256: mydebug('WHEN OTHERS exception : '||SQLERRM, 'GET_TXN_ID');
257: END IF;
258: END assign_mmtt_rec;
340: ) IS
341: PRAGMA AUTONOMOUS_TRANSACTION; /* Bug# 13028193 Added PRAGMA to get the actual value from DB as changes in session not yet reflected */
342: orig_date DATE;
343: BEGIN
344: x_return_status := FND_API.G_RET_STS_SUCCESS;
345: BEGIN /*begin segment 2 */
346: SELECT origination_date
347: INTO x_orig_date
348: FROM mtl_lot_numbers
370: END;
371: EXCEPTION
372: WHEN OTHERS THEN
373: x_orig_date := NULL;
374: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
375: END get_origination_date;
376:
377: --Bug 13992231,Get origination_date from session level.
378: PROCEDURE get_origination_date_session
384: ) IS
385: --PRAGMA AUTONOMOUS_TRANSACTION; --Comment PRAGMA AUTONOMOUS_TRANSACTION,For some cases,We need get origination date from sesson level.
386: orig_date DATE;
387: BEGIN
388: x_return_status := FND_API.G_RET_STS_SUCCESS;
389: BEGIN /*begin segment 2 */
390: SELECT origination_date
391: INTO x_orig_date
392: FROM mtl_lot_numbers
414: END;
415: EXCEPTION
416: WHEN OTHERS THEN
417: x_orig_date := NULL;
418: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
419: END get_origination_date_session;
420:
421: -- bug#6073680 START
422: -- Procedure to determine if lot is an existing lot.
429: ,x_return_status OUT NOCOPY VARCHAR2
430: ) IS
431: l_lot_exists NUMBER;
432: BEGIN
433: x_return_status := FND_API.G_RET_STS_SUCCESS;
434: l_lot_exists := 0;
435: x_lot_exist := 'FALSE';
436: BEGIN /*begin segment 2 */
437: SELECT 1
451: END IF;
452: EXCEPTION
453: WHEN OTHERS THEN
454: x_lot_exist := 'FALSE';
455: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
456: END check_lot_exists;
457: -- bug#6073680 END
458:
459: -- Procedure to return the lot expiration date. This will call the custom lot expiration code.
481: WHERE msi.inventory_item_id = c_inventory_item_id
482: AND msi.organization_id = c_organization_id;
483: BEGIN
484: /* Initialize return status to success */
485: x_return_status := FND_API.G_RET_STS_SUCCESS;
486:
487: IF ((p_table = 1 AND p_mti_trx_rec.inventory_item_id IS NOT NULL
488: AND p_mti_trx_rec.organization_id IS NOT NULL)
489: OR
542:
543:
544: EXCEPTION
545: WHEN OTHERS THEN
546: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
547: IF (l_debug = 1) THEN
548: mydebug('WHEN OTHERS exception : '||SQLERRM, 'GET_TXN_ID');
549: END IF;
550: END get_lot_expiration_date;
647: l_exc_error EXCEPTION;
648: l_exc_unexpected_error EXCEPTION;
649:
650: BEGIN
651: x_return_status := FND_API.G_RET_STS_SUCCESS;
652:
653: /* Populating the variables and calling the overloaded API */
654:
655: l_in_lot_rec.inventory_item_id := p_inventory_item_id;
818: l_in_lot_rec.d_attribute10 := p_d_attribute10;
819: END IF;
820: --END BUG 4748451
821: l_api_version := 1.0;
822: l_init_msg_list := fnd_api.g_false;
823: l_commit := fnd_api.g_false;
824:
825: /* Calling the overloaded procedure */
826: inv_lot_api_pub.Update_Inv_lot(
819: END IF;
820: --END BUG 4748451
821: l_api_version := 1.0;
822: l_init_msg_list := fnd_api.g_false;
823: l_commit := fnd_api.g_false;
824:
825: /* Calling the overloaded procedure */
826: inv_lot_api_pub.Update_Inv_lot(
827: x_return_status => l_return_status
837:
838: IF l_debug = 1 THEN
839: mydebug('Program Update_Inv_lot return ' || l_return_status, 9);
840: END IF;
841: IF l_return_status = fnd_api.g_ret_sts_error THEN
842: IF l_debug = 1 THEN
843: mydebug('Program Update_Inv_lot has failed with a user defined exception', 9);
844: END IF;
845: RAISE l_exc_error;
842: IF l_debug = 1 THEN
843: mydebug('Program Update_Inv_lot has failed with a user defined exception', 9);
844: END IF;
845: RAISE l_exc_error;
846: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
847: IF l_debug = 1 THEN
848: mydebug('Program Update_Inv_lot has failed with a Unexpected exception', 9);
849: END IF;
850: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
854: END IF;
855:
856: EXCEPTION
857: WHEN NO_DATA_FOUND THEN
858: x_return_status := fnd_api.g_ret_sts_error;
859: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
860: if( x_msg_count > 1 ) then
861: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
862: end if;
855:
856: EXCEPTION
857: WHEN NO_DATA_FOUND THEN
858: x_return_status := fnd_api.g_ret_sts_error;
859: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
860: if( x_msg_count > 1 ) then
861: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
862: end if;
863: mydebug('Upd Inv Lot Attr: In No data found ' || SQLERRM, 9);
857: WHEN NO_DATA_FOUND THEN
858: x_return_status := fnd_api.g_ret_sts_error;
859: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
860: if( x_msg_count > 1 ) then
861: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
862: end if;
863: mydebug('Upd Inv Lot Attr: In No data found ' || SQLERRM, 9);
864: WHEN l_exc_error THEN
865: x_return_status := fnd_api.g_ret_sts_error;
861: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
862: end if;
863: mydebug('Upd Inv Lot Attr: In No data found ' || SQLERRM, 9);
864: WHEN l_exc_error THEN
865: x_return_status := fnd_api.g_ret_sts_error;
866: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
867: if( x_msg_count > 1 ) then
868: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
869: end if;
862: end if;
863: mydebug('Upd Inv Lot Attr: In No data found ' || SQLERRM, 9);
864: WHEN l_exc_error THEN
865: x_return_status := fnd_api.g_ret_sts_error;
866: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
867: if( x_msg_count > 1 ) then
868: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
869: end if;
870: mydebug('Upd Inv Lot Attr: In l_exc_error ' || SQLERRM, 9);
864: WHEN l_exc_error THEN
865: x_return_status := fnd_api.g_ret_sts_error;
866: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
867: if( x_msg_count > 1 ) then
868: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
869: end if;
870: mydebug('Upd Inv Lot Attr: In l_exc_error ' || SQLERRM, 9);
871: WHEN l_exc_unexpected_error THEN
872: x_return_status := fnd_api.g_ret_sts_unexp_error;
868: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
869: end if;
870: mydebug('Upd Inv Lot Attr: In l_exc_error ' || SQLERRM, 9);
871: WHEN l_exc_unexpected_error THEN
872: x_return_status := fnd_api.g_ret_sts_unexp_error;
873: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
874: if ( x_msg_count > 1 ) then
875: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
876: end if;
869: end if;
870: mydebug('Upd Inv Lot Attr: In l_exc_error ' || SQLERRM, 9);
871: WHEN l_exc_unexpected_error THEN
872: x_return_status := fnd_api.g_ret_sts_unexp_error;
873: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
874: if ( x_msg_count > 1 ) then
875: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
876: end if;
877: mydebug('In l_exc_unexpected_error ' || SQLERRM, 9);
871: WHEN l_exc_unexpected_error THEN
872: x_return_status := fnd_api.g_ret_sts_unexp_error;
873: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
874: if ( x_msg_count > 1 ) then
875: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
876: end if;
877: mydebug('In l_exc_unexpected_error ' || SQLERRM, 9);
878: WHEN OTHERS THEN
879: x_return_status := fnd_api.g_ret_sts_unexp_error;
875: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
876: end if;
877: mydebug('In l_exc_unexpected_error ' || SQLERRM, 9);
878: WHEN OTHERS THEN
879: x_return_status := fnd_api.g_ret_sts_unexp_error;
880: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
881: if( x_msg_count > 1 ) then
882: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
883: end if;
876: end if;
877: mydebug('In l_exc_unexpected_error ' || SQLERRM, 9);
878: WHEN OTHERS THEN
879: x_return_status := fnd_api.g_ret_sts_unexp_error;
880: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
881: if( x_msg_count > 1 ) then
882: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
883: end if;
884: mydebug('Upd Inv Lot Attr: In others ' || SQLERRM, 9);
878: WHEN OTHERS THEN
879: x_return_status := fnd_api.g_ret_sts_unexp_error;
880: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data);
881: if( x_msg_count > 1 ) then
882: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
883: end if;
884: mydebug('Upd Inv Lot Attr: In others ' || SQLERRM, 9);
885: END;
886: