265: SAVEPOINT GENERATE_LPN_PUB;
266:
267: -- Standard call to check for call compatibility.
268: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
269: fnd_message.set_name('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
270: fnd_msg_pub.ADD;
271: RAISE fnd_api.g_exc_unexpected_error;
272: END IF;
273:
296: IF (l_result = inv_validate.f) THEN
297: IF (l_debug = 1) THEN
298: mdebug(p_organization_id || ' is not a valid org id', G_ERROR);
299: END IF;
300: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
301: fnd_msg_pub.ADD;
302: RAISE fnd_api.g_exc_error;
303: END IF;
304:
310: IF (l_result = inv_validate.f) THEN
311: IF (l_debug = 1) THEN
312: mdebug(p_container_item_id || ' is not a valid container item id', 1);
313: END IF;
314: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ITEM');
315: fnd_msg_pub.ADD;
316: RAISE fnd_api.g_exc_error;
317: END IF;
318:
319: IF (l_container_item.container_item_flag = 'N') THEN
320: IF (l_debug = 1) THEN
321: mdebug(p_container_item_id || ' is not a container', 1);
322: END IF;
323: fnd_message.set_name('WMS', 'WMS_CONT_ITEM_NOT_A_CONT');
324: fnd_msg_pub.ADD;
325: RAISE fnd_api.g_exc_error;
326: END IF;
327: END IF;
334: IF (l_result = inv_validate.f) THEN
335: IF (l_debug = 1) THEN
336: mdebug(p_subinventory || ' is not a valid sub', 1);
337: END IF;
338: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SUB');
339: fnd_msg_pub.ADD;
340: RAISE fnd_api.g_exc_error;
341: END IF;
342: END IF;
347: IF (p_locator_id IS NULL) THEN
348: IF (l_debug = 1) THEN
349: mdebug('Generate_LPN is missing required loc', 1);
350: END IF;
351: fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_LOC');
352: fnd_msg_pub.ADD;
353: RAISE fnd_api.g_exc_error;
354: END IF;
355:
359: IF (l_result = inv_validate.f) THEN
360: IF (l_debug = 1) THEN
361: mdebug(p_locator_id || ' is not a valid loc id', 1);
362: END IF;
363: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOC');
364: fnd_msg_pub.ADD;
365: RAISE fnd_api.g_exc_error;
366: END IF;
367: END IF;
376: IF (l_result = inv_validate.f) THEN
377: IF (l_debug = 1) THEN
378: mdebug(p_revision || ' is not a valid rev', 1);
379: END IF;
380: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_REV');
381: fnd_msg_pub.ADD;
382: RAISE fnd_api.g_exc_error;
383: END IF;
384: ELSE
385: --Rev not supported for container items currently. Allow to use rev controlled items
386: IF (l_debug = 1) THEN
387: mdebug('Generate_LPN is missing the rev for rev container item..ok', 1);
388: END IF;
389: --fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_REV');
390: --fnd_msg_pub.ADD;
391: --RAISE fnd_api.g_exc_error;
392: END IF;
393: END IF;
403: IF (l_result = inv_validate.f) THEN
404: IF (l_debug = 1) THEN
405: mdebug(p_lot_number || ' is not a valid lot', 1);
406: END IF;
407: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOT');
408: fnd_msg_pub.ADD;
409: RAISE fnd_api.g_exc_error;
410: END IF;
411: ELSE
412: --Lots not supported for container items currently. Allow to use lot controlled items
413: IF (l_debug = 1) THEN
414: mdebug('Generate_LPN is missing lot for lot container item..ok', 1);
415: END IF;
416: --fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_LOT');
417: --fnd_msg_pub.ADD;
418: --RAISE fnd_api.g_exc_error;
419: END IF;
420: END IF;
428: IF (NOT mtl_serial_check.inv_serial_info(p_from_serial_number, p_to_serial_number, l_prefix, l_quantity_serial, l_from_number, l_to_number, l_errorcode)) THEN
429: IF (l_debug = 1) THEN
430: mdebug(p_to_serial_number || ' failed MTL_Serial_Check', 1);
431: END IF;
432: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SER');
433: fnd_msg_pub.ADD;
434: RAISE fnd_api.g_exc_error;
435: END IF;
436:
440: IF (p_quantity <> l_quantity_serial) THEN
441: IF (l_debug = 1) THEN
442: mdebug(p_quantity || ' does not match sn range qty of ' || l_quantity_serial, 1);
443: END IF;
444: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_X_QTY');
445: fnd_msg_pub.ADD;
446: RAISE fnd_api.g_exc_error;
447: END IF;
448: END IF;
462: IF (l_result = inv_validate.f) THEN
463: IF (l_debug = 1) THEN
464: mdebug(l_current_serial || 'failed validate_serial', 1);
465: END IF;
466: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SER');
467: fnd_msg_pub.ADD;
468: RAISE fnd_api.g_exc_error;
469: END IF;
470: ELSE
476: IF serial_validation_cursor%NOTFOUND THEN
477: IF (l_debug = 1) THEN
478: mdebug(l_current_serial || ' could not be found in MTL_SERIAL_NUMBERS', 1);
479: END IF;
480: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SER');
481: fnd_msg_pub.ADD;
482: RAISE fnd_api.g_exc_error;
483: END IF;
484:
504: --SN not supported for container items currently. Allow to use serial controlled items
505: IF (l_debug = 1) THEN
506: mdebug('Generate_LPN is missing sn for serial container item..ok', 1);
507: END IF;
508: --fnd_message.set_name('WMS', 'WMS_CONT_MISS_SER_NUM');
509: --fnd_msg_pub.ADD;
510: --RAISE fnd_api.g_exc_error;
511: END IF;
512: END IF;
517: IF (p_quantity <= 0) THEN
518: IF (l_debug = 1) THEN
519: mdebug(p_quantity || ' is a negative qty', 1);
520: END IF;
521: fnd_message.set_name('WMS', 'WMS_CONT_NEG_QTY');
522: fnd_msg_pub.ADD;
523: RAISE fnd_api.g_exc_error;
524: END IF;
525:
533: IF (p_source NOT IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) THEN
534: IF (l_debug = 1) THEN
535: mdebug(p_source || ' is an invalid source', 1);
536: END IF;
537: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LPN_CONTEXT');
538: fnd_msg_pub.ADD;
539: RAISE fnd_api.g_exc_error;
540: END IF;
541: END IF;
547: IF (l_result = inv_validate.f) THEN
548: IF (l_debug = 1) THEN
549: mdebug(p_cost_group_id || ' is an invalid cost group id', 1);
550: END IF;
551: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_CST_GRP');
552: fnd_msg_pub.ADD;
553: RAISE fnd_api.g_exc_error;
554: END IF;
555: END IF;
683: SAVEPOINT associate_lpn_pub;
684:
685: -- Standard call to check for call compatibility.
686: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
687: fnd_message.set_name('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
688: fnd_msg_pub.ADD;
689: RAISE fnd_api.g_exc_unexpected_error;
690: END IF;
691:
708: /* Validate all inputs if validation level is set to full */
709: IF (p_validation_level = fnd_api.g_valid_level_full) THEN
710: /* Check that lpn id is given */
711: IF (p_lpn_id IS NULL) THEN
712: fnd_message.set_name('WMS', 'WMS_CONT_LPN_NOT_GIVEN');
713: fnd_msg_pub.ADD;
714: RAISE fnd_api.g_exc_error;
715: END IF;
716:
733: IF (l_result = inv_validate.f) THEN
734: IF (l_debug = 1) THEN
735: mdebug(p_organization_id || ' is an invalid org id', 1);
736: END IF;
737: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
738: fnd_msg_pub.ADD;
739: RAISE fnd_api.g_exc_error;
740: END IF;
741:
747: IF (l_result = inv_validate.f) THEN
748: IF (l_debug = 1) THEN
749: mdebug(p_subinventory || ' is an invalid sub', 1);
750: END IF;
751: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SUB');
752: fnd_msg_pub.ADD;
753: RAISE fnd_api.g_exc_error;
754: END IF;
755: END IF;
757: /* Validate Locator */
758: IF (p_subinventory IS NOT NULL) THEN
759: IF (l_sub.locator_type IN (2, 3)) THEN
760: IF (p_locator_id IS NULL) THEN
761: fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_LOC');
762: fnd_msg_pub.ADD;
763: RAISE fnd_api.g_exc_error;
764: END IF;
765:
769: IF (l_result = inv_validate.f) THEN
770: IF (l_debug = 1) THEN
771: mdebug(p_locator_id || ' is an invalid loc id', 1);
772: END IF;
773: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOC');
774: fnd_msg_pub.ADD;
775: RAISE fnd_api.g_exc_error;
776: END IF;
777: END IF;
786: IF (l_result = inv_validate.f) THEN
787: IF (l_debug = 1) THEN
788: mdebug(p_container_item_id || ' is an invalid container item id', 1);
789: END IF;
790: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ITEM');
791: fnd_msg_pub.ADD;
792: RAISE fnd_api.g_exc_error;
793: END IF;
794:
795: IF (l_container_item.container_item_flag = 'N') THEN
796: IF (l_debug = 1) THEN
797: mdebug(p_container_item_id || ' is not a container item', 1);
798: END IF;
799: fnd_message.set_name('WMS', 'WMS_CONT_ITEM_NOT_A_CONT');
800: fnd_msg_pub.ADD;
801: RAISE fnd_api.g_exc_error;
802: END IF;
803:
819: l_new_weight := l_lpn.gross_weight;
820: l_new_weight_uom := l_lpn.gross_weight_uom_code;
821: END IF;
822: ELSE
823: fnd_message.set_name('WMS', 'WMS_CONT_CONTAINER_NOT_GIVEN');
824: fnd_msg_pub.ADD;
825: RAISE fnd_api.g_exc_error;
826: END IF;
827:
834: IF (l_result = inv_validate.f) THEN
835: IF (l_debug = 1) THEN
836: mdebug(p_revision || ' is an invalid rev', 1);
837: END IF;
838: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_REV');
839: fnd_msg_pub.ADD;
840: RAISE fnd_api.g_exc_error;
841: END IF;
842: ELSE
843: --Rev not supported for container items currently. Allow to use rev controlled items
844: IF (l_debug = 1) THEN
845: mdebug('Associate_LPN is missing the rev for rev container item..ok', 1);
846: END IF;
847: --fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_REV');
848: --fnd_msg_pub.ADD;
849: --RAISE fnd_api.g_exc_error;
850: END IF;
851: END IF;
861: IF (l_result = inv_validate.f) THEN
862: IF (l_debug = 1) THEN
863: mdebug(p_lot_number || ' is not a valid lot', 1);
864: END IF;
865: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOT');
866: fnd_msg_pub.ADD;
867: RAISE fnd_api.g_exc_error;
868: END IF;
869: ELSE
870: --Lots not supported for container items currently. Allow to use lot controlled items
871: IF (l_debug = 1) THEN
872: mdebug('Associate_LPN is missing lot for lot container item..ok', 1);
873: END IF;
874: --fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_LOT');
875: --fnd_msg_pub.ADD;
876: --RAISE fnd_api.g_exc_error;
877: END IF;
878: END IF;
888: IF (l_result = inv_validate.f) THEN
889: IF (l_debug = 1) THEN
890: mdebug(p_serial_number || ' is an invalid sn', 1);
891: END IF;
892: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SER');
893: fnd_msg_pub.ADD;
894: RAISE fnd_api.g_exc_error;
895: END IF;
896: ELSE
897: --SN not supported for container items currently. Allow to use serial controlled items
898: IF (l_debug = 1) THEN
899: mdebug('Associate_LPN is missing sn for serial container item..ok', 1);
900: END IF;
901: --fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_SER');
902: --fnd_msg_pub.ADD;
903: --RAISE fnd_api.g_exc_error;
904: END IF;
905: END IF;
912: IF (l_result = inv_validate.f) THEN
913: IF (l_debug = 1) THEN
914: mdebug(p_cost_group_id || ' is an invalid cg', 1);
915: END IF;
916: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_CST_GRP');
917: fnd_msg_pub.ADD;
918: RAISE fnd_api.g_exc_error;
919: END IF;
920: END IF;
941: l_org.organization_id := p_organization_id;
942: l_result := inv_validate.ORGANIZATION(l_org);
943:
944: IF (l_result = inv_validate.f) THEN
945: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
946: fnd_msg_pub.ADD;
947: RAISE fnd_api.g_exc_error;
948: END IF;
949:
952: l_container_item.inventory_item_id := p_container_item_id;
953: l_result := inv_validate.inventory_item(l_container_item, l_org);
954:
955: IF (l_result = inv_validate.f) THEN
956: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ITEM');
957: fnd_msg_pub.ADD;
958: RAISE fnd_api.g_exc_error;
959: END IF;
960:
958: RAISE fnd_api.g_exc_error;
959: END IF;
960:
961: IF (l_container_item.container_item_flag = 'N') THEN
962: fnd_message.set_name('WMS', 'WMS_CONT_ITEM_NOT_A_CONT');
963: fnd_msg_pub.ADD;
964: RAISE fnd_api.g_exc_error;
965: END IF;
966:
982: l_new_weight := l_lpn.gross_weight;
983: l_new_weight_uom := l_lpn.gross_weight_uom_code;
984: END IF;
985: ELSE
986: fnd_message.set_name('WMS', 'WMS_CONT_CONTAINER_NOT_GIVEN');
987: fnd_msg_pub.ADD;
988: RAISE fnd_api.g_exc_error;
989: END IF;
990: END IF;
1201: SAVEPOINT create_lpn_pub;
1202:
1203: -- Standard call to check for call compatibility.
1204: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
1205: fnd_message.set_name('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
1206: fnd_msg_pub.ADD;
1207: RAISE fnd_api.g_exc_unexpected_error;
1208: END IF;
1209:
1231: IF (l_result = inv_validate.t) THEN
1232: IF (l_debug = 1) THEN
1233: mdebug(p_lpn || ' failed LPN validation', 1);
1234: END IF;
1235: fnd_message.set_name('WMS', 'WMS_CONT_DUPLICATE_LPN');
1236: fnd_msg_pub.ADD;
1237: RAISE fnd_api.g_exc_error;
1238: END IF;
1239:
1246: IF (l_result = inv_validate.t) THEN
1247: IF (l_debug = 1) THEN
1248: mdebug(p_parent_lpn_id || ' parent LPN failed validation', 1);
1249: END IF;
1250: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LPN');
1251: fnd_msg_pub.ADD;
1252: RAISE fnd_api.g_exc_error;
1253: END IF;
1254: END IF;
1260: IF (l_result = inv_validate.f) THEN
1261: IF (l_debug = 1) THEN
1262: mdebug(p_organization_id || ' is an invalid Org', 1);
1263: END IF;
1264: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
1265: fnd_msg_pub.ADD;
1266: RAISE fnd_api.g_exc_error;
1267: END IF;
1268:
1274: IF (l_result = inv_validate.f) THEN
1275: IF (l_debug = 1) THEN
1276: mdebug(p_subinventory || ' Invalid Subinventory', 1);
1277: END IF;
1278: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SUB');
1279: fnd_msg_pub.ADD;
1280: RAISE fnd_api.g_exc_error;
1281: END IF;
1282: END IF;
1287: IF (p_locator_id IS NULL) THEN
1288: IF (l_debug = 1) THEN
1289: mdebug('Missing required locator', 1);
1290: END IF;
1291: fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_LOC');
1292: fnd_msg_pub.ADD;
1293: RAISE fnd_api.g_exc_error;
1294: END IF;
1295:
1299: IF (l_result = inv_validate.f) THEN
1300: IF (l_debug = 1) THEN
1301: mdebug(p_locator_id || ' is an invalid locator', 1);
1302: END IF;
1303: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOC');
1304: fnd_msg_pub.ADD;
1305: RAISE fnd_api.g_exc_error;
1306: END IF;
1307: END IF;
1315: IF (l_result = inv_validate.f) THEN
1316: IF (l_debug = 1) THEN
1317: mdebug(p_container_item_id || ' is an invalid container item', 1);
1318: END IF;
1319: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ITEM');
1320: fnd_msg_pub.ADD;
1321: RAISE fnd_api.g_exc_error;
1322: END IF;
1323:
1324: IF (l_container_item.container_item_flag = 'N') THEN
1325: IF (l_debug = 1) THEN
1326: mdebug(p_container_item_id || ' is not a container', 1);
1327: END IF;
1328: fnd_message.set_name('WMS', 'WMS_CONT_ITEM_NOT_A_CONTAINER');
1329: fnd_msg_pub.ADD;
1330: RAISE fnd_api.g_exc_error;
1331: END IF;
1332: END IF;
1340: IF (l_result = inv_validate.f) THEN
1341: IF (l_debug = 1) THEN
1342: mdebug(p_revision || ' is an invalid Revision', 1);
1343: END IF;
1344: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_REV');
1345: fnd_msg_pub.ADD;
1346: RAISE fnd_api.g_exc_error;
1347: END IF;
1348: ELSE
1349: --Revision not supported for container items currently. Allow to use rev controlled items
1350: IF (l_debug = 1) THEN
1351: mdebug('Generate_LPN is missing rev for lot container item..ok', 1);
1352: END IF;
1353: --fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_REV');
1354: --fnd_msg_pub.ADD;
1355: --RAISE fnd_api.g_exc_error;
1356: END IF;
1357: END IF;
1367: IF (l_result = inv_validate.f) THEN
1368: IF (l_debug = 1) THEN
1369: mdebug(p_lot_number || ' is an invalid lot', 1);
1370: END IF;
1371: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOT');
1372: fnd_msg_pub.ADD;
1373: RAISE fnd_api.g_exc_error;
1374: END IF;
1375: ELSE
1376: --Lots not supported for container items currently. Allow to use lot controlled items
1377: IF (l_debug = 1) THEN
1378: mdebug('Generate_LPN is missing lot for lot container item..ok', 1);
1379: END IF;
1380: fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_LOT');
1381: fnd_msg_pub.ADD;
1382: RAISE fnd_api.g_exc_error;
1383: END IF;
1384: END IF;
1394: IF (l_result = inv_validate.f) THEN
1395: IF (l_debug = 1) THEN
1396: mdebug(l_serial.serial_number || ' is an invalid Serial Number', 1);
1397: END IF;
1398: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SER');
1399: fnd_msg_pub.ADD;
1400: RAISE fnd_api.g_exc_error;
1401: END IF;
1402: ELSE
1403: --SN not supported for container items currently. Allow to use serial controlled items
1404: IF (l_debug = 1) THEN
1405: mdebug('Create_LPN is missing sn for serial container item..ok', 1);
1406: END IF;
1407: --fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_SER');
1408: --fnd_msg_pub.ADD;
1409: --RAISE fnd_api.g_exc_error;
1410: END IF;
1411: END IF;
1416: IF (p_source NOT IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) THEN
1417: IF (l_debug = 1) THEN
1418: mdebug(p_source || 'is an invalid source type', 1);
1419: END IF;
1420: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LPN_CONTEXT');
1421: fnd_msg_pub.ADD;
1422: RAISE fnd_api.g_exc_error;
1423: END IF;
1424: END IF;
1430: IF (l_result = inv_validate.f) THEN
1431: IF (l_debug = 1) THEN
1432: mdebug(p_cost_group_id || 'is an invalid cost group', 1);
1433: END IF;
1434: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_CST_GRP');
1435: fnd_msg_pub.ADD;
1436: RAISE fnd_api.g_exc_error;
1437: END IF;
1438: END IF;
1593: SAVEPOINT modify_lpn_pub;
1594:
1595: -- Standard call to check for call compatibility.
1596: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
1597: fnd_message.set_name('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
1598: fnd_msg_pub.ADD;
1599: RAISE fnd_api.g_exc_unexpected_error;
1600: END IF;
1601:
1615: l_lpn.license_plate_number := NULL;
1616: l_result := validate_lpn(l_lpn);
1617:
1618: IF (l_result = inv_validate.f) THEN
1619: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LPN');
1620: fnd_msg_pub.ADD;
1621: RAISE fnd_api.g_exc_error;
1622: END IF;
1623:
1626: l_org.organization_id := p_lpn.organization_id;
1627: l_result := inv_validate.ORGANIZATION(l_org);
1628:
1629: IF (l_result = inv_validate.f) THEN
1630: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
1631: fnd_msg_pub.ADD;
1632: RAISE fnd_api.g_exc_error;
1633: END IF;
1634: END IF;
1638: l_sub.secondary_inventory_name := p_lpn.subinventory_code;
1639: l_result := inv_validate.subinventory(l_sub, l_org);
1640:
1641: IF (l_result = inv_validate.f) THEN
1642: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SUB');
1643: fnd_msg_pub.ADD;
1644: RAISE fnd_api.g_exc_error;
1645: END IF;
1646: END IF;
1648: /* Validate Locator */
1649: IF (p_lpn.subinventory_code IS NOT NULL) THEN
1650: IF (l_sub.locator_type IN (2, 3)) THEN
1651: IF (p_lpn.locator_id IS NULL) THEN
1652: fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_LOC');
1653: fnd_msg_pub.ADD;
1654: RAISE fnd_api.g_exc_error;
1655: END IF;
1656:
1657: l_locator.inventory_location_id := p_lpn.locator_id;
1658: l_result := inv_validate.validatelocator(l_locator, l_org, l_sub);
1659:
1660: IF (l_result = inv_validate.f) THEN
1661: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOC');
1662: fnd_msg_pub.ADD;
1663: RAISE fnd_api.g_exc_error;
1664: END IF;
1665: END IF;
1670: l_container_item.inventory_item_id := p_lpn.inventory_item_id;
1671: l_result := inv_validate.inventory_item(l_container_item, l_org);
1672:
1673: IF (l_result = inv_validate.f) THEN
1674: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ITEM');
1675: fnd_msg_pub.ADD;
1676: RAISE fnd_api.g_exc_error;
1677: END IF;
1678:
1676: RAISE fnd_api.g_exc_error;
1677: END IF;
1678:
1679: IF (l_container_item.container_item_flag = 'N') THEN
1680: fnd_message.set_name('WMS', 'WMS_CONT_ITEM_NOT_A_CONTAINER');
1681: fnd_msg_pub.ADD;
1682: RAISE fnd_api.g_exc_error;
1683: END IF;
1684: END IF;
1688: IF (p_lpn.gross_weight < 0) THEN
1689: IF (l_debug = 1) THEN
1690: mdebug('gross weight= '|| p_lpn.gross_weight, 9);
1691: END IF;
1692: fnd_message.set_name('WMS', 'WMS_CONT_NEG_WEIGHT');
1693: fnd_msg_pub.ADD;
1694: RAISE fnd_api.g_exc_error;
1695: END IF;
1696: END IF;
1697:
1698: /* Validate Content Volume */
1699: IF (p_lpn.content_volume IS NOT NULL) THEN
1700: IF (p_lpn.content_volume < 0) THEN
1701: fnd_message.set_name('WMS', 'WMS_CONT_NEG_VOLUME');
1702: fnd_msg_pub.ADD;
1703: RAISE fnd_api.g_exc_error;
1704: END IF;
1705: END IF;
1706:
1707: /* Validate LPN Status ID */
1708: IF (p_lpn.status_id IS NOT NULL) THEN
1709: IF (p_lpn.status_id NOT IN (1, 2, 3, 4, 5, 6)) THEN
1710: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_STATUS_ID');
1711: fnd_msg_pub.ADD;
1712: RAISE fnd_api.g_exc_error;
1713: END IF;
1714: END IF;
1715:
1716: /* Validate LPN Context */
1717: IF (p_lpn.lpn_context IS NOT NULL) THEN
1718: IF (p_lpn.lpn_context NOT IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) THEN
1719: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LPN_CONTEXT');
1720: fnd_msg_pub.ADD;
1721: RAISE fnd_api.g_exc_error;
1722: END IF;
1723: END IF;
1724:
1725: /* Validate Sealed Status */
1726: IF (p_lpn.sealed_status IS NOT NULL) THEN
1727: IF (p_lpn.sealed_status NOT IN (1, 2)) THEN
1728: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SEALED_STAT');
1729: fnd_msg_pub.ADD;
1730: RAISE fnd_api.g_exc_error;
1731: END IF;
1732: END IF;
1846: SAVEPOINT modify_lpn_wrapper_pub;
1847:
1848: -- Standard call to check for call compatibility.
1849: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
1850: fnd_message.set_name('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
1851: fnd_msg_pub.ADD;
1852: RAISE fnd_api.g_exc_unexpected_error;
1853: END IF;
1854:
1866: l_lpn.license_plate_number := NULL;
1867: l_result := validate_lpn(l_lpn);
1868:
1869: IF (l_result = inv_validate.f) THEN
1870: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LPN');
1871: fnd_msg_pub.ADD;
1872: RAISE fnd_api.g_exc_error;
1873: END IF;
1874:
2164: SAVEPOINT packunpack_container_pub;
2165:
2166: -- Standard call to check for call compatibility.
2167: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
2168: fnd_message.set_name('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
2169: fnd_msg_pub.ADD;
2170: RAISE fnd_api.g_exc_unexpected_error;
2171: END IF;
2172:
2194: IF (l_result = inv_validate.f) THEN
2195: IF (l_debug = 1) THEN
2196: mdebug(p_lpn_id || 'is an invalid lpn_id', G_ERROR);
2197: END IF;
2198: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LPN');
2199: fnd_msg_pub.ADD;
2200: RAISE fnd_api.g_exc_error;
2201: END IF;
2202:
2210: IF (l_result = inv_validate.f) THEN
2211: IF (l_debug = 1) THEN
2212: mdebug(p_content_lpn_id || 'is and invalid content lpn id', G_ERROR);
2213: END IF;
2214: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_CONTENT_LPN');
2215: fnd_msg_pub.ADD;
2216: RAISE fnd_api.g_exc_error;
2217: END IF;
2218:
2222: IF (l_content_lpn.parent_lpn_id <> l_lpn.lpn_id) THEN
2223: IF (l_debug = 1) THEN
2224: mdebug('child lpn is not in lpn parent lpn', G_ERROR);
2225: END IF;
2226: fnd_message.set_name('WMS', 'WMS_CONT_LPN_NOT_IN_LPN');
2227: fnd_msg_pub.ADD;
2228: RAISE fnd_api.g_exc_error;
2229: END IF;
2230: END IF;
2237: IF (l_result = inv_validate.f) THEN
2238: IF (l_debug = 1) THEN
2239: mdebug(p_organization_id || 'is not a valid org_id', G_ERROR);
2240: END IF;
2241: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
2242: fnd_msg_pub.ADD;
2243: RAISE fnd_api.g_exc_error;
2244: END IF;
2245:
2251: IF (l_result = inv_validate.f) THEN
2252: IF (l_debug = 1) THEN
2253: mdebug(p_content_item_id || 'is not a valid content item id', G_ERROR);
2254: END IF;
2255: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_CONTENT_ITEM');
2256: fnd_msg_pub.ADD;
2257: RAISE fnd_api.g_exc_error;
2258: END IF;
2259: END IF;
2268: IF ( NOT (p_operation = 4 OR (p_unpack_all = 1 AND p_operation = 2)) ) THEN
2269: IF (l_debug = 1) THEN
2270: mdebug('no item description for unpack all', G_ERROR);
2271: END IF;
2272: fnd_message.set_name('WMS', 'WMS_CONT_NO_ITEM_DESC');
2273: fnd_msg_pub.ADD;
2274: RAISE fnd_api.g_exc_error;
2275: END IF;
2276: END IF;
2281: ) THEN
2282: IF (l_debug = 1) THEN
2283: mdebug('Can not specify both content item and container item at same time', G_ERROR);
2284: END IF;
2285: fnd_message.set_name('WMS', 'WMS_CONT_LPN_AND_ITEM');
2286: fnd_msg_pub.ADD;
2287: RAISE fnd_api.g_exc_error;
2288: END IF;
2289:
2291: IF (p_content_item_id IS NOT NULL) THEN
2292: IF (p_operation = 1) THEN
2293: IF (l_lpn.lpn_context IN (1, 11)) THEN
2294: IF (p_subinventory IS NULL) THEN
2295: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SUB');
2296: fnd_msg_pub.ADD;
2297: RAISE fnd_api.g_exc_error;
2298: END IF;
2299: END IF;
2308: IF (l_result = inv_validate.f) THEN
2309: IF (l_debug = 1) THEN
2310: mdebug(p_subinventory || 'is an invalid sub', G_ERROR);
2311: END IF;
2312: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SUB');
2313: fnd_msg_pub.ADD;
2314: RAISE fnd_api.g_exc_error;
2315: END IF;
2316: END IF;
2338: IF (p_locator_id IS NULL) THEN
2339: IF (l_debug = 1) THEN
2340: mdebug('Missing required locator', G_ERROR);
2341: END IF;
2342: fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_LOC');
2343: fnd_msg_pub.ADD;
2344: RAISE fnd_api.g_exc_error;
2345: END IF;
2346:
2350: IF (l_result = inv_validate.f) THEN
2351: IF (l_debug = 1) THEN
2352: mdebug(p_locator_id || ' is an invalid locator_id', G_ERROR);
2353: END IF;
2354: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOC');
2355: fnd_msg_pub.ADD;
2356: RAISE fnd_api.g_exc_error;
2357: END IF;
2358: --END IF;
2369: IF (l_result = inv_validate.f) THEN
2370: IF (l_debug = 1) THEN
2371: mdebug(p_revision || ' is an invalid revision', G_ERROR);
2372: END IF;
2373: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_REV');
2374: fnd_msg_pub.ADD;
2375: RAISE fnd_api.g_exc_error;
2376: END IF;
2377: ELSE
2377: ELSE
2378: IF (l_debug = 1) THEN
2379: mdebug('Mission required revision', G_ERROR);
2380: END IF;
2381: fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_REV');
2382: fnd_msg_pub.ADD;
2383: RAISE fnd_api.g_exc_error;
2384: END IF;
2385: END IF;
2412: IF (l_result = inv_validate.f) THEN
2413: IF (l_debug = 1) THEN
2414: mdebug(p_lot_number || ' is an invalid lot number', G_ERROR);
2415: END IF;
2416: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOT');
2417: fnd_msg_pub.ADD;
2418: RAISE fnd_api.g_exc_error;
2419: END IF;
2420: END IF;
2427: IF lot_validation_cursor%NOTFOUND THEN
2428: IF (l_debug = 1) THEN
2429: mdebug(p_lot_number || ' is an invalid lot number', G_ERROR);
2430: END IF;
2431: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOT');
2432: fnd_msg_pub.ADD;
2433: RAISE fnd_api.g_exc_error;
2434: END IF;
2435:
2443: ELSE
2444: IF (l_debug = 1) THEN
2445: mdebug('Missing required lot', G_ERROR);
2446: END IF;
2447: fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_LOT');
2448: fnd_msg_pub.ADD;
2449: RAISE fnd_api.g_exc_error;
2450: END IF;
2451: END IF;
2459: IF (p_quantity <= 0) THEN
2460: IF (l_debug = 1) THEN
2461: mdebug('Requested a negative item qty', G_ERROR);
2462: END IF;
2463: fnd_message.set_name('WMS', 'WMS_CONT_NEG_ITEM_QTY');
2464: fnd_msg_pub.ADD;
2465: RAISE fnd_api.g_exc_error;
2466: ELSE
2467: l_quantity := p_quantity;
2478: IF (p_quantity <> 1) THEN
2479: IF (l_debug = 1) THEN
2480: mdebug('For container item unpack quantitiy must be 1', G_ERROR);
2481: END IF;
2482: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_QTY');
2483: fnd_msg_pub.ADD;
2484: RAISE fnd_api.g_exc_error;
2485: END IF;
2486: ELSE
2499: IF (NOT mtl_serial_check.inv_serial_info(p_from_serial_number, p_to_serial_number, l_prefix, l_quantity, l_from_number, l_to_number, l_errorcode)) THEN
2500: IF (l_debug = 1) THEN
2501: mdebug('Invalid serial number given in range', G_ERROR);
2502: END IF;
2503: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SER');
2504: fnd_msg_pub.ADD;
2505: RAISE fnd_api.g_exc_error;
2506: END IF;
2507:
2511: IF (p_quantity <> l_quantity) THEN
2512: IF (l_debug = 1) THEN
2513: mdebug('Serial range quantity '||l_quantity||' not the same as given qty '||p_quantity, G_ERROR);
2514: END IF;
2515: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_X_QTY');
2516: fnd_msg_pub.ADD;
2517: RAISE fnd_api.g_exc_error;
2518: END IF;
2519: END IF;
2547: IF (l_result = inv_validate.f) THEN
2548: IF (l_debug = 1) THEN
2549: mdebug(l_current_serial || ' is not a valid serial number', G_ERROR);
2550: END IF;
2551: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SER');
2552: fnd_msg_pub.ADD;
2553: RAISE fnd_api.g_exc_error;
2554: END IF;
2555: ELSE
2562: IF serial_validation_cursor%NOTFOUND THEN
2563: IF (l_debug = 1) THEN
2564: mdebug(l_current_serial || ' is not a valid serial number', G_ERROR);
2565: END IF;
2566: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SER');
2567: fnd_msg_pub.ADD;
2568: RAISE fnd_api.g_exc_error;
2569: END IF;
2570:
2596: ELSE
2597: IF (l_debug = 1) THEN
2598: mdebug('Missing require serial number', G_ERROR);
2599: END IF;
2600: fnd_message.set_name('WMS', 'WMS_CONT_MISS_SER_NUM');
2601: fnd_msg_pub.ADD;
2602: RAISE fnd_api.g_exc_error;
2603: END IF;
2604: END IF;
2611: IF (l_result = inv_validate.f) THEN
2612: IF (l_debug = 1) THEN
2613: mdebug(p_uom || ' is an invalid UOM', G_ERROR);
2614: END IF;
2615: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_UOM');
2616: fnd_msg_pub.ADD;
2617: RAISE fnd_api.g_exc_error;
2618: END IF;
2619: END IF;
2622: IF ( p_operation < 1 OR p_operation > 5 ) THEN
2623: IF (l_debug = 1) THEN
2624: mdebug(p_operation || ' is an invalid operation type', G_ERROR);
2625: END IF;
2626: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_OPERATION');
2627: fnd_msg_pub.ADD;
2628: RAISE fnd_api.g_exc_error;
2629: END IF;
2630:
2633: IF ((p_enforce_wv_constraints <> 1) AND (p_enforce_wv_constraints <> 2)) THEN
2634: IF (l_debug = 1) THEN
2635: mdebug(p_enforce_wv_constraints || ' is an invalid constraint type', G_MESSAGE);
2636: END IF;
2637: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_CONSTRAINT');
2638: fnd_msg_pub.ADD;
2639: RAISE fnd_api.g_exc_error;
2640: END IF;
2641: END IF;
2647: IF (l_result = inv_validate.f) THEN
2648: IF (l_debug = 1) THEN
2649: mdebug(p_cost_group_id || ' is an invalid cost group is', G_ERROR);
2650: END IF;
2651: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_CST_GRP');
2652: fnd_msg_pub.ADD;
2653: RAISE fnd_api.g_exc_error;
2654: END IF;
2655: END IF;
2798: SAVEPOINT pack_prepack_container_pub;
2799:
2800: -- Standard call to check for call compatibility.
2801: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
2802: fnd_message.set_name('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
2803: fnd_msg_pub.ADD;
2804: RAISE fnd_api.g_exc_unexpected_error;
2805: END IF;
2806:
2830: IF (l_result = inv_validate.f) THEN
2831: IF (l_debug = 1) THEN
2832: mdebug(p_lpn_id || 'is an invalid lpn_id', 1);
2833: END IF;
2834: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LPN');
2835: fnd_msg_pub.ADD;
2836: RAISE fnd_api.g_exc_error;
2837: END IF;
2838:
2843: IF (l_result = inv_validate.f) THEN
2844: IF (l_debug = 1) THEN
2845: mdebug(p_organization_id || 'is not a valid org_id', 1);
2846: END IF;
2847: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
2848: fnd_msg_pub.ADD;
2849: RAISE fnd_api.g_exc_error;
2850: END IF;
2851:
2857: IF (l_result = inv_validate.f) THEN
2858: IF (l_debug = 1) THEN
2859: mdebug(p_content_item_id || 'is not a valid content item id', 1);
2860: END IF;
2861: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_CONTENT_ITEM');
2862: fnd_msg_pub.ADD;
2863: RAISE fnd_api.g_exc_error;
2864: END IF;
2865: END IF;
2873: IF (l_result = inv_validate.f) THEN
2874: IF (l_debug = 1) THEN
2875: mdebug(p_revision || ' is an invalid revision', 1);
2876: END IF;
2877: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_REV');
2878: fnd_msg_pub.ADD;
2879: RAISE fnd_api.g_exc_error;
2880: END IF;
2881: ELSE
2881: ELSE
2882: IF (l_debug = 1) THEN
2883: mdebug('Mission required revision', 1);
2884: END IF;
2885: fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_REV');
2886: fnd_msg_pub.ADD;
2887: RAISE fnd_api.g_exc_error;
2888: END IF;
2889: END IF;
2896: IF (p_lot_number IS NULL) THEN
2897: IF (l_debug = 1) THEN
2898: mdebug('Missing required lot', 1);
2899: END IF;
2900: fnd_message.set_name('WMS', 'WMS_CONT_MISS_REQ_LOT');
2901: fnd_msg_pub.ADD;
2902: RAISE fnd_api.g_exc_error;
2903: END IF;
2904: END IF;
2912: IF (p_quantity <= 0) THEN
2913: IF (l_debug = 1) THEN
2914: mdebug('Requested a negative item qty', 1);
2915: END IF;
2916: fnd_message.set_name('WMS', 'WMS_CONT_NEG_ITEM_QTY');
2917: fnd_msg_pub.ADD;
2918: RAISE fnd_api.g_exc_error;
2919: ELSE
2920: l_quantity := p_quantity;
2933: IF (NOT mtl_serial_check.inv_serial_info(p_from_serial_number, p_to_serial_number, l_prefix, l_quantity, l_from_number, l_to_number, l_errorcode)) THEN
2934: IF (l_debug = 1) THEN
2935: mdebug('Invalid serial number given in range', 1);
2936: END IF;
2937: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SER');
2938: fnd_msg_pub.ADD;
2939: RAISE fnd_api.g_exc_error;
2940: END IF;
2941:
2945: IF (p_quantity <> l_quantity) THEN
2946: IF (l_debug = 1) THEN
2947: mdebug('Serial range quantity '||l_quantity||' not the same as given qty '||p_quantity, G_ERROR);
2948: END IF;
2949: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_X_QTY');
2950: fnd_msg_pub.ADD;
2951: RAISE fnd_api.g_exc_error;
2952: END IF;
2953: END IF;
2985: IF serial_validation_cursor%NOTFOUND THEN
2986: IF (l_debug = 1) THEN
2987: mdebug(l_current_serial || ' is not a valid serial number', 1);
2988: END IF;
2989: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SER');
2990: fnd_msg_pub.ADD;
2991: RAISE fnd_api.g_exc_error;
2992: END IF;
2993:
3018: ELSE
3019: IF (l_debug = 1) THEN
3020: mdebug('Missing require serial number', 1);
3021: END IF;
3022: fnd_message.set_name('WMS', 'WMS_CONT_MISS_SER_NUM');
3023: fnd_msg_pub.ADD;
3024: RAISE fnd_api.g_exc_error;
3025: END IF;
3026: END IF;
3033: IF (l_result = inv_validate.f) THEN
3034: IF (l_debug = 1) THEN
3035: mdebug(p_uom || ' is an invalid UOM', 1);
3036: END IF;
3037: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_UOM');
3038: fnd_msg_pub.ADD;
3039: RAISE fnd_api.g_exc_error;
3040: END IF;
3041: END IF;
3044: IF ((p_operation <> 1)) THEN
3045: IF (l_debug = 1) THEN
3046: mdebug(p_operation || ' is an invalid operation type', 1);
3047: END IF;
3048: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_OPERATION');
3049: fnd_msg_pub.ADD;
3050: RAISE fnd_api.g_exc_error;
3051: END IF;
3052: END IF;
3215: SAVEPOINT prepack_lpn_cp_pub;
3216:
3217: -- Standard call to check for call compatibility.
3218: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
3219: fnd_message.set_name('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
3220: fnd_msg_pub.ADD;
3221: RAISE fnd_api.g_exc_unexpected_error;
3222: END IF;
3223:
3374:
3375: BEGIN
3376: -- Standard call to check for call compatibility.
3377: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
3378: fnd_message.set_name('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
3379: fnd_msg_pub.ADD;
3380: RAISE fnd_api.g_exc_error;
3381: END IF;
3382:
3400: IF ( l_result = INV_Validate.F ) THEN
3401: IF ( l_debug = 1 ) THEN
3402: mdebug(p_organization_id || ' is not a valid org id', G_ERROR);
3403: END IF;
3404: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
3405: fnd_msg_pub.ADD;
3406: RAISE fnd_api.g_exc_error;
3407: END IF;
3408:
3414: IF ( l_result = INV_Validate.F ) THEN
3415: IF ( l_debug = 1 ) THEN
3416: mdebug(p_outermost_lpn_id || ' is an invalid lpn id', G_ERROR);
3417: END IF;
3418: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_LPN');
3419: FND_MSG_PUB.ADD;
3420: RAISE FND_API.G_EXC_ERROR;
3421: END IF;
3422:
3498:
3499: BEGIN
3500: -- Standard call to check for call compatibility.
3501: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
3502: fnd_message.set_name('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
3503: fnd_msg_pub.ADD;
3504: RAISE fnd_api.g_exc_error;
3505: END IF;
3506:
3524: IF ( l_result = INV_Validate.F ) THEN
3525: IF ( l_debug = 1 ) THEN
3526: mdebug(p_organization_id || ' is not a valid org id', G_ERROR);
3527: END IF;
3528: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
3529: fnd_msg_pub.ADD;
3530: RAISE fnd_api.g_exc_error;
3531: END IF;
3532:
3538: IF ( l_result = INV_Validate.F ) THEN
3539: IF ( l_debug = 1 ) THEN
3540: mdebug(p_outermost_lpn_id || ' is an invalid lpn id', G_ERROR);
3541: END IF;
3542: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_LPN');
3543: FND_MSG_PUB.ADD;
3544: RAISE FND_API.G_EXC_ERROR;
3545: END IF;
3546:
3622:
3623: BEGIN
3624: -- Standard call to check for call compatibility.
3625: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
3626: fnd_message.set_name('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
3627: fnd_msg_pub.ADD;
3628: RAISE fnd_api.g_exc_error;
3629: END IF;
3630:
3648: IF ( l_result = INV_Validate.F ) THEN
3649: IF ( l_debug = 1 ) THEN
3650: mdebug(p_organization_id || ' is not a valid org id', G_ERROR);
3651: END IF;
3652: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
3653: fnd_msg_pub.ADD;
3654: RAISE fnd_api.g_exc_error;
3655: END IF;
3656:
3662: IF ( l_result = INV_Validate.F ) THEN
3663: IF ( l_debug = 1 ) THEN
3664: mdebug(p_outermost_lpn_id || ' is an invalid lpn id', G_ERROR);
3665: END IF;
3666: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_LPN');
3667: FND_MSG_PUB.ADD;
3668: RAISE FND_API.G_EXC_ERROR;
3669: END IF;
3670:
3911: x_return_status := 'S';
3912:
3913: EXCEPTION
3914: WHEN l_transactions_pending THEN
3915: FND_MESSAGE.SET_NAME('WMS', 'WMS_PENDING_TRX_RECORDS');
3916: FND_MSG_PUB.ADD;
3917: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count, p_data => x_msg_data);
3918: x_return_status := 'E';
3919: WHEN l_invalid_lpn_context THEN
3916: FND_MSG_PUB.ADD;
3917: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count, p_data => x_msg_data);
3918: x_return_status := 'E';
3919: WHEN l_invalid_lpn_context THEN
3920: FND_MESSAGE.SET_NAME('WMS', 'WMS_WRONG_TO_LPN_CONTEXT');
3921: FND_MSG_PUB.ADD;
3922: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count, p_data => x_msg_data);
3923: x_return_status := 'E';
3924: WHEN l_lpn_not_found THEN
3921: FND_MSG_PUB.ADD;
3922: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count, p_data => x_msg_data);
3923: x_return_status := 'E';
3924: WHEN l_lpn_not_found THEN
3925: FND_MESSAGE.SET_NAME('WMS', 'WMS_LPN_NOTFOUND');
3926: FND_MSG_PUB.ADD;
3927: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count, p_data => x_msg_data);
3928: x_return_status := 'E';
3929: WHEN OTHERS THEN
3926: FND_MSG_PUB.ADD;
3927: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count, p_data => x_msg_data);
3928: x_return_status := 'E';
3929: WHEN OTHERS THEN
3930: FND_MESSAGE.SET_NAME('WMS', 'WMS_UNEXPECTED_ERROR');
3931: FND_MSG_PUB.ADD;
3932: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count, p_data => x_msg_data);
3933: x_return_status := 'E';
3934: END validate_lpn;
4586:
4587: EXCEPTION
4588:
4589: WHEN l_invalid_org THEN
4590: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_ORG');
4591: FND_MSG_PUB.ADD;
4592: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count, p_data => x_msg_data);
4593: x_return_status := 'E';
4594: WHEN l_invalid_lpn THEN
4593: x_return_status := 'E';
4594: WHEN l_invalid_lpn THEN
4595: x_return_status := 'E';
4596: WHEN OTHERS THEN
4597: FND_MESSAGE.SET_NAME('WMS', 'WMS_UNEXPECTED_ERROR');
4598: FND_MSG_PUB.ADD;
4599: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count, p_data => x_msg_data);
4600: x_return_status := 'E';
4601: ROLLBACK TO REUSE_LPN_SP;