151: l_lpn_bulk_rec WMS_CONTAINER_PVT.LPNBulkRecType;
152:
153: -- Validation Parameters
154: l_quantity NUMBER;
155: l_org inv_validate.org;
156: l_container_item inv_validate.item;
157: l_lpn lpn;
158: l_sub inv_validate.sub;
159: l_locator inv_validate.LOCATOR;
152:
153: -- Validation Parameters
154: l_quantity NUMBER;
155: l_org inv_validate.org;
156: l_container_item inv_validate.item;
157: l_lpn lpn;
158: l_sub inv_validate.sub;
159: l_locator inv_validate.LOCATOR;
160: l_lot inv_validate.lot;
154: l_quantity NUMBER;
155: l_org inv_validate.org;
156: l_container_item inv_validate.item;
157: l_lpn lpn;
158: l_sub inv_validate.sub;
159: l_locator inv_validate.LOCATOR;
160: l_lot inv_validate.lot;
161: l_serial inv_validate.serial;
162: l_current_serial VARCHAR2(30) := p_from_serial_number;
155: l_org inv_validate.org;
156: l_container_item inv_validate.item;
157: l_lpn lpn;
158: l_sub inv_validate.sub;
159: l_locator inv_validate.LOCATOR;
160: l_lot inv_validate.lot;
161: l_serial inv_validate.serial;
162: l_current_serial VARCHAR2(30) := p_from_serial_number;
163: l_prefix VARCHAR2(30);
156: l_container_item inv_validate.item;
157: l_lpn lpn;
158: l_sub inv_validate.sub;
159: l_locator inv_validate.LOCATOR;
160: l_lot inv_validate.lot;
161: l_serial inv_validate.serial;
162: l_current_serial VARCHAR2(30) := p_from_serial_number;
163: l_prefix VARCHAR2(30);
164: l_quantity_serial NUMBER;
157: l_lpn lpn;
158: l_sub inv_validate.sub;
159: l_locator inv_validate.LOCATOR;
160: l_lot inv_validate.lot;
161: l_serial inv_validate.serial;
162: l_current_serial VARCHAR2(30) := p_from_serial_number;
163: l_prefix VARCHAR2(30);
164: l_quantity_serial NUMBER;
165: l_from_number NUMBER;
215:
216: IF (p_validation_level = fnd_api.g_valid_level_full) THEN
217: l_progress := 'Validate Organization ID';
218: l_org.organization_id := p_organization_id;
219: l_result := inv_validate.ORGANIZATION(l_org);
220:
221: IF (l_result = inv_validate.f) THEN
222: IF (l_debug = 1) THEN
223: mdebug(p_organization_id || ' is not a valid org id', G_ERROR);
217: l_progress := 'Validate Organization ID';
218: l_org.organization_id := p_organization_id;
219: l_result := inv_validate.ORGANIZATION(l_org);
220:
221: IF (l_result = inv_validate.f) THEN
222: IF (l_debug = 1) THEN
223: mdebug(p_organization_id || ' is not a valid org id', G_ERROR);
224: END IF;
225: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
229:
230: l_progress := 'Validate Container Item';
231: IF (p_container_item_id IS NOT NULL) THEN
232: l_container_item.inventory_item_id := p_container_item_id;
233: l_result := inv_validate.inventory_item(l_container_item, l_org);
234:
235: IF (l_result = inv_validate.f) THEN
236: IF (l_debug = 1) THEN
237: mdebug(p_container_item_id || ' is not a valid container item id', 1);
231: IF (p_container_item_id IS NOT NULL) THEN
232: l_container_item.inventory_item_id := p_container_item_id;
233: l_result := inv_validate.inventory_item(l_container_item, l_org);
234:
235: IF (l_result = inv_validate.f) THEN
236: IF (l_debug = 1) THEN
237: mdebug(p_container_item_id || ' is not a valid container item id', 1);
238: END IF;
239: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ITEM');
253:
254: l_progress := 'Validate Subinventory';
255: IF (p_subinventory IS NOT NULL) THEN
256: l_sub.secondary_inventory_name := p_subinventory;
257: l_result := inv_validate.subinventory(l_sub, l_org);
258:
259: IF (l_result = inv_validate.f) THEN
260: IF (l_debug = 1) THEN
261: mdebug(p_subinventory || ' is not a valid sub', 1);
255: IF (p_subinventory IS NOT NULL) THEN
256: l_sub.secondary_inventory_name := p_subinventory;
257: l_result := inv_validate.subinventory(l_sub, l_org);
258:
259: IF (l_result = inv_validate.f) THEN
260: IF (l_debug = 1) THEN
261: mdebug(p_subinventory || ' is not a valid sub', 1);
262: END IF;
263: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SUB');
278: RAISE fnd_api.g_exc_error;
279: END IF;
280:
281: l_locator.inventory_location_id := p_locator_id;
282: l_result := inv_validate.validatelocator(l_locator, l_org, l_sub);
283:
284: IF (l_result = inv_validate.f) THEN
285: IF (l_debug = 1) THEN
286: mdebug(p_locator_id || ' is not a valid loc id', 1);
280:
281: l_locator.inventory_location_id := p_locator_id;
282: l_result := inv_validate.validatelocator(l_locator, l_org, l_sub);
283:
284: IF (l_result = inv_validate.f) THEN
285: IF (l_debug = 1) THEN
286: mdebug(p_locator_id || ' is not a valid loc id', 1);
287: END IF;
288: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOC');
295: l_progress := 'Validate Revision';
296: IF (p_container_item_id IS NOT NULL) THEN
297: IF (l_container_item.revision_qty_control_code = 2) THEN
298: IF (p_revision IS NOT NULL) THEN
299: l_result := inv_validate.revision(p_revision, l_org, l_container_item);
300:
301: IF (l_result = inv_validate.f) THEN
302: IF (l_debug = 1) THEN
303: mdebug(p_revision || ' is not a valid rev', 1);
297: IF (l_container_item.revision_qty_control_code = 2) THEN
298: IF (p_revision IS NOT NULL) THEN
299: l_result := inv_validate.revision(p_revision, l_org, l_container_item);
300:
301: IF (l_result = inv_validate.f) THEN
302: IF (l_debug = 1) THEN
303: mdebug(p_revision || ' is not a valid rev', 1);
304: END IF;
305: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_REV');
322: IF (p_container_item_id IS NOT NULL) THEN
323: IF (l_container_item.lot_control_code = 2) THEN
324: IF (p_lot_number IS NOT NULL) THEN
325: l_lot.lot_number := p_lot_number;
326: l_result := inv_validate.lot_number(l_lot, l_org, l_container_item, l_sub, l_locator, p_revision);
327:
328: IF (l_result = inv_validate.f) THEN
329: IF (l_debug = 1) THEN
330: mdebug(p_lot_number || ' is not a valid lot', 1);
324: IF (p_lot_number IS NOT NULL) THEN
325: l_lot.lot_number := p_lot_number;
326: l_result := inv_validate.lot_number(l_lot, l_org, l_container_item, l_sub, l_locator, p_revision);
327:
328: IF (l_result = inv_validate.f) THEN
329: IF (l_debug = 1) THEN
330: mdebug(p_lot_number || ' is not a valid lot', 1);
331: END IF;
332: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOT');
381:
382: LOOP
383: IF (p_subinventory IS NOT NULL) THEN
384: l_serial.serial_number := l_current_serial;
385: l_result := inv_validate.validate_serial(l_serial, l_org, l_container_item, l_sub, l_lot, l_locator, p_revision);
386:
387: IF (l_result = inv_validate.f) THEN
388: IF (l_debug = 1) THEN
389: mdebug(l_current_serial || 'failed validate_serial', 1);
383: IF (p_subinventory IS NOT NULL) THEN
384: l_serial.serial_number := l_current_serial;
385: l_result := inv_validate.validate_serial(l_serial, l_org, l_container_item, l_sub, l_lot, l_locator, p_revision);
386:
387: IF (l_result = inv_validate.f) THEN
388: IF (l_debug = 1) THEN
389: mdebug(l_current_serial || 'failed validate_serial', 1);
390: END IF;
391: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SER');
466: END IF;
467:
468: l_progress := 'Validate Cost Group';
469: IF (p_cost_group_id IS NOT NULL) THEN
470: l_result := inv_validate.cost_group(p_cost_group_id, p_organization_id);
471:
472: IF (l_result = inv_validate.f) THEN
473: IF (l_debug = 1) THEN
474: mdebug(p_cost_group_id || ' is an invalid cost group id', 1);
468: l_progress := 'Validate Cost Group';
469: IF (p_cost_group_id IS NOT NULL) THEN
470: l_result := inv_validate.cost_group(p_cost_group_id, p_organization_id);
471:
472: IF (l_result = inv_validate.f) THEN
473: IF (l_debug = 1) THEN
474: mdebug(p_cost_group_id || ' is an invalid cost group id', 1);
475: END IF;
476: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_CST_GRP');
585: ) IS
586: l_api_name CONSTANT VARCHAR2(30) := 'Associate_LPN';
587: l_api_version CONSTANT NUMBER := 1.0;
588: l_lpn lpn;
589: l_container_item inv_validate.item;
590: l_org inv_validate.org;
591: l_sub inv_validate.sub;
592: l_locator inv_validate.LOCATOR;
593: l_lot inv_validate.lot;
586: l_api_name CONSTANT VARCHAR2(30) := 'Associate_LPN';
587: l_api_version CONSTANT NUMBER := 1.0;
588: l_lpn lpn;
589: l_container_item inv_validate.item;
590: l_org inv_validate.org;
591: l_sub inv_validate.sub;
592: l_locator inv_validate.LOCATOR;
593: l_lot inv_validate.lot;
594: l_serial inv_validate.serial;
587: l_api_version CONSTANT NUMBER := 1.0;
588: l_lpn lpn;
589: l_container_item inv_validate.item;
590: l_org inv_validate.org;
591: l_sub inv_validate.sub;
592: l_locator inv_validate.LOCATOR;
593: l_lot inv_validate.lot;
594: l_serial inv_validate.serial;
595: l_result NUMBER;
588: l_lpn lpn;
589: l_container_item inv_validate.item;
590: l_org inv_validate.org;
591: l_sub inv_validate.sub;
592: l_locator inv_validate.LOCATOR;
593: l_lot inv_validate.lot;
594: l_serial inv_validate.serial;
595: l_result NUMBER;
596: l_new_lpn_id NUMBER;
589: l_container_item inv_validate.item;
590: l_org inv_validate.org;
591: l_sub inv_validate.sub;
592: l_locator inv_validate.LOCATOR;
593: l_lot inv_validate.lot;
594: l_serial inv_validate.serial;
595: l_result NUMBER;
596: l_new_lpn_id NUMBER;
597: l_new_lpn VARCHAR2(30);
590: l_org inv_validate.org;
591: l_sub inv_validate.sub;
592: l_locator inv_validate.LOCATOR;
593: l_lot inv_validate.lot;
594: l_serial inv_validate.serial;
595: l_result NUMBER;
596: l_new_lpn_id NUMBER;
597: l_new_lpn VARCHAR2(30);
598: l_insert_update_flag VARCHAR2(1); -- flag to signal existing lpn or new one
641: l_lpn.lpn_id := p_lpn_id;
642: l_lpn.license_plate_number := NULL;
643: l_result := validate_lpn(l_lpn);
644:
645: IF (l_result = inv_validate.f) THEN
646: l_new_lpn_id := p_lpn_id;
647: l_insert_update_flag := 'i';
648: ELSE
649: l_insert_update_flag := 'u';
650: END IF;
651:
652: /* Validate Organization ID */
653: l_org.organization_id := p_organization_id;
654: l_result := inv_validate.ORGANIZATION(l_org);
655:
656: IF (l_result = inv_validate.f) THEN
657: IF (l_debug = 1) THEN
658: mdebug(p_organization_id || ' is an invalid org id', 1);
652: /* Validate Organization ID */
653: l_org.organization_id := p_organization_id;
654: l_result := inv_validate.ORGANIZATION(l_org);
655:
656: IF (l_result = inv_validate.f) THEN
657: IF (l_debug = 1) THEN
658: mdebug(p_organization_id || ' is an invalid org id', 1);
659: END IF;
660: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
664:
665: /* Validate Subinventory */
666: IF (p_subinventory IS NOT NULL) THEN
667: l_sub.secondary_inventory_name := p_subinventory;
668: l_result := inv_validate.subinventory(l_sub, l_org);
669:
670: IF (l_result = inv_validate.f) THEN
671: IF (l_debug = 1) THEN
672: mdebug(p_subinventory || ' is an invalid sub', 1);
666: IF (p_subinventory IS NOT NULL) THEN
667: l_sub.secondary_inventory_name := p_subinventory;
668: l_result := inv_validate.subinventory(l_sub, l_org);
669:
670: IF (l_result = inv_validate.f) THEN
671: IF (l_debug = 1) THEN
672: mdebug(p_subinventory || ' is an invalid sub', 1);
673: END IF;
674: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SUB');
686: RAISE fnd_api.g_exc_error;
687: END IF;
688:
689: l_locator.inventory_location_id := p_locator_id;
690: l_result := inv_validate.validatelocator(l_locator, l_org, l_sub);
691:
692: IF (l_result = inv_validate.f) THEN
693: IF (l_debug = 1) THEN
694: mdebug(p_locator_id || ' is an invalid loc id', 1);
688:
689: l_locator.inventory_location_id := p_locator_id;
690: l_result := inv_validate.validatelocator(l_locator, l_org, l_sub);
691:
692: IF (l_result = inv_validate.f) THEN
693: IF (l_debug = 1) THEN
694: mdebug(p_locator_id || ' is an invalid loc id', 1);
695: END IF;
696: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOC');
703: /* Validate Container Item */
704: /* Validate Container Item */
705: IF (p_container_item_id IS NOT NULL) THEN
706: l_container_item.inventory_item_id := p_container_item_id;
707: l_result := inv_validate.inventory_item(l_container_item, l_org);
708:
709: IF (l_result = inv_validate.f) THEN
710: IF (l_debug = 1) THEN
711: mdebug(p_container_item_id || ' is an invalid container item id', 1);
705: IF (p_container_item_id IS NOT NULL) THEN
706: l_container_item.inventory_item_id := p_container_item_id;
707: l_result := inv_validate.inventory_item(l_container_item, l_org);
708:
709: IF (l_result = inv_validate.f) THEN
710: IF (l_debug = 1) THEN
711: mdebug(p_container_item_id || ' is an invalid container item id', 1);
712: END IF;
713: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ITEM');
751: /* Validate Revision */
752: IF (p_container_item_id IS NOT NULL) THEN
753: IF (l_container_item.revision_qty_control_code = 2) THEN
754: IF (p_revision IS NOT NULL) THEN
755: l_result := inv_validate.revision(p_revision, l_org, l_container_item);
756:
757: IF (l_result = inv_validate.f) THEN
758: IF (l_debug = 1) THEN
759: mdebug(p_revision || ' is an invalid rev', 1);
753: IF (l_container_item.revision_qty_control_code = 2) THEN
754: IF (p_revision IS NOT NULL) THEN
755: l_result := inv_validate.revision(p_revision, l_org, l_container_item);
756:
757: IF (l_result = inv_validate.f) THEN
758: IF (l_debug = 1) THEN
759: mdebug(p_revision || ' is an invalid rev', 1);
760: END IF;
761: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_REV');
778: IF (p_container_item_id IS NOT NULL) THEN
779: IF (l_container_item.lot_control_code = 2) THEN
780: IF (p_lot_number IS NOT NULL) THEN
781: l_lot.lot_number := p_lot_number;
782: l_result := inv_validate.lot_number(l_lot, l_org, l_container_item, l_sub, l_locator, p_revision);
783:
784: IF (l_result = inv_validate.f) THEN
785: IF (l_debug = 1) THEN
786: mdebug(p_lot_number || ' is not a valid lot', 1);
780: IF (p_lot_number IS NOT NULL) THEN
781: l_lot.lot_number := p_lot_number;
782: l_result := inv_validate.lot_number(l_lot, l_org, l_container_item, l_sub, l_locator, p_revision);
783:
784: IF (l_result = inv_validate.f) THEN
785: IF (l_debug = 1) THEN
786: mdebug(p_lot_number || ' is not a valid lot', 1);
787: END IF;
788: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOT');
805: IF (p_container_item_id IS NOT NULL) THEN
806: IF (l_container_item.serial_number_control_code <> 1) THEN
807: IF (p_serial_number IS NOT NULL) THEN
808: l_serial.serial_number := p_serial_number;
809: l_result := inv_validate.validate_serial(l_serial, l_org, l_container_item, l_sub, l_lot, l_locator, p_revision);
810:
811: IF (l_result = inv_validate.f) THEN
812: IF (l_debug = 1) THEN
813: mdebug(p_serial_number || ' is an invalid sn', 1);
807: IF (p_serial_number IS NOT NULL) THEN
808: l_serial.serial_number := p_serial_number;
809: l_result := inv_validate.validate_serial(l_serial, l_org, l_container_item, l_sub, l_lot, l_locator, p_revision);
810:
811: IF (l_result = inv_validate.f) THEN
812: IF (l_debug = 1) THEN
813: mdebug(p_serial_number || ' is an invalid sn', 1);
814: END IF;
815: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SER');
829: END IF;
830:
831: /* Validate Cost Group */
832: IF (p_cost_group_id IS NOT NULL) THEN
833: l_result := inv_validate.cost_group(p_cost_group_id, p_organization_id);
834:
835: IF (l_result = inv_validate.f) THEN
836: IF (l_debug = 1) THEN
837: mdebug(p_cost_group_id || ' is an invalid cg', 1);
831: /* Validate Cost Group */
832: IF (p_cost_group_id IS NOT NULL) THEN
833: l_result := inv_validate.cost_group(p_cost_group_id, p_organization_id);
834:
835: IF (l_result = inv_validate.f) THEN
836: IF (l_debug = 1) THEN
837: mdebug(p_cost_group_id || ' is an invalid cg', 1);
838: END IF;
839: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_CST_GRP');
852: l_lpn.lpn_id := p_lpn_id;
853: l_lpn.license_plate_number := NULL;
854: l_result := validate_lpn(l_lpn);
855:
856: IF (l_result = inv_validate.f) THEN
857: l_new_lpn_id := p_lpn_id;
858: l_insert_update_flag := 'i';
859: ELSE
860: l_insert_update_flag := 'u';
861: END IF;
862:
863: /* Validate Organization ID */
864: l_org.organization_id := p_organization_id;
865: l_result := inv_validate.ORGANIZATION(l_org);
866:
867: IF (l_result = inv_validate.f) THEN
868: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
869: fnd_msg_pub.ADD;
863: /* Validate Organization ID */
864: l_org.organization_id := p_organization_id;
865: l_result := inv_validate.ORGANIZATION(l_org);
866:
867: IF (l_result = inv_validate.f) THEN
868: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
869: fnd_msg_pub.ADD;
870: RAISE fnd_api.g_exc_error;
871: END IF;
872:
873: /* Validate Container Item */
874: IF (p_container_item_id IS NOT NULL) THEN
875: l_container_item.inventory_item_id := p_container_item_id;
876: l_result := inv_validate.inventory_item(l_container_item, l_org);
877:
878: IF (l_result = inv_validate.f) THEN
879: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ITEM');
880: fnd_msg_pub.ADD;
874: IF (p_container_item_id IS NOT NULL) THEN
875: l_container_item.inventory_item_id := p_container_item_id;
876: l_result := inv_validate.inventory_item(l_container_item, l_org);
877:
878: IF (l_result = inv_validate.f) THEN
879: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ITEM');
880: fnd_msg_pub.ADD;
881: RAISE fnd_api.g_exc_error;
882: END IF;
974: l_lpn.lpn_id := l_new_lpn_id;
975: l_lpn.license_plate_number := l_new_lpn;
976: l_result := validate_lpn(l_lpn);
977:
978: IF (l_result = inv_validate.f) THEN
979: EXIT;
980: END IF;
981: END LOOP;
982:
1110: l_api_name CONSTANT VARCHAR2(30) := 'Create_LPN';
1111: l_api_version CONSTANT NUMBER := 1.0;
1112: l_lpn lpn;
1113: l_parent_lpn lpn;
1114: l_container_item inv_validate.item;
1115: l_org inv_validate.org;
1116: l_sub inv_validate.sub;
1117: l_locator inv_validate.LOCATOR;
1118: l_lot inv_validate.lot;
1111: l_api_version CONSTANT NUMBER := 1.0;
1112: l_lpn lpn;
1113: l_parent_lpn lpn;
1114: l_container_item inv_validate.item;
1115: l_org inv_validate.org;
1116: l_sub inv_validate.sub;
1117: l_locator inv_validate.LOCATOR;
1118: l_lot inv_validate.lot;
1119: l_serial inv_validate.serial;
1112: l_lpn lpn;
1113: l_parent_lpn lpn;
1114: l_container_item inv_validate.item;
1115: l_org inv_validate.org;
1116: l_sub inv_validate.sub;
1117: l_locator inv_validate.LOCATOR;
1118: l_lot inv_validate.lot;
1119: l_serial inv_validate.serial;
1120: l_result NUMBER;
1113: l_parent_lpn lpn;
1114: l_container_item inv_validate.item;
1115: l_org inv_validate.org;
1116: l_sub inv_validate.sub;
1117: l_locator inv_validate.LOCATOR;
1118: l_lot inv_validate.lot;
1119: l_serial inv_validate.serial;
1120: l_result NUMBER;
1121: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
1114: l_container_item inv_validate.item;
1115: l_org inv_validate.org;
1116: l_sub inv_validate.sub;
1117: l_locator inv_validate.LOCATOR;
1118: l_lot inv_validate.lot;
1119: l_serial inv_validate.serial;
1120: l_result NUMBER;
1121: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
1122: BEGIN
1115: l_org inv_validate.org;
1116: l_sub inv_validate.sub;
1117: l_locator inv_validate.LOCATOR;
1118: l_lot inv_validate.lot;
1119: l_serial inv_validate.serial;
1120: l_result NUMBER;
1121: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
1122: BEGIN
1123: -- Standard Start of API savepoint
1150: l_lpn.license_plate_number := p_lpn;
1151: l_lpn.lpn_id := NULL;
1152: l_result := validate_lpn(l_lpn);
1153:
1154: IF (l_result = inv_validate.t) THEN
1155: IF (l_debug = 1) THEN
1156: mdebug(p_lpn || ' failed LPN validation', 1);
1157: END IF;
1158: fnd_message.set_name('WMS', 'WMS_CONT_DUPLICATE_LPN');
1165: l_parent_lpn.lpn_id := p_parent_lpn_id;
1166: l_parent_lpn.license_plate_number := NULL;
1167: l_result := validate_lpn(l_parent_lpn);
1168:
1169: IF (l_result = inv_validate.t) THEN
1170: IF (l_debug = 1) THEN
1171: mdebug(p_parent_lpn_id || ' parent LPN failed validation', 1);
1172: END IF;
1173: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LPN');
1177: END IF;
1178:
1179: /* Validate Organization ID */
1180: l_org.organization_id := p_organization_id;
1181: l_result := inv_validate.ORGANIZATION(l_org);
1182:
1183: IF (l_result = inv_validate.f) THEN
1184: IF (l_debug = 1) THEN
1185: mdebug(p_organization_id || ' is an invalid Org', 1);
1179: /* Validate Organization ID */
1180: l_org.organization_id := p_organization_id;
1181: l_result := inv_validate.ORGANIZATION(l_org);
1182:
1183: IF (l_result = inv_validate.f) THEN
1184: IF (l_debug = 1) THEN
1185: mdebug(p_organization_id || ' is an invalid Org', 1);
1186: END IF;
1187: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
1191:
1192: /* Validate Subinventory */
1193: IF (p_subinventory IS NOT NULL) THEN
1194: l_sub.secondary_inventory_name := p_subinventory;
1195: l_result := inv_validate.subinventory(l_sub, l_org);
1196:
1197: IF (l_result = inv_validate.f) THEN
1198: IF (l_debug = 1) THEN
1199: mdebug(p_subinventory || ' Invalid Subinventory', 1);
1193: IF (p_subinventory IS NOT NULL) THEN
1194: l_sub.secondary_inventory_name := p_subinventory;
1195: l_result := inv_validate.subinventory(l_sub, l_org);
1196:
1197: IF (l_result = inv_validate.f) THEN
1198: IF (l_debug = 1) THEN
1199: mdebug(p_subinventory || ' Invalid Subinventory', 1);
1200: END IF;
1201: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SUB');
1216: RAISE fnd_api.g_exc_error;
1217: END IF;
1218:
1219: l_locator.inventory_location_id := p_locator_id;
1220: l_result := inv_validate.validatelocator(l_locator, l_org, l_sub);
1221:
1222: IF (l_result = inv_validate.f) THEN
1223: IF (l_debug = 1) THEN
1224: mdebug(p_locator_id || ' is an invalid locator', 1);
1218:
1219: l_locator.inventory_location_id := p_locator_id;
1220: l_result := inv_validate.validatelocator(l_locator, l_org, l_sub);
1221:
1222: IF (l_result = inv_validate.f) THEN
1223: IF (l_debug = 1) THEN
1224: mdebug(p_locator_id || ' is an invalid locator', 1);
1225: END IF;
1226: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOC');
1232:
1233: /* Validate Container Item */
1234: IF (p_container_item_id IS NOT NULL) THEN
1235: l_container_item.inventory_item_id := p_container_item_id;
1236: l_result := inv_validate.inventory_item(l_container_item, l_org);
1237:
1238: IF (l_result = inv_validate.f) THEN
1239: IF (l_debug = 1) THEN
1240: mdebug(p_container_item_id || ' is an invalid container item', 1);
1234: IF (p_container_item_id IS NOT NULL) THEN
1235: l_container_item.inventory_item_id := p_container_item_id;
1236: l_result := inv_validate.inventory_item(l_container_item, l_org);
1237:
1238: IF (l_result = inv_validate.f) THEN
1239: IF (l_debug = 1) THEN
1240: mdebug(p_container_item_id || ' is an invalid container item', 1);
1241: END IF;
1242: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ITEM');
1257: /* Validate Revision */
1258: IF (p_container_item_id IS NOT NULL) THEN
1259: IF (l_container_item.revision_qty_control_code = 2) THEN
1260: IF (p_revision IS NOT NULL) THEN
1261: l_result := inv_validate.revision(p_revision, l_org, l_container_item);
1262:
1263: IF (l_result = inv_validate.f) THEN
1264: IF (l_debug = 1) THEN
1265: mdebug(p_revision || ' is an invalid Revision', 1);
1259: IF (l_container_item.revision_qty_control_code = 2) THEN
1260: IF (p_revision IS NOT NULL) THEN
1261: l_result := inv_validate.revision(p_revision, l_org, l_container_item);
1262:
1263: IF (l_result = inv_validate.f) THEN
1264: IF (l_debug = 1) THEN
1265: mdebug(p_revision || ' is an invalid Revision', 1);
1266: END IF;
1267: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_REV');
1284: IF (p_container_item_id IS NOT NULL) THEN
1285: IF (l_container_item.lot_control_code = 2) THEN
1286: IF (p_lot_number IS NOT NULL) THEN
1287: l_lot.lot_number := p_lot_number;
1288: l_result := inv_validate.lot_number(l_lot, l_org, l_container_item, l_sub, l_locator, p_revision);
1289:
1290: IF (l_result = inv_validate.f) THEN
1291: IF (l_debug = 1) THEN
1292: mdebug(p_lot_number || ' is an invalid lot', 1);
1286: IF (p_lot_number IS NOT NULL) THEN
1287: l_lot.lot_number := p_lot_number;
1288: l_result := inv_validate.lot_number(l_lot, l_org, l_container_item, l_sub, l_locator, p_revision);
1289:
1290: IF (l_result = inv_validate.f) THEN
1291: IF (l_debug = 1) THEN
1292: mdebug(p_lot_number || ' is an invalid lot', 1);
1293: END IF;
1294: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOT');
1311: IF (p_container_item_id IS NOT NULL) THEN
1312: IF (l_container_item.serial_number_control_code <> 1) THEN
1313: IF (p_serial_number IS NOT NULL) THEN
1314: l_serial.serial_number := p_serial_number;
1315: l_result := inv_validate.validate_serial(l_serial, l_org, l_container_item, l_sub, l_lot, l_locator, p_revision);
1316:
1317: IF (l_result = inv_validate.f) THEN
1318: IF (l_debug = 1) THEN
1319: mdebug(l_serial.serial_number || ' is an invalid Serial Number', 1);
1313: IF (p_serial_number IS NOT NULL) THEN
1314: l_serial.serial_number := p_serial_number;
1315: l_result := inv_validate.validate_serial(l_serial, l_org, l_container_item, l_sub, l_lot, l_locator, p_revision);
1316:
1317: IF (l_result = inv_validate.f) THEN
1318: IF (l_debug = 1) THEN
1319: mdebug(l_serial.serial_number || ' is an invalid Serial Number', 1);
1320: END IF;
1321: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SER');
1347: END IF;
1348:
1349: /* Validate Cost Group */
1350: IF (p_cost_group_id IS NOT NULL) THEN
1351: l_result := inv_validate.cost_group(p_cost_group_id, p_organization_id);
1352:
1353: IF (l_result = inv_validate.f) THEN
1354: IF (l_debug = 1) THEN
1355: mdebug(p_cost_group_id || 'is an invalid cost group', 1);
1349: /* Validate Cost Group */
1350: IF (p_cost_group_id IS NOT NULL) THEN
1351: l_result := inv_validate.cost_group(p_cost_group_id, p_organization_id);
1352:
1353: IF (l_result = inv_validate.f) THEN
1354: IF (l_debug = 1) THEN
1355: mdebug(p_cost_group_id || 'is an invalid cost group', 1);
1356: END IF;
1357: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_CST_GRP');
1443: ) IS
1444: l_api_name CONSTANT VARCHAR2(30) := 'Modify_LPN';
1445: l_api_version CONSTANT NUMBER := 1.0;
1446: l_lpn lpn;
1447: l_container_item inv_validate.item;
1448: l_parent_item inv_validate.item;
1449: l_org inv_validate.org;
1450: l_sub inv_validate.sub;
1451: l_locator inv_validate.LOCATOR;
1444: l_api_name CONSTANT VARCHAR2(30) := 'Modify_LPN';
1445: l_api_version CONSTANT NUMBER := 1.0;
1446: l_lpn lpn;
1447: l_container_item inv_validate.item;
1448: l_parent_item inv_validate.item;
1449: l_org inv_validate.org;
1450: l_sub inv_validate.sub;
1451: l_locator inv_validate.LOCATOR;
1452: l_result NUMBER;
1445: l_api_version CONSTANT NUMBER := 1.0;
1446: l_lpn lpn;
1447: l_container_item inv_validate.item;
1448: l_parent_item inv_validate.item;
1449: l_org inv_validate.org;
1450: l_sub inv_validate.sub;
1451: l_locator inv_validate.LOCATOR;
1452: l_result NUMBER;
1453: l_change_in_weight NUMBER := 0;
1446: l_lpn lpn;
1447: l_container_item inv_validate.item;
1448: l_parent_item inv_validate.item;
1449: l_org inv_validate.org;
1450: l_sub inv_validate.sub;
1451: l_locator inv_validate.LOCATOR;
1452: l_result NUMBER;
1453: l_change_in_weight NUMBER := 0;
1454: l_change_in_weight_uom VARCHAR2(3);
1447: l_container_item inv_validate.item;
1448: l_parent_item inv_validate.item;
1449: l_org inv_validate.org;
1450: l_sub inv_validate.sub;
1451: l_locator inv_validate.LOCATOR;
1452: l_result NUMBER;
1453: l_change_in_weight NUMBER := 0;
1454: l_change_in_weight_uom VARCHAR2(3);
1455: l_location_changed NUMBER := 1;
1537: l_lpn.lpn_id := p_lpn.lpn_id;
1538: l_lpn.license_plate_number := NULL;
1539: l_result := validate_lpn(l_lpn);
1540:
1541: IF (l_result = inv_validate.f) THEN
1542: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LPN');
1543: fnd_msg_pub.ADD;
1544: RAISE fnd_api.g_exc_error;
1545: END IF;
1546:
1547: /* Validate Organization */
1548: IF (p_lpn.organization_id IS NOT NULL) THEN
1549: l_org.organization_id := p_lpn.organization_id;
1550: l_result := inv_validate.ORGANIZATION(l_org);
1551:
1552: IF (l_result = inv_validate.f) THEN
1553: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
1554: fnd_msg_pub.ADD;
1548: IF (p_lpn.organization_id IS NOT NULL) THEN
1549: l_org.organization_id := p_lpn.organization_id;
1550: l_result := inv_validate.ORGANIZATION(l_org);
1551:
1552: IF (l_result = inv_validate.f) THEN
1553: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
1554: fnd_msg_pub.ADD;
1555: RAISE fnd_api.g_exc_error;
1556: END IF;
1558:
1559: /* Validate Subinventory */
1560: IF (p_lpn.subinventory_code IS NOT NULL) THEN
1561: l_sub.secondary_inventory_name := p_lpn.subinventory_code;
1562: l_result := inv_validate.subinventory(l_sub, l_org);
1563:
1564: IF (l_result = inv_validate.f) THEN
1565: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SUB');
1566: fnd_msg_pub.ADD;
1560: IF (p_lpn.subinventory_code IS NOT NULL) THEN
1561: l_sub.secondary_inventory_name := p_lpn.subinventory_code;
1562: l_result := inv_validate.subinventory(l_sub, l_org);
1563:
1564: IF (l_result = inv_validate.f) THEN
1565: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SUB');
1566: fnd_msg_pub.ADD;
1567: RAISE fnd_api.g_exc_error;
1568: END IF;
1577: RAISE fnd_api.g_exc_error;
1578: END IF;
1579:
1580: l_locator.inventory_location_id := p_lpn.locator_id;
1581: l_result := inv_validate.validatelocator(l_locator, l_org, l_sub);
1582:
1583: IF (l_result = inv_validate.f) THEN
1584: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOC');
1585: fnd_msg_pub.ADD;
1579:
1580: l_locator.inventory_location_id := p_lpn.locator_id;
1581: l_result := inv_validate.validatelocator(l_locator, l_org, l_sub);
1582:
1583: IF (l_result = inv_validate.f) THEN
1584: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOC');
1585: fnd_msg_pub.ADD;
1586: RAISE fnd_api.g_exc_error;
1587: END IF;
1590:
1591: /* Validate Container Item */
1592: IF (p_lpn.inventory_item_id IS NOT NULL) THEN
1593: l_container_item.inventory_item_id := p_lpn.inventory_item_id;
1594: l_result := inv_validate.inventory_item(l_container_item, l_org);
1595:
1596: IF (l_result = inv_validate.f) THEN
1597: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ITEM');
1598: fnd_msg_pub.ADD;
1592: IF (p_lpn.inventory_item_id IS NOT NULL) THEN
1593: l_container_item.inventory_item_id := p_lpn.inventory_item_id;
1594: l_result := inv_validate.inventory_item(l_container_item, l_org);
1595:
1596: IF (l_result = inv_validate.f) THEN
1597: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ITEM');
1598: fnd_msg_pub.ADD;
1599: RAISE fnd_api.g_exc_error;
1600: END IF;
1788: l_lpn.lpn_id := p_lpn_id;
1789: l_lpn.license_plate_number := NULL;
1790: l_result := validate_lpn(l_lpn);
1791:
1792: IF (l_result = inv_validate.f) THEN
1793: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LPN');
1794: fnd_msg_pub.ADD;
1795: RAISE fnd_api.g_exc_error;
1796: END IF;
1904: l_api_name CONSTANT VARCHAR2(30) := 'PackUnpack_Container';
1905: l_api_version CONSTANT NUMBER := 1.0;
1906: l_lpn lpn;
1907: l_content_lpn lpn;
1908: l_content_item inv_validate.item;
1909: l_org inv_validate.org;
1910: l_sub inv_validate.sub;
1911: l_locator inv_validate.LOCATOR;
1912: l_lot inv_validate.lot;
1905: l_api_version CONSTANT NUMBER := 1.0;
1906: l_lpn lpn;
1907: l_content_lpn lpn;
1908: l_content_item inv_validate.item;
1909: l_org inv_validate.org;
1910: l_sub inv_validate.sub;
1911: l_locator inv_validate.LOCATOR;
1912: l_lot inv_validate.lot;
1913: l_serial inv_validate.serial;
1906: l_lpn lpn;
1907: l_content_lpn lpn;
1908: l_content_item inv_validate.item;
1909: l_org inv_validate.org;
1910: l_sub inv_validate.sub;
1911: l_locator inv_validate.LOCATOR;
1912: l_lot inv_validate.lot;
1913: l_serial inv_validate.serial;
1914: l_current_serial VARCHAR2(30) := p_from_serial_number;
1907: l_content_lpn lpn;
1908: l_content_item inv_validate.item;
1909: l_org inv_validate.org;
1910: l_sub inv_validate.sub;
1911: l_locator inv_validate.LOCATOR;
1912: l_lot inv_validate.lot;
1913: l_serial inv_validate.serial;
1914: l_current_serial VARCHAR2(30) := p_from_serial_number;
1915: l_result NUMBER;
1908: l_content_item inv_validate.item;
1909: l_org inv_validate.org;
1910: l_sub inv_validate.sub;
1911: l_locator inv_validate.LOCATOR;
1912: l_lot inv_validate.lot;
1913: l_serial inv_validate.serial;
1914: l_current_serial VARCHAR2(30) := p_from_serial_number;
1915: l_result NUMBER;
1916: l_serial_summary_entry NUMBER := 2;
1909: l_org inv_validate.org;
1910: l_sub inv_validate.sub;
1911: l_locator inv_validate.LOCATOR;
1912: l_lot inv_validate.lot;
1913: l_serial inv_validate.serial;
1914: l_current_serial VARCHAR2(30) := p_from_serial_number;
1915: l_result NUMBER;
1916: l_serial_summary_entry NUMBER := 2;
1917: l_unit_weight NUMBER;
2113: l_lpn.lpn_id := p_lpn_id;
2114: l_lpn.license_plate_number := NULL;
2115: l_result := validate_lpn(l_lpn, 1);
2116:
2117: IF (l_result = inv_validate.f) THEN
2118: IF (l_debug = 1) THEN
2119: mdebug(p_lpn_id || 'is an invalid lpn_id', G_ERROR);
2120: END IF;
2121: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LPN');
2129: IF (p_content_lpn_id IS NOT NULL) THEN
2130: l_content_lpn.lpn_id := p_content_lpn_id;
2131: l_result := validate_lpn(l_content_lpn);
2132:
2133: IF (l_result = inv_validate.f) THEN
2134: IF (l_debug = 1) THEN
2135: mdebug(p_content_lpn_id || 'is and invalid content lpn id', G_ERROR);
2136: END IF;
2137: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_CONTENT_LPN');
2154: END IF;
2155:
2156: /* Validate Organization ID */
2157: l_org.organization_id := p_organization_id;
2158: l_result := inv_validate.ORGANIZATION(l_org);
2159:
2160: IF (l_result = inv_validate.f) THEN
2161: IF (l_debug = 1) THEN
2162: mdebug(p_organization_id || 'is not a valid org_id', G_ERROR);
2156: /* Validate Organization ID */
2157: l_org.organization_id := p_organization_id;
2158: l_result := inv_validate.ORGANIZATION(l_org);
2159:
2160: IF (l_result = inv_validate.f) THEN
2161: IF (l_debug = 1) THEN
2162: mdebug(p_organization_id || 'is not a valid org_id', G_ERROR);
2163: END IF;
2164: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
2168:
2169: /* Validate Content Item */
2170: IF (p_content_item_id IS NOT NULL) THEN
2171: l_content_item.inventory_item_id := p_content_item_id;
2172: l_result := inv_validate.inventory_item(l_content_item, l_org);
2173:
2174: IF (l_result = inv_validate.f) THEN
2175: IF (l_debug = 1) THEN
2176: mdebug(p_content_item_id || 'is not a valid content item id', G_ERROR);
2170: IF (p_content_item_id IS NOT NULL) THEN
2171: l_content_item.inventory_item_id := p_content_item_id;
2172: l_result := inv_validate.inventory_item(l_content_item, l_org);
2173:
2174: IF (l_result = inv_validate.f) THEN
2175: IF (l_debug = 1) THEN
2176: mdebug(p_content_item_id || 'is not a valid content item id', G_ERROR);
2177: END IF;
2178: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_CONTENT_ITEM');
2225:
2226: /* Validate Subinventory */
2227: IF (p_subinventory IS NOT NULL) THEN
2228: l_sub.secondary_inventory_name := p_subinventory;
2229: l_result := inv_validate.subinventory(l_sub, l_org);
2230:
2231: IF (l_result = inv_validate.f) THEN
2232: IF (l_debug = 1) THEN
2233: mdebug(p_subinventory || 'is an invalid sub', G_ERROR);
2227: IF (p_subinventory IS NOT NULL) THEN
2228: l_sub.secondary_inventory_name := p_subinventory;
2229: l_result := inv_validate.subinventory(l_sub, l_org);
2230:
2231: IF (l_result = inv_validate.f) THEN
2232: IF (l_debug = 1) THEN
2233: mdebug(p_subinventory || 'is an invalid sub', G_ERROR);
2234: END IF;
2235: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SUB');
2267: RAISE fnd_api.g_exc_error;
2268: END IF;
2269:
2270: l_locator.inventory_location_id := p_locator_id;
2271: l_result := inv_validate.validatelocator(l_locator, l_org, l_sub);
2272:
2273: IF (l_result = inv_validate.f) THEN
2274: IF (l_debug = 1) THEN
2275: mdebug(p_locator_id || ' is an invalid locator_id', G_ERROR);
2269:
2270: l_locator.inventory_location_id := p_locator_id;
2271: l_result := inv_validate.validatelocator(l_locator, l_org, l_sub);
2272:
2273: IF (l_result = inv_validate.f) THEN
2274: IF (l_debug = 1) THEN
2275: mdebug(p_locator_id || ' is an invalid locator_id', G_ERROR);
2276: END IF;
2277: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOC');
2286: /* Validate Revision */
2287: IF (p_content_item_id IS NOT NULL) THEN
2288: IF (l_content_item.revision_qty_control_code = 2) THEN
2289: IF (p_revision IS NOT NULL) THEN
2290: l_result := inv_validate.revision(p_revision, l_org, l_content_item);
2291:
2292: IF (l_result = inv_validate.f) THEN
2293: IF (l_debug = 1) THEN
2294: mdebug(p_revision || ' is an invalid revision', G_ERROR);
2288: IF (l_content_item.revision_qty_control_code = 2) THEN
2289: IF (p_revision IS NOT NULL) THEN
2290: l_result := inv_validate.revision(p_revision, l_org, l_content_item);
2291:
2292: IF (l_result = inv_validate.f) THEN
2293: IF (l_debug = 1) THEN
2294: mdebug(p_revision || ' is an invalid revision', G_ERROR);
2295: END IF;
2296: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_REV');
2329: AND lot_number = p_lot_number
2330: AND inventory_item_id = p_content_item_id;
2331:
2332: IF l_temp_count > 0 THEN
2333: l_result := inv_validate.lot_number(l_lot, l_org, l_content_item, l_sub, l_locator, p_revision);
2334:
2335: IF (l_result = inv_validate.f) THEN
2336: IF (l_debug = 1) THEN
2337: mdebug(p_lot_number || ' is an invalid lot number', G_ERROR);
2331:
2332: IF l_temp_count > 0 THEN
2333: l_result := inv_validate.lot_number(l_lot, l_org, l_content_item, l_sub, l_locator, p_revision);
2334:
2335: IF (l_result = inv_validate.f) THEN
2336: IF (l_debug = 1) THEN
2337: mdebug(p_lot_number || ' is an invalid lot number', G_ERROR);
2338: END IF;
2339: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LOT');
2463: AND current_status = 6;
2464:
2465: IF ((p_subinventory IS NOT NULL) AND (l_dynamic_status = 0)) THEN
2466: l_serial.serial_number := l_current_serial;
2467: l_result := inv_validate.validate_serial(l_serial, l_org, l_content_item, l_sub, l_lot, l_locator, p_revision);
2468:
2469: IF (l_result = inv_validate.f) THEN
2470: IF (l_debug = 1) THEN
2471: mdebug(l_current_serial || ' is not a valid serial number', G_ERROR);
2465: IF ((p_subinventory IS NOT NULL) AND (l_dynamic_status = 0)) THEN
2466: l_serial.serial_number := l_current_serial;
2467: l_result := inv_validate.validate_serial(l_serial, l_org, l_content_item, l_sub, l_lot, l_locator, p_revision);
2468:
2469: IF (l_result = inv_validate.f) THEN
2470: IF (l_debug = 1) THEN
2471: mdebug(l_current_serial || ' is not a valid serial number', G_ERROR);
2472: END IF;
2473: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_SER');
2527: END IF;
2528:
2529: /* Validate content item UOM */
2530: IF (p_content_item_id IS NOT NULL) THEN
2531: l_result := inv_validate.uom(p_uom, l_org, l_content_item);
2532:
2533: IF (l_result = inv_validate.f) THEN
2534: IF (l_debug = 1) THEN
2535: mdebug(p_uom || ' is an invalid UOM', G_ERROR);
2529: /* Validate content item UOM */
2530: IF (p_content_item_id IS NOT NULL) THEN
2531: l_result := inv_validate.uom(p_uom, l_org, l_content_item);
2532:
2533: IF (l_result = inv_validate.f) THEN
2534: IF (l_debug = 1) THEN
2535: mdebug(p_uom || ' is an invalid UOM', G_ERROR);
2536: END IF;
2537: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_UOM');
2563: END IF;
2564:
2565: /* Validate Cost Group */
2566: IF (p_cost_group_id IS NOT NULL) THEN
2567: l_result := inv_validate.cost_group(p_cost_group_id, p_organization_id);
2568:
2569: IF (l_result = inv_validate.f) THEN
2570: IF (l_debug = 1) THEN
2571: mdebug(p_cost_group_id || ' is an invalid cost group is', G_ERROR);
2565: /* Validate Cost Group */
2566: IF (p_cost_group_id IS NOT NULL) THEN
2567: l_result := inv_validate.cost_group(p_cost_group_id, p_organization_id);
2568:
2569: IF (l_result = inv_validate.f) THEN
2570: IF (l_debug = 1) THEN
2571: mdebug(p_cost_group_id || ' is an invalid cost group is', G_ERROR);
2572: END IF;
2573: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_CST_GRP');
2681: l_api_name CONSTANT VARCHAR2(30) := 'pack_prepack_container';
2682: l_api_version CONSTANT NUMBER := 1.0;
2683: l_lpn lpn;
2684: l_content_lpn lpn;
2685: l_content_item inv_validate.item;
2686: l_org inv_validate.org;
2687: l_lot inv_validate.lot;
2688: l_serial inv_validate.serial;
2689: l_current_serial VARCHAR2(30) := p_from_serial_number;
2682: l_api_version CONSTANT NUMBER := 1.0;
2683: l_lpn lpn;
2684: l_content_lpn lpn;
2685: l_content_item inv_validate.item;
2686: l_org inv_validate.org;
2687: l_lot inv_validate.lot;
2688: l_serial inv_validate.serial;
2689: l_current_serial VARCHAR2(30) := p_from_serial_number;
2690: l_result NUMBER;
2683: l_lpn lpn;
2684: l_content_lpn lpn;
2685: l_content_item inv_validate.item;
2686: l_org inv_validate.org;
2687: l_lot inv_validate.lot;
2688: l_serial inv_validate.serial;
2689: l_current_serial VARCHAR2(30) := p_from_serial_number;
2690: l_result NUMBER;
2691: l_serial_summary_entry NUMBER := 2;
2684: l_content_lpn lpn;
2685: l_content_item inv_validate.item;
2686: l_org inv_validate.org;
2687: l_lot inv_validate.lot;
2688: l_serial inv_validate.serial;
2689: l_current_serial VARCHAR2(30) := p_from_serial_number;
2690: l_result NUMBER;
2691: l_serial_summary_entry NUMBER := 2;
2692:
2748: l_lpn.lpn_id := p_lpn_id;
2749: l_lpn.license_plate_number := NULL;
2750: l_result := validate_lpn(l_lpn);
2751:
2752: IF (l_result = inv_validate.f) THEN
2753: IF (l_debug = 1) THEN
2754: mdebug(p_lpn_id || 'is an invalid lpn_id', 1);
2755: END IF;
2756: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_LPN');
2759: END IF;
2760:
2761: /* Validate Organization ID */
2762: l_org.organization_id := p_organization_id;
2763: l_result := inv_validate.ORGANIZATION(l_org);
2764:
2765: IF (l_result = inv_validate.f) THEN
2766: IF (l_debug = 1) THEN
2767: mdebug(p_organization_id || 'is not a valid org_id', 1);
2761: /* Validate Organization ID */
2762: l_org.organization_id := p_organization_id;
2763: l_result := inv_validate.ORGANIZATION(l_org);
2764:
2765: IF (l_result = inv_validate.f) THEN
2766: IF (l_debug = 1) THEN
2767: mdebug(p_organization_id || 'is not a valid org_id', 1);
2768: END IF;
2769: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
2773:
2774: /* Validate Content Item */
2775: IF (p_content_item_id IS NOT NULL) THEN
2776: l_content_item.inventory_item_id := p_content_item_id;
2777: l_result := inv_validate.inventory_item(l_content_item, l_org);
2778:
2779: IF (l_result = inv_validate.f) THEN
2780: IF (l_debug = 1) THEN
2781: mdebug(p_content_item_id || 'is not a valid content item id', 1);
2775: IF (p_content_item_id IS NOT NULL) THEN
2776: l_content_item.inventory_item_id := p_content_item_id;
2777: l_result := inv_validate.inventory_item(l_content_item, l_org);
2778:
2779: IF (l_result = inv_validate.f) THEN
2780: IF (l_debug = 1) THEN
2781: mdebug(p_content_item_id || 'is not a valid content item id', 1);
2782: END IF;
2783: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_CONTENT_ITEM');
2789: /* Validate Revision */
2790: IF (p_content_item_id IS NOT NULL) THEN
2791: IF (l_content_item.revision_qty_control_code = 2) THEN
2792: IF (p_revision IS NOT NULL) THEN
2793: l_result := inv_validate.revision(p_revision, l_org, l_content_item);
2794:
2795: IF (l_result = inv_validate.f) THEN
2796: IF (l_debug = 1) THEN
2797: mdebug(p_revision || ' is an invalid revision', 1);
2791: IF (l_content_item.revision_qty_control_code = 2) THEN
2792: IF (p_revision IS NOT NULL) THEN
2793: l_result := inv_validate.revision(p_revision, l_org, l_content_item);
2794:
2795: IF (l_result = inv_validate.f) THEN
2796: IF (l_debug = 1) THEN
2797: mdebug(p_revision || ' is an invalid revision', 1);
2798: END IF;
2799: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_REV');
2949: END IF;
2950:
2951: /* Validate content item UOM */
2952: IF (p_content_item_id IS NOT NULL) THEN
2953: l_result := inv_validate.uom(p_uom, l_org, l_content_item);
2954:
2955: IF (l_result = inv_validate.f) THEN
2956: IF (l_debug = 1) THEN
2957: mdebug(p_uom || ' is an invalid UOM', 1);
2951: /* Validate content item UOM */
2952: IF (p_content_item_id IS NOT NULL) THEN
2953: l_result := inv_validate.uom(p_uom, l_org, l_content_item);
2954:
2955: IF (l_result = inv_validate.f) THEN
2956: IF (l_debug = 1) THEN
2957: mdebug(p_uom || ' is an invalid UOM', 1);
2958: END IF;
2959: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_UOM');
3290: l_msgdata VARCHAR2(1000);
3291:
3292: -- Variables for validation
3293: l_result NUMBER;
3294: l_org inv_validate.org;
3295: l_lpn LPN;
3296:
3297: BEGIN
3298: -- Standard call to check for call compatibility.
3316:
3317: l_progress := '100';
3318: -- Validate Organization ID
3319: l_org.organization_id := p_organization_id;
3320: l_result := inv_validate.ORGANIZATION(l_org);
3321:
3322: IF ( l_result = INV_Validate.F ) THEN
3323: IF ( l_debug = 1 ) THEN
3324: mdebug(p_organization_id || ' is not a valid org id', G_ERROR);
3318: -- Validate Organization ID
3319: l_org.organization_id := p_organization_id;
3320: l_result := inv_validate.ORGANIZATION(l_org);
3321:
3322: IF ( l_result = INV_Validate.F ) THEN
3323: IF ( l_debug = 1 ) THEN
3324: mdebug(p_organization_id || ' is not a valid org id', G_ERROR);
3325: END IF;
3326: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
3332: -- Validate LPN
3333: l_lpn.lpn_id := p_outermost_lpn_id;
3334: l_result := Validate_LPN(l_lpn);
3335:
3336: IF ( l_result = INV_Validate.F ) THEN
3337: IF ( l_debug = 1 ) THEN
3338: mdebug(p_outermost_lpn_id || ' is an invalid lpn id', G_ERROR);
3339: END IF;
3340: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_LPN');
3414: l_msgdata VARCHAR2(1000);
3415:
3416: -- Variables for validation
3417: l_result NUMBER;
3418: l_org inv_validate.org;
3419: l_lpn LPN;
3420:
3421: BEGIN
3422: -- Standard call to check for call compatibility.
3440:
3441: l_progress := '100';
3442: -- Validate Organization ID
3443: l_org.organization_id := p_organization_id;
3444: l_result := inv_validate.ORGANIZATION(l_org);
3445:
3446: IF ( l_result = INV_Validate.F ) THEN
3447: IF ( l_debug = 1 ) THEN
3448: mdebug(p_organization_id || ' is not a valid org id', G_ERROR);
3442: -- Validate Organization ID
3443: l_org.organization_id := p_organization_id;
3444: l_result := inv_validate.ORGANIZATION(l_org);
3445:
3446: IF ( l_result = INV_Validate.F ) THEN
3447: IF ( l_debug = 1 ) THEN
3448: mdebug(p_organization_id || ' is not a valid org id', G_ERROR);
3449: END IF;
3450: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
3456: -- Validate LPN
3457: l_lpn.lpn_id := p_outermost_lpn_id;
3458: l_result := Validate_LPN(l_lpn);
3459:
3460: IF ( l_result = INV_Validate.F ) THEN
3461: IF ( l_debug = 1 ) THEN
3462: mdebug(p_outermost_lpn_id || ' is an invalid lpn id', G_ERROR);
3463: END IF;
3464: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_LPN');
3538: l_msgdata VARCHAR2(1000);
3539:
3540: -- Variables for validation
3541: l_result NUMBER;
3542: l_org inv_validate.org;
3543: l_lpn LPN;
3544:
3545: BEGIN
3546: -- Standard call to check for call compatibility.
3564:
3565: l_progress := '100';
3566: -- Validate Organization ID
3567: l_org.organization_id := p_organization_id;
3568: l_result := inv_validate.ORGANIZATION(l_org);
3569:
3570: IF ( l_result = INV_Validate.F ) THEN
3571: IF ( l_debug = 1 ) THEN
3572: mdebug(p_organization_id || ' is not a valid org id', G_ERROR);
3566: -- Validate Organization ID
3567: l_org.organization_id := p_organization_id;
3568: l_result := inv_validate.ORGANIZATION(l_org);
3569:
3570: IF ( l_result = INV_Validate.F ) THEN
3571: IF ( l_debug = 1 ) THEN
3572: mdebug(p_organization_id || ' is not a valid org id', G_ERROR);
3573: END IF;
3574: fnd_message.set_name('WMS', 'WMS_CONT_INVALID_ORG');
3580: -- Validate LPN
3581: l_lpn.lpn_id := p_outermost_lpn_id;
3582: l_result := Validate_LPN(l_lpn);
3583:
3584: IF ( l_result = INV_Validate.F ) THEN
3585: IF ( l_debug = 1 ) THEN
3586: mdebug(p_outermost_lpn_id || ' is an invalid lpn id', G_ERROR);
3587: END IF;
3588: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_LPN');