59: x_lot_cont := FALSE ;
60: x_child_lot_cont := FALSE ;
61: x_return_status := fnd_api.g_ret_sts_error;
62:
63: fnd_message.set_name('INV', 'INV_INVALID_ITEM');
64: fnd_msg_pub.ADD;
65: RAISE fnd_api.g_exc_error;
66: ELSE
67: CLOSE c_chk_msi_attr;
252: IF l_return_status = fnd_api.g_ret_sts_error THEN
253: IF g_debug = 1 THEN
254: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with error', 9);
255: END IF;
256: FND_MESSAGE.SET_NAME('INV', 'INV_PROGRAM_ERROR') ;
257: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
258: FND_MSG_PUB.ADD;
259: RAISE fnd_api.g_exc_error;
260: END IF;
253: IF g_debug = 1 THEN
254: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with error', 9);
255: END IF;
256: FND_MESSAGE.SET_NAME('INV', 'INV_PROGRAM_ERROR') ;
257: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
258: FND_MSG_PUB.ADD;
259: RAISE fnd_api.g_exc_error;
260: END IF;
261:
262: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
263: IF g_debug = 1 THEN
264: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with a Unexpected exception', 9);
265: END IF;
266: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
267: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
268: fnd_msg_pub.ADD;
269: RAISE fnd_api.g_exc_unexpected_error;
270: END IF;
263: IF g_debug = 1 THEN
264: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with a Unexpected exception', 9);
265: END IF;
266: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
267: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
268: fnd_msg_pub.ADD;
269: RAISE fnd_api.g_exc_unexpected_error;
270: END IF;
271:
272: IF (l_lot_cont = FALSE) THEN
273: IF g_debug = 1 THEN
274: print_debug(' Item is not lot controlled ', 9);
275: END IF;
276: fnd_message.set_name('INV', 'INV_NO_LOT_CONTROL');
277: fnd_msg_pub.ADD;
278: x_return_status := fnd_api.g_ret_sts_error;
279: RAISE fnd_api.g_exc_error;
280: END IF ;
283:
284: IF g_debug = 1 THEN
285: print_debug(' Item is not Child lot controlled ', 9);
286: END IF;
287: fnd_message.set_name('INV', 'INV_ITEM_CLOT_DISABLE_EXP');
288: fnd_msg_pub.ADD;
289: x_return_status := fnd_api.g_ret_sts_error;
290: RAISE fnd_api.g_exc_error;
291: END IF ;
473: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
474: IF g_debug = 1 THEN
475: print_debug('Program Inv_Lot_Api_Pkg.Set_Msi_Default_Attr has failed with a Unexpected exception', 9);
476: END IF;
477: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
478: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_Lot_Api_Pkg.Set_Msi_Default_Attr');
479: FND_MSG_PUB.ADD;
480: RAISE fnd_api.g_exc_unexpected_error;
481: END IF;
474: IF g_debug = 1 THEN
475: print_debug('Program Inv_Lot_Api_Pkg.Set_Msi_Default_Attr has failed with a Unexpected exception', 9);
476: END IF;
477: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
478: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_Lot_Api_Pkg.Set_Msi_Default_Attr');
479: FND_MSG_PUB.ADD;
480: RAISE fnd_api.g_exc_unexpected_error;
481: END IF;
482: END IF;
513: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
514: IF g_debug = 1 THEN
515: print_debug('Program Inv_lot_api_pub.VALIDATE_CHILD_LOT has failed with a Unexpected exception', 9);
516: END IF;
517: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
518: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pub.VALIDATE_CHILD_LOT');
519: FND_MSG_PUB.ADD;
520: RAISE fnd_api.g_exc_unexpected_error;
521: END IF;
514: IF g_debug = 1 THEN
515: print_debug('Program Inv_lot_api_pub.VALIDATE_CHILD_LOT has failed with a Unexpected exception', 9);
516: END IF;
517: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
518: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pub.VALIDATE_CHILD_LOT');
519: FND_MSG_PUB.ADD;
520: RAISE fnd_api.g_exc_unexpected_error;
521: END IF;
522: END IF ; --parent lot check
539: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
540: IF g_debug = 1 THEN
541: print_debug('Program INV_LOT_API_PKG.VALIDATE_LOT_ATTRIBUTES has failed with a Unexpected exception', 9);
542: END IF;
543: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
544: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_API_PKG.VALIDATE_LOT_ATTRIBUTES');
545: FND_MSG_PUB.ADD;
546: RAISE fnd_api.g_exc_unexpected_error;
547: END IF;
540: IF g_debug = 1 THEN
541: print_debug('Program INV_LOT_API_PKG.VALIDATE_LOT_ATTRIBUTES has failed with a Unexpected exception', 9);
542: END IF;
543: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
544: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_API_PKG.VALIDATE_LOT_ATTRIBUTES');
545: FND_MSG_PUB.ADD;
546: RAISE fnd_api.g_exc_unexpected_error;
547: END IF;
548:
695: IF l_return_status = fnd_api.g_ret_sts_error THEN
696: IF g_debug = 1 THEN
697: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with error', 9);
698: END IF;
699: FND_MESSAGE.SET_NAME('INV', 'INV_PROGRAM_ERROR') ;
700: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
701: FND_MSG_PUB.ADD;
702: RAISE fnd_api.g_exc_error;
703: END IF;
696: IF g_debug = 1 THEN
697: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with error', 9);
698: END IF;
699: FND_MESSAGE.SET_NAME('INV', 'INV_PROGRAM_ERROR') ;
700: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
701: FND_MSG_PUB.ADD;
702: RAISE fnd_api.g_exc_error;
703: END IF;
704:
705: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
706: IF g_debug = 1 THEN
707: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with a Unexpected exception', 9);
708: END IF;
709: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
710: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
711: fnd_msg_pub.ADD;
712: RAISE fnd_api.g_exc_unexpected_error;
713: END IF;
706: IF g_debug = 1 THEN
707: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with a Unexpected exception', 9);
708: END IF;
709: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
710: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
711: fnd_msg_pub.ADD;
712: RAISE fnd_api.g_exc_unexpected_error;
713: END IF;
714:
715: IF (l_lot_cont = FALSE) THEN
716: IF g_debug = 1 THEN
717: print_debug(' Item is not lot controlled ', 9);
718: END IF;
719: fnd_message.set_name('INV', 'INV_NO_LOT_CONTROL');
720: fnd_msg_pub.ADD;
721: x_return_status := fnd_api.g_ret_sts_error;
722: RAISE fnd_api.g_exc_error;
723: END IF ;
726:
727: IF g_debug = 1 THEN
728: print_debug(' Item is not Child lot controlled ', 9);
729: END IF;
730: fnd_message.set_name('INV', 'INV_ITEM_CLOT_DISABLE_EXP');
731: fnd_msg_pub.ADD;
732: x_return_status := fnd_api.g_ret_sts_error;
733: RAISE fnd_api.g_exc_error;
734: END IF ;
825: IF l_return_status <> fnd_api.g_ret_sts_success THEN
826: IF g_debug = 1 THEN
827: print_debug('Program inv_calculate_exp_date.get_lot_expiration_date has failed with a Unexpected exception', 9);
828: END IF;
829: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
830: FND_MESSAGE.SET_TOKEN('PROG_NAME','inv_calculate_exp_date.get_lot_expiration_date');
831: fnd_msg_pub.ADD;
832: RAISE fnd_api.g_exc_unexpected_error;
833: END IF;
826: IF g_debug = 1 THEN
827: print_debug('Program inv_calculate_exp_date.get_lot_expiration_date has failed with a Unexpected exception', 9);
828: END IF;
829: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
830: FND_MESSAGE.SET_TOKEN('PROG_NAME','inv_calculate_exp_date.get_lot_expiration_date');
831: fnd_msg_pub.ADD;
832: RAISE fnd_api.g_exc_unexpected_error;
833: END IF;
834: IF g_debug = 1 THEN
858: IF l_return_status <> fnd_api.g_ret_sts_success THEN
859: IF g_debug = 1 THEN
860: print_debug('Program inv_calculate_exp_date.get_lot_expiration_date has failed with a Unexpected exception', 9);
861: END IF;
862: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
863: FND_MESSAGE.SET_TOKEN('PROG_NAME','inv_calculate_exp_date.get_lot_expiration_date');
864: fnd_msg_pub.ADD;
865: RAISE fnd_api.g_exc_unexpected_error;
866: END IF;
859: IF g_debug = 1 THEN
860: print_debug('Program inv_calculate_exp_date.get_lot_expiration_date has failed with a Unexpected exception', 9);
861: END IF;
862: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
863: FND_MESSAGE.SET_TOKEN('PROG_NAME','inv_calculate_exp_date.get_lot_expiration_date');
864: fnd_msg_pub.ADD;
865: RAISE fnd_api.g_exc_unexpected_error;
866: END IF;
867: IF g_debug = 1 THEN
1198: IF l_return_status = fnd_api.g_ret_sts_error THEN
1199: IF g_debug = 1 THEN
1200: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with error', 9);
1201: END IF;
1202: FND_MESSAGE.SET_NAME('INV', 'INV_PROGRAM_ERROR') ;
1203: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
1204: FND_MSG_PUB.ADD;
1205: RAISE fnd_api.g_exc_error;
1206: END IF;
1199: IF g_debug = 1 THEN
1200: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with error', 9);
1201: END IF;
1202: FND_MESSAGE.SET_NAME('INV', 'INV_PROGRAM_ERROR') ;
1203: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
1204: FND_MSG_PUB.ADD;
1205: RAISE fnd_api.g_exc_error;
1206: END IF;
1207:
1208: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1209: IF g_debug = 1 THEN
1210: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with a Unexpected exception', 9);
1211: END IF;
1212: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1213: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
1214: fnd_msg_pub.ADD;
1215: RAISE fnd_api.g_exc_unexpected_error;
1216: END IF;
1209: IF g_debug = 1 THEN
1210: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with a Unexpected exception', 9);
1211: END IF;
1212: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1213: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
1214: fnd_msg_pub.ADD;
1215: RAISE fnd_api.g_exc_unexpected_error;
1216: END IF;
1217:
1218: IF (l_lot_cont = FALSE) THEN
1219: IF g_debug = 1 THEN
1220: print_debug(' Item is not lot controlled ', 9);
1221: END IF;
1222: fnd_message.set_name('INV', 'INV_NO_LOT_CONTROL');
1223: fnd_msg_pub.ADD;
1224: x_return_status := fnd_api.g_ret_sts_error;
1225: RAISE fnd_api.g_exc_error;
1226: END IF ;
1229:
1230: IF g_debug = 1 THEN
1231: print_debug(' Item is not Child lot controlled ', 9);
1232: END IF;
1233: fnd_message.set_name('INV', 'INV_ITEM_CLOT_DISABLE_EXP');
1234: fnd_msg_pub.ADD;
1235: x_return_status := fnd_api.g_ret_sts_error;
1236: RAISE fnd_api.g_exc_error;
1237: END IF ;
1252: WHERE inventory_item_id = p_inventory_item_id
1253: AND organization_id = p_organization_id;
1254: EXCEPTION
1255: WHEN NO_DATA_FOUND THEN
1256: fnd_message.set_name('INV', 'INV_SHELF_LIFE_ERROR');
1257: fnd_message.set_token('INV', 'ITEM');
1258: fnd_msg_pub.ADD;
1259:
1260: IF g_debug = 1 THEN
1253: AND organization_id = p_organization_id;
1254: EXCEPTION
1255: WHEN NO_DATA_FOUND THEN
1256: fnd_message.set_name('INV', 'INV_SHELF_LIFE_ERROR');
1257: fnd_message.set_token('INV', 'ITEM');
1258: fnd_msg_pub.ADD;
1259:
1260: IF g_debug = 1 THEN
1261: print_debug('Unable to fetch shelf life code for the inventory item passed', 9);
1285: INTO l_expiration_date
1286: FROM DUAL;
1287:
1288: IF TRUNC(l_expiration_date) <> trunc(p_expiration_date) THEN
1289: fnd_message.set_name('INV', 'INV_EXP_DATE_NOT_CONSIDER');
1290: fnd_msg_pub.ADD;
1291: IF g_debug = 1 THEN
1292: print_debug('Expiration will not be considered for shelf_life code of type ITEM_SHELF_LIFE_DAYS', 9);
1293: END IF;
1300: print_debug('Shelf_life code is of type USER_DEFINED_EXP_DATE', 9);
1301: END IF;
1302:
1303: IF p_expiration_date IS NULL THEN
1304: fnd_message.set_name('INV', 'INV_LOT_EXPREQD');
1305: fnd_msg_pub.ADD;
1306:
1307: IF g_debug = 1 THEN
1308: print_debug('The value of expiration date is required ', 9);
1318: IF g_debug = 1 THEN
1319: print_debug('Shelf_life code is of type NO_SHELF_LIFE_CONTROL', 9);
1320: END IF;
1321:
1322: fnd_message.set_name('INV', 'INV_EXP_DATE_NOT_CONSIDER');
1323: fnd_msg_pub.ADD;
1324: END IF; /* l_shelf_life_code = item_shelf_life_days */
1325: END IF; /*p_source NOT IN(OSFM_FORM,OSFM_OPEN_INTERFACE)*/
1326:
1340:
1341:
1342: IF p_lot_attribute_category IS NOT NULL AND
1343: (nvl(l_lot_attribute_category, p_lot_attribute_category) <> p_lot_attribute_category) THEN
1344: FND_MESSAGE.SET_NAME('INV','INV_WRONG_CONTEXT');
1345: FND_MSG_PUB.ADD;
1346: RAISE fnd_api.g_exc_error;
1347: END IF;
1348: END IF ;
1430: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1431: IF g_debug = 1 THEN
1432: print_debug('Program VALIDATE_LOT_ATTR_IN_PARAM has failed with a Unexpected exception', 9);
1433: END IF;
1434: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1435: FND_MESSAGE.SET_TOKEN('PROG_NAME','VALIDATE_LOT_ATTR_IN_PARAM');
1436: fnd_msg_pub.ADD;
1437: RAISE fnd_api.g_exc_unexpected_error;
1438: END IF;
1431: IF g_debug = 1 THEN
1432: print_debug('Program VALIDATE_LOT_ATTR_IN_PARAM has failed with a Unexpected exception', 9);
1433: END IF;
1434: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1435: FND_MESSAGE.SET_TOKEN('PROG_NAME','VALIDATE_LOT_ATTR_IN_PARAM');
1436: fnd_msg_pub.ADD;
1437: RAISE fnd_api.g_exc_unexpected_error;
1438: END IF;
1439:
1469: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1470: IF g_debug = 1 THEN
1471: print_debug('Program VALIDATE_ADDITIONAL_ATTR has failed with a Unexpected exception', 9);
1472: END IF;
1473: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1474: FND_MESSAGE.SET_TOKEN('PROG_NAME','VALIDATE_ADDITIONAL_ATTR');
1475: fnd_msg_pub.ADD;
1476: RAISE fnd_api.g_exc_unexpected_error;
1477: END IF;
1470: IF g_debug = 1 THEN
1471: print_debug('Program VALIDATE_ADDITIONAL_ATTR has failed with a Unexpected exception', 9);
1472: END IF;
1473: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1474: FND_MESSAGE.SET_TOKEN('PROG_NAME','VALIDATE_ADDITIONAL_ATTR');
1475: fnd_msg_pub.ADD;
1476: RAISE fnd_api.g_exc_unexpected_error;
1477: END IF;
1478:
1743: IF l_return_status = fnd_api.g_ret_sts_error THEN
1744: IF g_debug = 1 THEN
1745: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with error', 9);
1746: END IF;
1747: FND_MESSAGE.SET_NAME('INV', 'INV_PROGRAM_ERROR') ;
1748: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
1749: FND_MSG_PUB.ADD;
1750: RAISE fnd_api.g_exc_error;
1751: END IF;
1744: IF g_debug = 1 THEN
1745: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with error', 9);
1746: END IF;
1747: FND_MESSAGE.SET_NAME('INV', 'INV_PROGRAM_ERROR') ;
1748: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
1749: FND_MSG_PUB.ADD;
1750: RAISE fnd_api.g_exc_error;
1751: END IF;
1752:
1753: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1754: IF g_debug = 1 THEN
1755: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with a Unexpected exception', 9);
1756: END IF;
1757: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1758: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
1759: fnd_msg_pub.ADD;
1760: RAISE fnd_api.g_exc_unexpected_error;
1761: END IF;
1754: IF g_debug = 1 THEN
1755: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with a Unexpected exception', 9);
1756: END IF;
1757: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1758: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
1759: fnd_msg_pub.ADD;
1760: RAISE fnd_api.g_exc_unexpected_error;
1761: END IF;
1762:
1763: IF (l_lot_cont = FALSE) THEN
1764: IF g_debug = 1 THEN
1765: print_debug(' Item is not lot controlled ', 9);
1766: END IF;
1767: fnd_message.set_name('INV', 'INV_NO_LOT_CONTROL');
1768: fnd_msg_pub.ADD;
1769: x_return_status := fnd_api.g_ret_sts_error;
1770: RAISE fnd_api.g_exc_error;
1771: END IF ;
1774:
1775: IF g_debug = 1 THEN
1776: print_debug(' Item is not Child lot controlled ', 9);
1777: END IF;
1778: fnd_message.set_name('INV', 'INV_ITEM_CLOT_DISABLE_EXP');
1779: fnd_msg_pub.ADD;
1780: x_return_status := fnd_api.g_ret_sts_error;
1781: RAISE fnd_api.g_exc_error;
1782: END IF ;
1813: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1814: IF g_debug = 1 THEN
1815: print_debug('Program Inv_lot_api_pub.VALIDATE_CHILD_LOT has failed with a Unexpected exception', 9);
1816: END IF;
1817: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1818: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pub.VALIDATE_CHILD_LOT');
1819: fnd_msg_pub.ADD;
1820: RAISE fnd_api.g_exc_unexpected_error;
1821: END IF;
1814: IF g_debug = 1 THEN
1815: print_debug('Program Inv_lot_api_pub.VALIDATE_CHILD_LOT has failed with a Unexpected exception', 9);
1816: END IF;
1817: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1818: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pub.VALIDATE_CHILD_LOT');
1819: fnd_msg_pub.ADD;
1820: RAISE fnd_api.g_exc_unexpected_error;
1821: END IF;
1822:
1824: IF g_debug = 1 THEN
1825: print_debug('Invalid child lot Naming convention', 9);
1826: END IF;
1827:
1828: fnd_message.set_name('INV', 'INV_INVALID_CHILD_LOT_EXP') ;
1829: fnd_msg_pub.ADD;
1830: RAISE fnd_api.g_exc_error;
1831: END IF;
1832: END IF ; -- parent_lot check
1838: IF g_debug = 1 THEN
1839: print_debug('Invalid relationship between parent and child lots', 9);
1840: END IF;
1841:
1842: fnd_message.set_name('INV', 'INV_INVALID_PARENT_LOT_EXP') ;
1843: fnd_msg_pub.ADD;
1844: RAISE fnd_api.g_exc_error;
1845: END IF;
1846: END IF;
1875: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1876: IF g_debug = 1 THEN
1877: print_debug('Program INV_LOT_ATTR_PUB.validate_origination_type has failed with a Unexpected exception', 9);
1878: END IF;
1879: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1880: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_ATTR_PUB. ');
1881: FND_MSG_PUB.ADD;
1882: RAISE fnd_api.g_exc_unexpected_error;
1883: END IF;
1876: IF g_debug = 1 THEN
1877: print_debug('Program INV_LOT_ATTR_PUB.validate_origination_type has failed with a Unexpected exception', 9);
1878: END IF;
1879: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1880: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_ATTR_PUB. ');
1881: FND_MSG_PUB.ADD;
1882: RAISE fnd_api.g_exc_unexpected_error;
1883: END IF;
1884:
1916: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1917: IF g_debug = 1 THEN
1918: print_debug('Program INV_LOT_ATTR_PUB.validate_grade_code has failed with a Unexpected exception', 9);
1919: END IF;
1920: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1921: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_ATTR_PUB. ');
1922: FND_MSG_PUB.ADD;
1923: RAISE fnd_api.g_exc_unexpected_error;
1924: END IF;
1917: IF g_debug = 1 THEN
1918: print_debug('Program INV_LOT_ATTR_PUB.validate_grade_code has failed with a Unexpected exception', 9);
1919: END IF;
1920: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1921: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_ATTR_PUB. ');
1922: FND_MSG_PUB.ADD;
1923: RAISE fnd_api.g_exc_unexpected_error;
1924: END IF;
1925:
1956: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1957: IF g_debug = 1 THEN
1958: print_debug('Program INV_LOT_ATTR_PUB.validate_exp_action_code has failed with a Unexpected exception', 9);
1959: END IF;
1960: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1961: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_ATTR_PUB. ');
1962: FND_MSG_PUB.ADD;
1963: RAISE fnd_api.g_exc_unexpected_error;
1964: END IF;
1957: IF g_debug = 1 THEN
1958: print_debug('Program INV_LOT_ATTR_PUB.validate_exp_action_code has failed with a Unexpected exception', 9);
1959: END IF;
1960: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1961: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_ATTR_PUB. ');
1962: FND_MSG_PUB.ADD;
1963: RAISE fnd_api.g_exc_unexpected_error;
1964: END IF;
1965:
2003: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2004: IF g_debug = 1 THEN
2005: print_debug('Program INV_LOT_ATTR_PUB.validate_exp_action_date has failed with a Unexpected exception', 9);
2006: END IF;
2007: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
2008: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_ATTR_PUB. ');
2009: FND_MSG_PUB.ADD;
2010: RAISE fnd_api.g_exc_unexpected_error;
2011: END IF;
2004: IF g_debug = 1 THEN
2005: print_debug('Program INV_LOT_ATTR_PUB.validate_exp_action_date has failed with a Unexpected exception', 9);
2006: END IF;
2007: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
2008: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_ATTR_PUB. ');
2009: FND_MSG_PUB.ADD;
2010: RAISE fnd_api.g_exc_unexpected_error;
2011: END IF;
2012: END IF ; -- Check for positive expiration action interval
2046: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2047: IF g_debug = 1 THEN
2048: print_debug('Program INV_LOT_ATTR_PUB.validate_retest_date has failed with a Unexpected exception', 9);
2049: END IF;
2050: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
2051: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_ATTR_PUB. ');
2052: FND_MSG_PUB.ADD;
2053: RAISE fnd_api.g_exc_unexpected_error;
2054: END IF;
2047: IF g_debug = 1 THEN
2048: print_debug('Program INV_LOT_ATTR_PUB.validate_retest_date has failed with a Unexpected exception', 9);
2049: END IF;
2050: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
2051: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_ATTR_PUB. ');
2052: FND_MSG_PUB.ADD;
2053: RAISE fnd_api.g_exc_unexpected_error;
2054: END IF;
2055:
2085: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2086: IF g_debug = 1 THEN
2087: print_debug('Program INV_LOT_ATTR_PUB.validate_maturity_date has failed with a Unexpected exception', 9);
2088: END IF;
2089: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
2090: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_ATTR_PUB. ');
2091: FND_MSG_PUB.ADD;
2092: RAISE fnd_api.g_exc_unexpected_error;
2093: END IF;
2086: IF g_debug = 1 THEN
2087: print_debug('Program INV_LOT_ATTR_PUB.validate_maturity_date has failed with a Unexpected exception', 9);
2088: END IF;
2089: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
2090: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_ATTR_PUB. ');
2091: FND_MSG_PUB.ADD;
2092: RAISE fnd_api.g_exc_unexpected_error;
2093: END IF;
2094:
2124: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2125: IF g_debug = 1 THEN
2126: print_debug('Program INV_LOT_ATTR_PUB.validate_hold_date has failed with a Unexpected exception', 9);
2127: END IF;
2128: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
2129: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_ATTR_PUB. ');
2130: FND_MSG_PUB.ADD;
2131: RAISE fnd_api.g_exc_unexpected_error;
2132: END IF;
2125: IF g_debug = 1 THEN
2126: print_debug('Program INV_LOT_ATTR_PUB.validate_hold_date has failed with a Unexpected exception', 9);
2127: END IF;
2128: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
2129: FND_MESSAGE.SET_TOKEN('PROG_NAME','INV_LOT_ATTR_PUB. ');
2130: FND_MSG_PUB.ADD;
2131: RAISE fnd_api.g_exc_unexpected_error;
2132: END IF;
2133:
2223: IF p_organization_id IS NULL THEN
2224: IF g_debug = 1 THEN
2225: print_debug('Value for mandatory field organization id cannot be null.', 9);
2226: END IF;
2227: fnd_message.set_name('INV', 'INV_NULL_ORG_EXP') ;
2228: fnd_msg_pub.ADD;
2229: RAISE fnd_api.g_exc_error;
2230: END IF ;
2231:
2232: IF p_inventory_item_id IS NULL THEN
2233: IF g_debug = 1 THEN
2234: print_debug('Value for mandatory field inventory item id cannot be null.', 9);
2235: END IF;
2236: fnd_message.set_name('INV', 'INV_INVALID_ITEM') ;
2237: fnd_msg_pub.ADD;
2238: RAISE fnd_api.g_exc_error;
2239: END IF ;
2240:
2241: IF p_lot_number IS NULL THEN
2242: IF g_debug = 1 THEN
2243: print_debug('Value for mandatory field Lot Number cannot be null', 9);
2244: END IF;
2245: fnd_message.set_name('INV', 'INV_NULL_CLOT_EXP');
2246: fnd_msg_pub.ADD;
2247: RAISE fnd_api.g_exc_error;
2248: END IF;
2249: /*Basic Validations - End*/
2271: IF l_return_status = fnd_api.g_ret_sts_error THEN
2272: IF g_debug = 1 THEN
2273: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with error', 9);
2274: END IF;
2275: FND_MESSAGE.SET_NAME('INV', 'INV_PROGRAM_ERROR') ;
2276: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
2277: FND_MSG_PUB.ADD;
2278: RAISE fnd_api.g_exc_error;
2279: END IF;
2272: IF g_debug = 1 THEN
2273: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with error', 9);
2274: END IF;
2275: FND_MESSAGE.SET_NAME('INV', 'INV_PROGRAM_ERROR') ;
2276: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
2277: FND_MSG_PUB.ADD;
2278: RAISE fnd_api.g_exc_error;
2279: END IF;
2280:
2281: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2282: IF g_debug = 1 THEN
2283: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with a Unexpected exception', 9);
2284: END IF;
2285: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
2286: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
2287: fnd_msg_pub.ADD;
2288: RAISE fnd_api.g_exc_unexpected_error;
2289: END IF;
2282: IF g_debug = 1 THEN
2283: print_debug('Program Inv_lot_api_pkg.Check_Item_Attributes has failed with a Unexpected exception', 9);
2284: END IF;
2285: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
2286: FND_MESSAGE.SET_TOKEN('PROG_NAME','Inv_lot_api_pkg.Check_Item_Attributes');
2287: fnd_msg_pub.ADD;
2288: RAISE fnd_api.g_exc_unexpected_error;
2289: END IF;
2290:
2291: IF (l_lot_cont = FALSE) THEN
2292: IF g_debug = 1 THEN
2293: print_debug(' Item is not lot controlled ', 9);
2294: END IF;
2295: fnd_message.set_name('INV', 'INV_NO_LOT_CONTROL');
2296: fnd_msg_pub.ADD;
2297: x_return_status := fnd_api.g_ret_sts_error;
2298: RAISE g_exc_error;
2299: END IF ;