41: WHEN OTHERS
42: THEN
43: fnd_message.set_name ('WMS', 'WMS_INSTALL_CHK_ERROR');
44: fnd_msg_pub.ADD;
45: RAISE fnd_api.g_exc_unexpected_error;
46: END;
47:
48: SELECT wsm_enabled_flag
49: INTO x_wsm_enabled
61: WHEN OTHERS
62: THEN
63: fnd_message.set_name ('WMS', 'WMS_INSTALL_CHK_ERROR');
64: fnd_msg_pub.ADD;
65: RAISE fnd_api.g_exc_unexpected_error;
66: END;
67:
68: x_return_status := fnd_api.g_ret_sts_success;
69: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
64: fnd_msg_pub.ADD;
65: RAISE fnd_api.g_exc_unexpected_error;
66: END;
67:
68: x_return_status := fnd_api.g_ret_sts_success;
69: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
70: EXCEPTION
71: WHEN NO_DATA_FOUND
72: THEN
71: WHEN NO_DATA_FOUND
72: THEN
73: fnd_message.set_name ('INV', 'INV_INVALID_ORG');
74: fnd_msg_pub.ADD;
75: x_return_status := fnd_api.g_ret_sts_error;
76: fnd_msg_pub.count_and_get (p_count => x_msg_count
77: , p_data => x_msg_data);
78: WHEN fnd_api.g_exc_error
79: THEN
74: fnd_msg_pub.ADD;
75: x_return_status := fnd_api.g_ret_sts_error;
76: fnd_msg_pub.count_and_get (p_count => x_msg_count
77: , p_data => x_msg_data);
78: WHEN fnd_api.g_exc_error
79: THEN
80: x_return_status := fnd_api.g_ret_sts_error;
81: fnd_msg_pub.count_and_get (p_count => x_msg_count
82: , p_data => x_msg_data);
76: fnd_msg_pub.count_and_get (p_count => x_msg_count
77: , p_data => x_msg_data);
78: WHEN fnd_api.g_exc_error
79: THEN
80: x_return_status := fnd_api.g_ret_sts_error;
81: fnd_msg_pub.count_and_get (p_count => x_msg_count
82: , p_data => x_msg_data);
83: WHEN fnd_api.g_exc_unexpected_error
84: THEN
79: THEN
80: x_return_status := fnd_api.g_ret_sts_error;
81: fnd_msg_pub.count_and_get (p_count => x_msg_count
82: , p_data => x_msg_data);
83: WHEN fnd_api.g_exc_unexpected_error
84: THEN
85: x_return_status := fnd_api.g_ret_sts_error;
86: fnd_msg_pub.count_and_get (p_count => x_msg_count
87: , p_data => x_msg_data);
81: fnd_msg_pub.count_and_get (p_count => x_msg_count
82: , p_data => x_msg_data);
83: WHEN fnd_api.g_exc_unexpected_error
84: THEN
85: x_return_status := fnd_api.g_ret_sts_error;
86: fnd_msg_pub.count_and_get (p_count => x_msg_count
87: , p_data => x_msg_data);
88: WHEN OTHERS
89: THEN
86: fnd_msg_pub.count_and_get (p_count => x_msg_count
87: , p_data => x_msg_data);
88: WHEN OTHERS
89: THEN
90: x_return_status := fnd_api.g_ret_sts_unexp_error;
91:
92: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
93: THEN
94: fnd_msg_pub.add_exc_msg (g_pkg_name, 'Get_Org_info');
226: THEN
227: x_validation_status := 'N';
228: fnd_message.set_name ('INV', 'INV_MISSING_REQUIRED_PARAMETER');
229: fnd_msg_pub.ADD;
230: RAISE fnd_api.g_exc_error;
231: END IF;
232:
233: l_start_count := p_st_lot_num_tbl.COUNT;
234: l_result_count := p_rs_lot_num_tbl.COUNT;
255:
256: fnd_message.set_name ('INV', 'INV_TOO_MANY_LOT_SPLIT');
257: fnd_msg_pub.ADD;
258: x_validation_status := 'N';
259: RAISE fnd_api.g_exc_error;
260: END IF;
261:
262: /*Bug#9317064 The below validation is incorrect as the records,
263: * p_st_quantity and p_rs_quantity both will have the split quantity */
268: -- means this is not a partial split.
269: fnd_message.set_name ('INV', 'INV_MIN_LOT_SPLIT');
270: fnd_msg_pub.ADD;
271: x_validation_status := 'N';
272: RAISE fnd_api.g_exc_error;
273: END IF;
274: END IF; */
275:
276:
280: THEN
281: fnd_message.set_name ('INV', 'INV_LOT_TRX_DIFF_ORG');
282: fnd_msg_pub.ADD;
283: x_validation_status := 'N';
284: RAISE fnd_api.g_exc_error;
285: END IF;
286:
287: IF (p_rs_item_id_tbl (i) <> p_st_item_id_tbl (1))
288: THEN
288: THEN
289: fnd_message.set_name ('INV', 'INV_LOT_TRX_DIFF_ITEM');
290: fnd_msg_pub.ADD;
291: x_validation_status := 'N';
292: RAISE fnd_api.g_exc_error;
293: END IF;
294:
295: IF (NVL (p_rs_revision_tbl (i), 'NULL') <>
296: NVL (p_rs_revision_tbl (1), 'NULL')
298: THEN
299: fnd_message.set_name ('INV', 'INV_LOT_TRX_DIFF_REVISION');
300: fnd_msg_pub.ADD;
301: x_validation_status := 'N';
302: RAISE fnd_api.g_exc_error;
303: END IF;
304:
305: IF (NVL (TO_CHAR (p_rs_lot_exp_tbl (i), 'DD-MON-RRRR')
306: , TO_CHAR (SYSDATE, 'DD-MON-RRRR')
312: THEN
313: fnd_message.set_name ('INV', 'INV_LOT_TRX_DIFF_LOT_EXP_DATE');
314: fnd_msg_pub.ADD;
315: x_validation_status := 'N';
316: RAISE fnd_api.g_exc_error;
317: END IF;
318: END LOOP;
319:
320: --basically checks if lot split is allowed or not
327: , p_inventory_item_id => p_st_item_id_tbl (1)
328: , p_organization_id => p_st_org_id_tbl (1)
329: );
330:
331: IF (x_return_status = fnd_api.g_ret_sts_error)
332: THEN
333: RAISE fnd_api.g_exc_error;
334: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
335: THEN
329: );
330:
331: IF (x_return_status = fnd_api.g_ret_sts_error)
332: THEN
333: RAISE fnd_api.g_exc_error;
334: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
335: THEN
336: RAISE fnd_api.g_exc_unexpected_error;
337: END IF;
330:
331: IF (x_return_status = fnd_api.g_ret_sts_error)
332: THEN
333: RAISE fnd_api.g_exc_error;
334: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
335: THEN
336: RAISE fnd_api.g_exc_unexpected_error;
337: END IF;
338:
332: THEN
333: RAISE fnd_api.g_exc_error;
334: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
335: THEN
336: RAISE fnd_api.g_exc_unexpected_error;
337: END IF;
338:
339: --for lot split checks for lot uniqueness....if across items then no other item
340: --should have this lot number
349: , p_inventory_item_id => p_rs_item_id_tbl (1)
350: , p_organization_id => p_rs_org_id_tbl (1)
351: );
352:
353: IF (x_return_status = fnd_api.g_ret_sts_error)
354: THEN
355: RAISE fnd_api.g_exc_error;
356: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
357: THEN
351: );
352:
353: IF (x_return_status = fnd_api.g_ret_sts_error)
354: THEN
355: RAISE fnd_api.g_exc_error;
356: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
357: THEN
358: RAISE fnd_api.g_exc_unexpected_error;
359: END IF;
352:
353: IF (x_return_status = fnd_api.g_ret_sts_error)
354: THEN
355: RAISE fnd_api.g_exc_error;
356: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
357: THEN
358: RAISE fnd_api.g_exc_unexpected_error;
359: END IF;
360: ELSIF (p_transaction_type_id = inv_globals.g_type_inv_lot_translate)
354: THEN
355: RAISE fnd_api.g_exc_error;
356: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
357: THEN
358: RAISE fnd_api.g_exc_unexpected_error;
359: END IF;
360: ELSIF (p_transaction_type_id = inv_globals.g_type_inv_lot_translate)
361: THEN
362: IF (l_start_count > 1)
363: THEN
364: fnd_message.set_name ('INV', 'INV_MIN_START_LOT_TRANSLATE');
365: fnd_msg_pub.ADD;
366: x_validation_status := 'N';
367: RAISE fnd_api.g_exc_error;
368: END IF;
369:
370: IF (l_result_count > 1)
371: THEN
371: THEN
372: fnd_message.set_name ('INV', 'INV_MIN_RESULT_LOT_TRANSLATE');
373: fnd_msg_pub.ADD;
374: x_validation_status := 'N';
375: RAISE fnd_api.g_exc_error;
376: END IF;
377:
378: IF (p_rs_org_id_tbl (1) <> p_st_org_id_tbl (1))
379: THEN
379: THEN
380: fnd_message.set_name ('INV', 'INV_LOT_TRX_DIFF_ORG');
381: fnd_msg_pub.ADD;
382: x_validation_status := 'N';
383: RAISE fnd_api.g_exc_error;
384: END IF;
385:
386: /*Changes for OSFM Support for Serialized Lot Items*/
387: IF (p_st_item_id_tbl (1) <> p_rs_item_id_tbl (1))
408: THEN
409: fnd_message.set_name ('INV', 'INV_LOT_SERIAL_CODE_DIFF');
410: fnd_msg_pub.ADD;
411: x_validation_status := 'N';
412: RAISE fnd_api.g_exc_error;
413: END IF;
414: END IF;
415:
416:
436: , 'Validate_lots'
437: );
438: END IF;
439:
440: IF (x_return_status = fnd_api.g_ret_sts_error)
441: THEN
442: RAISE fnd_api.g_exc_error;
443: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
444: THEN
438: END IF;
439:
440: IF (x_return_status = fnd_api.g_ret_sts_error)
441: THEN
442: RAISE fnd_api.g_exc_error;
443: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
444: THEN
445: RAISE fnd_api.g_exc_unexpected_error;
446: END IF;
439:
440: IF (x_return_status = fnd_api.g_ret_sts_error)
441: THEN
442: RAISE fnd_api.g_exc_error;
443: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
444: THEN
445: RAISE fnd_api.g_exc_unexpected_error;
446: END IF;
447:
441: THEN
442: RAISE fnd_api.g_exc_error;
443: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
444: THEN
445: RAISE fnd_api.g_exc_unexpected_error;
446: END IF;
447:
448: validate_start_lot (x_return_status => x_return_status
449: , x_msg_count => x_msg_count
454: , p_inventory_item_id => p_st_item_id_tbl (1)
455: , p_organization_id => p_st_org_id_tbl (1)
456: );
457:
458: IF (x_return_status = fnd_api.g_ret_sts_error)
459: THEN
460: RAISE fnd_api.g_exc_error;
461: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
462: THEN
456: );
457:
458: IF (x_return_status = fnd_api.g_ret_sts_error)
459: THEN
460: RAISE fnd_api.g_exc_error;
461: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
462: THEN
463: RAISE fnd_api.g_exc_unexpected_error;
464: END IF;
457:
458: IF (x_return_status = fnd_api.g_ret_sts_error)
459: THEN
460: RAISE fnd_api.g_exc_error;
461: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
462: THEN
463: RAISE fnd_api.g_exc_unexpected_error;
464: END IF;
465:
459: THEN
460: RAISE fnd_api.g_exc_error;
461: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
462: THEN
463: RAISE fnd_api.g_exc_unexpected_error;
464: END IF;
465:
466: validate_result_lot (x_return_status => x_return_status
467: , x_msg_count => x_msg_count
473: , p_inventory_item_id => p_rs_item_id_tbl (1)
474: , p_organization_id => p_rs_org_id_tbl (1)
475: );
476:
477: IF (x_return_status = fnd_api.g_ret_sts_error)
478: THEN
479: RAISE fnd_api.g_exc_error;
480: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
481: THEN
475: );
476:
477: IF (x_return_status = fnd_api.g_ret_sts_error)
478: THEN
479: RAISE fnd_api.g_exc_error;
480: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
481: THEN
482: RAISE fnd_api.g_exc_unexpected_error;
483: END IF;
476:
477: IF (x_return_status = fnd_api.g_ret_sts_error)
478: THEN
479: RAISE fnd_api.g_exc_error;
480: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
481: THEN
482: RAISE fnd_api.g_exc_unexpected_error;
483: END IF;
484: ELSIF (p_transaction_type_id = inv_globals.g_type_inv_lot_merge)
478: THEN
479: RAISE fnd_api.g_exc_error;
480: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
481: THEN
482: RAISE fnd_api.g_exc_unexpected_error;
483: END IF;
484: ELSIF (p_transaction_type_id = inv_globals.g_type_inv_lot_merge)
485: THEN
486: IF (l_start_count < 2)
487: THEN
488: fnd_message.set_name ('INV', 'INV_MIN_START_LOT_MERGE');
489: fnd_msg_pub.ADD;
490: x_validation_status := 'N';
491: RAISE fnd_api.g_exc_error;
492: END IF;
493:
494: IF (l_result_count > 1)
495: THEN
495: THEN
496: fnd_message.set_name ('INV', 'INV_MAX_RESULT_LOT_MERGE');
497: fnd_msg_pub.ADD;
498: x_validation_status := 'N';
499: RAISE fnd_api.g_exc_error;
500: END IF;
501:
502: FOR i IN 1 .. l_start_count
503: LOOP
507: THEN
508: fnd_message.set_name ('INV', 'INV_LOT_TRX_DIFF_ORG');
509: fnd_msg_pub.ADD;
510: x_validation_status := 'N';
511: RAISE fnd_api.g_exc_error;
512: END IF;
513: END IF;
514:
515: IF (p_st_org_id_tbl (i) <> p_rs_org_id_tbl (1))
516: THEN
517: fnd_message.set_name ('INV', 'INV_LOT_TRX_DIFF_ORG');
518: fnd_msg_pub.ADD;
519: x_validation_status := 'N';
520: RAISE fnd_api.g_exc_error;
521: END IF;
522:
523: IF (i < l_start_count)
524: THEN
526: THEN
527: fnd_message.set_name ('INV', 'INV_LOT_TRX_DIFF_ITEM');
528: fnd_msg_pub.ADD;
529: x_validation_status := 'N';
530: RAISE fnd_api.g_exc_error;
531: END IF;
532: END IF;
533:
534: IF (p_st_item_id_tbl (i) <> p_rs_item_id_tbl (1))
535: THEN
536: fnd_message.set_name ('INV', 'INV_LOT_TRX_DIFF_ITEM');
537: fnd_msg_pub.ADD;
538: x_validation_status := 'N';
539: RAISE fnd_api.g_exc_error;
540: END IF;
541:
542: FOR j IN 1 .. l_start_count
543: LOOP
552:
553: fnd_message.set_name ('INV', 'INV_DUPLICATE_LOT');
554: fnd_msg_pub.ADD;
555: x_validation_status := 'N';
556: RAISE fnd_api.g_exc_error;
557: END IF;
558: END IF;
559: END LOOP;
560:
567: , p_inventory_item_id => p_st_item_id_tbl (i)
568: , p_organization_id => p_st_org_id_tbl (i)
569: );
570:
571: IF (x_return_status = fnd_api.g_ret_sts_error)
572: THEN
573: RAISE fnd_api.g_exc_error;
574: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
575: THEN
569: );
570:
571: IF (x_return_status = fnd_api.g_ret_sts_error)
572: THEN
573: RAISE fnd_api.g_exc_error;
574: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
575: THEN
576: RAISE fnd_api.g_exc_unexpected_error;
577: END IF;
570:
571: IF (x_return_status = fnd_api.g_ret_sts_error)
572: THEN
573: RAISE fnd_api.g_exc_error;
574: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
575: THEN
576: RAISE fnd_api.g_exc_unexpected_error;
577: END IF;
578: END LOOP;
572: THEN
573: RAISE fnd_api.g_exc_error;
574: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
575: THEN
576: RAISE fnd_api.g_exc_unexpected_error;
577: END IF;
578: END LOOP;
579:
580: validate_result_lot (x_return_status => x_return_status
587: , p_inventory_item_id => p_rs_item_id_tbl (1)
588: , p_organization_id => p_rs_org_id_tbl (1)
589: );
590:
591: IF (x_return_status = fnd_api.g_ret_sts_error)
592: THEN
593: RAISE fnd_api.g_exc_error;
594: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
595: THEN
589: );
590:
591: IF (x_return_status = fnd_api.g_ret_sts_error)
592: THEN
593: RAISE fnd_api.g_exc_error;
594: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
595: THEN
596: RAISE fnd_api.g_exc_unexpected_error;
597: END IF;
590:
591: IF (x_return_status = fnd_api.g_ret_sts_error)
592: THEN
593: RAISE fnd_api.g_exc_error;
594: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
595: THEN
596: RAISE fnd_api.g_exc_unexpected_error;
597: END IF;
598: END IF;
592: THEN
593: RAISE fnd_api.g_exc_error;
594: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
595: THEN
596: RAISE fnd_api.g_exc_unexpected_error;
597: END IF;
598: END IF;
599:
600: x_validation_status := 'Y';
597: END IF;
598: END IF;
599:
600: x_validation_status := 'Y';
601: x_return_status := fnd_api.g_ret_sts_success;
602: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
603: EXCEPTION
604: WHEN fnd_api.g_exc_error
605: THEN
600: x_validation_status := 'Y';
601: x_return_status := fnd_api.g_ret_sts_success;
602: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
603: EXCEPTION
604: WHEN fnd_api.g_exc_error
605: THEN
606: x_validation_status := 'N';
607: x_return_status := fnd_api.g_ret_sts_error;
608: fnd_msg_pub.count_and_get (p_count => x_msg_count
603: EXCEPTION
604: WHEN fnd_api.g_exc_error
605: THEN
606: x_validation_status := 'N';
607: x_return_status := fnd_api.g_ret_sts_error;
608: fnd_msg_pub.count_and_get (p_count => x_msg_count
609: , p_data => x_msg_data);
610: WHEN fnd_api.g_exc_unexpected_error
611: THEN
606: x_validation_status := 'N';
607: x_return_status := fnd_api.g_ret_sts_error;
608: fnd_msg_pub.count_and_get (p_count => x_msg_count
609: , p_data => x_msg_data);
610: WHEN fnd_api.g_exc_unexpected_error
611: THEN
612: x_validation_status := 'N';
613: x_return_status := fnd_api.g_ret_sts_unexp_error;
614: fnd_msg_pub.count_and_get (p_count => x_msg_count
609: , p_data => x_msg_data);
610: WHEN fnd_api.g_exc_unexpected_error
611: THEN
612: x_validation_status := 'N';
613: x_return_status := fnd_api.g_ret_sts_unexp_error;
614: fnd_msg_pub.count_and_get (p_count => x_msg_count
615: , p_data => x_msg_data);
616: WHEN OTHERS
617: THEN
615: , p_data => x_msg_data);
616: WHEN OTHERS
617: THEN
618: x_validation_status := 'N';
619: x_return_status := fnd_api.g_ret_sts_unexp_error;
620:
621: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
622: THEN
623: fnd_msg_pub.add_exc_msg (g_pkg_name, 'Validate_Lots');
691: )
692: THEN
693: fnd_message.set_name ('INV', 'INV_MISSING_REQUIRED_PARAMETER');
694: fnd_msg_pub.ADD;
695: RAISE fnd_api.g_exc_error;
696: END IF;
697:
698: IF (p_transaction_type_id = inv_globals.g_type_inv_lot_split)
699: THEN
740: /* Bug:4405157. Modified the following message to be more specific to
741: Split transaction W.R.T Issue 15 of the bug*/
742: fnd_message.set_name ('INV', 'INV_INVALID_LOT_ITEM_LOT_SPLIT');
743: fnd_msg_pub.ADD;
744: RAISE fnd_api.g_exc_unexpected_error;
745: END;
746: END;
747: ELSIF (p_transaction_type_id = inv_globals.g_type_inv_lot_merge)
748: THEN
789: /* Bug:4405157. Modified the following message to be more specific to
790: Merge transaction W.R.T Issue 15 of the bug*/
791: fnd_message.set_name ('INV', 'INV_INVALID_LOT_ITEM_LOT_MERGE');
792: fnd_msg_pub.ADD;
793: RAISE fnd_api.g_exc_unexpected_error;
794: END;
795: END;
796: ELSIF (p_transaction_type_id = inv_globals.g_type_inv_lot_translate)
797: THEN
838: /* Bug:4405157. Modified the following message to be more specific to
839: Translate transaction W.R.T Issue 15 of the bug*/
840: fnd_message.set_name ('INV', 'INV_INVALID_LOT_ITEM_LOT_XLATE');
841: fnd_msg_pub.ADD;
842: RAISE fnd_api.g_exc_unexpected_error;
843: END;
844: END;
845: END IF;
846:
843: END;
844: END;
845: END IF;
846:
847: x_return_status := fnd_api.g_ret_sts_success;
848: x_validation_status := l_validation_status;
849:
850: /*Bug:4405157
851: /*Added new messages specific to lot split,merge and translate transactions
870: ELSE
871: fnd_message.set_name ('INV', 'INV_INVALID_LOT');
872: END IF;
873: fnd_msg_pub.ADD;
874: RAISE fnd_api.g_exc_error;
875: END IF;
876:
877: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
878: EXCEPTION
875: END IF;
876:
877: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
878: EXCEPTION
879: WHEN fnd_api.g_exc_error
880: THEN
881: x_validation_status := 'N';
882: x_return_status := fnd_api.g_ret_sts_error;
883: fnd_msg_pub.count_and_get (p_count => x_msg_count
878: EXCEPTION
879: WHEN fnd_api.g_exc_error
880: THEN
881: x_validation_status := 'N';
882: x_return_status := fnd_api.g_ret_sts_error;
883: fnd_msg_pub.count_and_get (p_count => x_msg_count
884: , p_data => x_msg_data);
885: WHEN fnd_api.g_exc_unexpected_error
886: THEN
881: x_validation_status := 'N';
882: x_return_status := fnd_api.g_ret_sts_error;
883: fnd_msg_pub.count_and_get (p_count => x_msg_count
884: , p_data => x_msg_data);
885: WHEN fnd_api.g_exc_unexpected_error
886: THEN
887: x_validation_status := 'N';
888: x_return_status := fnd_api.g_ret_sts_unexp_error;
889: fnd_msg_pub.count_and_get (p_count => x_msg_count
884: , p_data => x_msg_data);
885: WHEN fnd_api.g_exc_unexpected_error
886: THEN
887: x_validation_status := 'N';
888: x_return_status := fnd_api.g_ret_sts_unexp_error;
889: fnd_msg_pub.count_and_get (p_count => x_msg_count
890: , p_data => x_msg_data);
891: WHEN OTHERS
892: THEN
890: , p_data => x_msg_data);
891: WHEN OTHERS
892: THEN
893: x_validation_status := 'N';
894: x_return_status := fnd_api.g_ret_sts_unexp_error;
895:
896: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
897: THEN
898: fnd_msg_pub.add_exc_msg (g_pkg_name, 'Validate_Start_Lot');
981: END IF;
982:
983: fnd_message.set_name ('INV', 'INV_MISSING_REQUIRED_PARAMETER');
984: fnd_msg_pub.ADD;
985: RAISE fnd_api.g_exc_error;
986: END IF;
987: /* Bug#4363274. This check is not required.
988: IF (p_transaction_type_id = inv_globals.g_type_inv_lot_merge)
989: THEN
1007: THEN
1008: fnd_message.set_name ('INV', 'INV_MERGELOT_USED');
1009: fnd_msg_pub.ADD;
1010: l_validation_status := 'N';
1011: RAISE fnd_api.g_exc_error;
1012: END IF;
1013: END LOOP;
1014: END IF;
1015: */
1024: THEN
1025: fnd_message.set_name ('INV', 'INV_INT_ORG_CODE');
1026: fnd_msg_pub.ADD;
1027: x_validation_status := 'N';
1028: RAISE fnd_api.g_exc_unexpected_error;
1029: END;
1030:
1031: IF (l_debug = 1)
1032: THEN
1053: THEN
1054: l_validation_status := 'N';
1055: fnd_message.set_name ('INV', 'INV_INT_LOTUNIQEXP');
1056: fnd_msg_pub.ADD;
1057: RAISE fnd_api.g_exc_error;
1058: ELSE
1059: l_validation_status := 'Y';
1060: END IF;
1061:
1072: THEN
1073: l_validation_status := 'N';
1074: fnd_message.set_name ('INV', 'INV_INT_LOTUNIQEXP');
1075: fnd_msg_pub.ADD;
1076: RAISE fnd_api.g_exc_error;
1077: ELSE
1078: l_validation_status := 'Y';
1079: END IF;
1080:
1091:
1092: l_validation_status := 'N';
1093: fnd_message.set_name ('INV', 'INV_DUPLICATE_LOT');
1094: fnd_msg_pub.ADD;
1095: RAISE fnd_api.g_exc_error;
1096: END IF;
1097: END IF;
1098: END LOOP;
1099: END LOOP;
1119: -- cannot be from different items.
1120: l_validation_status := 'N';
1121: fnd_message.set_name ('INV', 'INV_INT_LOTUNIQEXP');
1122: fnd_msg_pub.ADD;
1123: RAISE fnd_api.g_exc_error;
1124: ELSE
1125: l_validation_status := 'Y';
1126: END IF;
1127:
1138: THEN
1139: l_validation_status := 'N';
1140: fnd_message.set_name ('INV', 'INV_INT_LOTUNIQEXP');
1141: fnd_msg_pub.ADD;
1142: RAISE fnd_api.g_exc_error;
1143: ELSE
1144: l_validation_status := 'Y';
1145: END IF;
1146: END IF;
1162: THEN
1163: l_validation_status := 'N';
1164: fnd_message.set_name ('INV', 'INV_LOT_EXISTS');
1165: fnd_msg_pub.ADD;
1166: RAISE fnd_api.g_exc_error;
1167: ELSE
1168: l_validation_status := 'Y';
1169: END IF;
1170:
1179: THEN
1180: l_validation_status := 'N';
1181: fnd_message.set_name ('INV', 'INV_LOT_EXISTS');
1182: fnd_msg_pub.ADD;
1183: RAISE fnd_api.g_exc_error;
1184: ELSE
1185: l_validation_status := 'Y';
1186: END IF;
1187:
1198: THEN
1199: l_validation_status := 'N';
1200: fnd_message.set_name ('INV', 'INV_LOT_EXISTS');
1201: fnd_msg_pub.ADD;
1202: RAISE fnd_api.g_exc_error;
1203: ELSE
1204: l_validation_status := 'Y';
1205: END IF;
1206:
1217:
1218: l_validation_status := 'N';
1219: fnd_message.set_name ('INV', 'INV_DUPLICATE_LOT');
1220: fnd_msg_pub.ADD;
1221: RAISE fnd_api.g_exc_error;
1222: END IF;
1223: END IF;
1224: END LOOP;
1225: END LOOP;
1249: THEN
1250: l_validation_status := 'N';
1251: fnd_message.set_name ('INV', 'INV_LOT_EXISTS');
1252: fnd_msg_pub.ADD;
1253: RAISE fnd_api.g_exc_error;
1254: ELSE
1255: l_validation_status := 'Y';
1256: END IF;
1257:
1278: if( l_found = false ) then
1279: FND_MESSAGE.SET_NAME('INV', 'INV_DIFF_MERGE_ITEM');
1280: FND_MSG_PUB.ADD;
1281: l_validation_status := 'N';
1282: raise FND_API.G_EXC_ERROR;
1283: end if;
1284: IF (l_debug = 1) THEN
1285: print_Debug('after validating the item', 'validate_result_lot');
1286: END IF;
1317: IF l_lot_count = 0 Then
1318: l_validation_status := 'N';
1319: FND_MESSAGE.SET_NAME('INV', 'INV_INVALID_LOT');
1320: FND_MSG_PUB.ADD;
1321: raise FND_API.G_EXC_ERROR;
1322: else
1323: l_validation_status := 'Y';
1324: end if;
1325: IF (l_debug = 1) THEN
1333: end if;
1334: */
1335: END IF;
1336:
1337: x_return_status := fnd_api.g_ret_sts_success;
1338: x_validation_status := l_validation_status;
1339:
1340: IF (x_validation_status <> 'Y')
1341: THEN
1340: IF (x_validation_status <> 'Y')
1341: THEN
1342: fnd_message.set_name ('INV', 'INV_INVALID_LOT');
1343: fnd_msg_pub.ADD;
1344: RAISE fnd_api.g_exc_error;
1345: END IF;
1346:
1347: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
1348: EXCEPTION
1345: END IF;
1346:
1347: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
1348: EXCEPTION
1349: WHEN fnd_api.g_exc_error
1350: THEN
1351: x_validation_status := l_validation_status;
1352: x_return_status := fnd_api.g_ret_sts_error;
1353: fnd_msg_pub.count_and_get (p_count => x_msg_count
1348: EXCEPTION
1349: WHEN fnd_api.g_exc_error
1350: THEN
1351: x_validation_status := l_validation_status;
1352: x_return_status := fnd_api.g_ret_sts_error;
1353: fnd_msg_pub.count_and_get (p_count => x_msg_count
1354: , p_data => x_msg_data);
1355: WHEN fnd_api.g_exc_unexpected_error
1356: THEN
1351: x_validation_status := l_validation_status;
1352: x_return_status := fnd_api.g_ret_sts_error;
1353: fnd_msg_pub.count_and_get (p_count => x_msg_count
1354: , p_data => x_msg_data);
1355: WHEN fnd_api.g_exc_unexpected_error
1356: THEN
1357: x_validation_status := l_validation_status;
1358: x_return_status := fnd_api.g_ret_sts_unexp_error;
1359: fnd_msg_pub.count_and_get (p_count => x_msg_count
1354: , p_data => x_msg_data);
1355: WHEN fnd_api.g_exc_unexpected_error
1356: THEN
1357: x_validation_status := l_validation_status;
1358: x_return_status := fnd_api.g_ret_sts_unexp_error;
1359: fnd_msg_pub.count_and_get (p_count => x_msg_count
1360: , p_data => x_msg_data);
1361: WHEN OTHERS
1362: THEN
1360: , p_data => x_msg_data);
1361: WHEN OTHERS
1362: THEN
1363: x_validation_status := l_validation_status;
1364: x_return_status := fnd_api.g_ret_sts_unexp_error;
1365:
1366: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1367: THEN
1368: fnd_msg_pub.add_exc_msg (g_pkg_name
1432: THEN
1433: fnd_message.set_name ('INV', 'INV_MISSING_REQUIRED_PARAMETER');
1434: fnd_msg_pub.ADD;
1435: x_validation_status := 'N';
1436: RAISE fnd_api.g_exc_unexpected_error;
1437: END IF;
1438:
1439: IF (p_start_lot_number = p_result_lot_number)
1440: THEN
1452: fnd_message.set_token ('ENTITY'
1453: , fnd_message.get_string ('INV', 'LOT_NUMBER')
1454: );
1455: fnd_msg_pub.ADD;
1456: RAISE fnd_api.g_exc_error;
1457: ELSE
1458: x_validation_status := 'Y';
1459: END IF;
1460: ELSE
1464: x_validation_status := 'N';
1465: FND_MESSAGE.SET_NAME('INV', 'INV_ALREADY_EXISTS');
1466: FND_MESSAGE.SET_TOKEN('ENTITY', FND_MESSAGE.get_String('INV', 'LOT_NUMBER'));
1467: FND_MSG_PUB.ADD;
1468: raise FND_API.G_EXC_ERROR;
1469: end if;*/
1470: x_validation_status := 'Y';
1471: END IF;
1472:
1469: end if;*/
1470: x_validation_status := 'Y';
1471: END IF;
1472:
1473: x_return_status := fnd_api.g_ret_sts_success;
1474: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
1475: EXCEPTION
1476: WHEN fnd_api.g_exc_error
1477: THEN
1472:
1473: x_return_status := fnd_api.g_ret_sts_success;
1474: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
1475: EXCEPTION
1476: WHEN fnd_api.g_exc_error
1477: THEN
1478: x_return_status := fnd_api.g_ret_sts_error;
1479: fnd_msg_pub.count_and_get (p_count => x_msg_count
1480: , p_data => x_msg_data);
1474: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
1475: EXCEPTION
1476: WHEN fnd_api.g_exc_error
1477: THEN
1478: x_return_status := fnd_api.g_ret_sts_error;
1479: fnd_msg_pub.count_and_get (p_count => x_msg_count
1480: , p_data => x_msg_data);
1481: WHEN fnd_api.g_exc_unexpected_error
1482: THEN
1477: THEN
1478: x_return_status := fnd_api.g_ret_sts_error;
1479: fnd_msg_pub.count_and_get (p_count => x_msg_count
1480: , p_data => x_msg_data);
1481: WHEN fnd_api.g_exc_unexpected_error
1482: THEN
1483: x_return_status := fnd_api.g_ret_sts_unexp_error;
1484: fnd_msg_pub.count_and_get (p_count => x_msg_count
1485: , p_data => x_msg_data);
1479: fnd_msg_pub.count_and_get (p_count => x_msg_count
1480: , p_data => x_msg_data);
1481: WHEN fnd_api.g_exc_unexpected_error
1482: THEN
1483: x_return_status := fnd_api.g_ret_sts_unexp_error;
1484: fnd_msg_pub.count_and_get (p_count => x_msg_count
1485: , p_data => x_msg_data);
1486: WHEN OTHERS
1487: THEN
1484: fnd_msg_pub.count_and_get (p_count => x_msg_count
1485: , p_data => x_msg_data);
1486: WHEN OTHERS
1487: THEN
1488: x_return_status := fnd_api.g_ret_sts_unexp_error;
1489:
1490: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1491: THEN
1492: fnd_msg_pub.add_exc_msg (g_pkg_name, 'Validate_Lot_Translate');
1524: l_validation_status VARCHAR2(1);
1525: l_debug NUMBER;
1526: BEGIN
1527: l_debug := NVL (fnd_profile.VALUE ('INV_DEBUG_TRACE'), 0);
1528: x_return_status := fnd_api.g_ret_sts_success;
1529: l_validation_status := 'Y';
1530:
1531: FOR i IN 1..p_st_lpn_id_tbl.COUNT LOOP
1532: IF(p_st_lpn_id_tbl(i) IS NOT NULL) THEN
1537: WHERE lpn_id = p_st_lpn_id_tbl(i);
1538: EXCEPTION
1539: WHEN OTHERS THEN
1540: l_validation_status := 'N';
1541: RAISE fnd_api.g_exc_unexpected_error;
1542: END;
1543: IF(l_lpn_context <> 1) --does not resides in inventory
1544: THEN
1545: fnd_message.set_name('INV', 'INV_INVALID_LPN_CONTEXT');
1547: IF (l_debug = 1) THEN
1548: print_debug('validate_lpn_info: Invalid LPN Context for FROM LPN' , 'validate_lpn_info');
1549: END IF;
1550: l_validation_status := 'N';
1551: RAISE fnd_api.g_exc_error;
1552: END IF;
1553: END IF;
1554: END LOOP;
1555:
1568: WHERE lpn_id = p_rs_lpn_id_tbl(i);
1569: EXCEPTION
1570: WHEN OTHERS THEN
1571: l_validation_status := 'N';
1572: RAISE fnd_api.g_exc_unexpected_error;
1573: END;
1574: IF(l_lpn_context NOT IN (1,5)) --does not 'resides in inventory' and not 'defined but not used'
1575: THEN
1576: fnd_message.set_name('INV', 'INV_INVALID_LPN_CONTEXT');
1578: IF (l_debug = 1) THEN
1579: print_debug('validate_lpn_info: Invalid LPN Context for TO LPN', 'validate_lpn_info');
1580: END IF;
1581: l_validation_status := 'N';
1582: RAISE fnd_api.g_exc_error;
1583: ELSIF(l_lpn_context = 1) THEN
1584: IF ( (l_org_id <> p_st_org_id_tbl(1) )
1585: OR
1586: (NVL(l_sub_code, '@#$%') <> p_rs_sub_code_tbl(i))
1592: IF (l_debug = 1) THEN
1593: print_debug('validate_lpn_info: Org/Sub/Loc of LPN does not match', 'validate_lpn_info');
1594: END IF;
1595: l_validation_status := 'N';
1596: RAISE fnd_api.g_exc_error;
1597: END IF;
1598: END IF;
1599: END IF;
1600: END LOOP;
1599: END IF;
1600: END LOOP;
1601:
1602: x_validation_status := 'Y';
1603: x_return_status := fnd_api.g_ret_sts_success;
1604: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
1605: EXCEPTION
1606: WHEN fnd_api.g_exc_error
1607: THEN
1602: x_validation_status := 'Y';
1603: x_return_status := fnd_api.g_ret_sts_success;
1604: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
1605: EXCEPTION
1606: WHEN fnd_api.g_exc_error
1607: THEN
1608: x_validation_status := l_validation_status;
1609: x_return_status := fnd_api.g_ret_sts_error;
1610: fnd_msg_pub.count_and_get (p_count => x_msg_count
1605: EXCEPTION
1606: WHEN fnd_api.g_exc_error
1607: THEN
1608: x_validation_status := l_validation_status;
1609: x_return_status := fnd_api.g_ret_sts_error;
1610: fnd_msg_pub.count_and_get (p_count => x_msg_count
1611: , p_data => x_msg_data);
1612: WHEN fnd_api.g_exc_unexpected_error
1613: THEN
1608: x_validation_status := l_validation_status;
1609: x_return_status := fnd_api.g_ret_sts_error;
1610: fnd_msg_pub.count_and_get (p_count => x_msg_count
1611: , p_data => x_msg_data);
1612: WHEN fnd_api.g_exc_unexpected_error
1613: THEN
1614: x_validation_status := l_validation_status;
1615: x_return_status := fnd_api.g_ret_sts_unexp_error;
1616: fnd_msg_pub.count_and_get (p_count => x_msg_count
1611: , p_data => x_msg_data);
1612: WHEN fnd_api.g_exc_unexpected_error
1613: THEN
1614: x_validation_status := l_validation_status;
1615: x_return_status := fnd_api.g_ret_sts_unexp_error;
1616: fnd_msg_pub.count_and_get (p_count => x_msg_count
1617: , p_data => x_msg_data);
1618: WHEN OTHERS
1619: THEN
1617: , p_data => x_msg_data);
1618: WHEN OTHERS
1619: THEN
1620: x_validation_status := 'E';
1621: x_return_status := fnd_api.g_ret_sts_unexp_error;
1622:
1623: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1624: THEN
1625: fnd_msg_pub.add_exc_msg (g_pkg_name, 'Validate_Lpn_Info');
1706: THEN
1707: fnd_message.set_name ('INV', 'INV_MISSING_REQUIRED_PARAMETER');
1708: fnd_msg_pub.ADD;
1709: x_validation_status := 'N';
1710: RAISE fnd_api.g_exc_error;
1711: END IF;
1712:
1713: IF (l_debug = 1)
1714: THEN
1772: , x_serial_status_enabled => l_serial_status_enabled
1773: , x_default_serial_status_id => l_default_serial_status_id
1774: );
1775:
1776: IF (x_return_status <> fnd_api.g_ret_sts_success)
1777: THEN
1778: x_validation_status := 'N';
1779: RAISE fnd_api.g_exc_unexpected_error;
1780: END IF;
1775:
1776: IF (x_return_status <> fnd_api.g_ret_sts_success)
1777: THEN
1778: x_validation_status := 'N';
1779: RAISE fnd_api.g_exc_unexpected_error;
1780: END IF;
1781:
1782: IF (l_status_id IS NULL)
1783: THEN
1806: );
1807: END IF;
1808:
1809: x_validation_status := l_validation_status;
1810: x_return_status := fnd_api.g_ret_sts_success;
1811: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
1812: EXCEPTION
1813: WHEN fnd_api.g_exc_error
1814: THEN
1809: x_validation_status := l_validation_status;
1810: x_return_status := fnd_api.g_ret_sts_success;
1811: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
1812: EXCEPTION
1813: WHEN fnd_api.g_exc_error
1814: THEN
1815: x_return_status := fnd_api.g_ret_sts_error;
1816: fnd_msg_pub.count_and_get (p_count => x_msg_count
1817: , p_data => x_msg_data);
1811: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
1812: EXCEPTION
1813: WHEN fnd_api.g_exc_error
1814: THEN
1815: x_return_status := fnd_api.g_ret_sts_error;
1816: fnd_msg_pub.count_and_get (p_count => x_msg_count
1817: , p_data => x_msg_data);
1818: WHEN fnd_api.g_exc_unexpected_error
1819: THEN
1814: THEN
1815: x_return_status := fnd_api.g_ret_sts_error;
1816: fnd_msg_pub.count_and_get (p_count => x_msg_count
1817: , p_data => x_msg_data);
1818: WHEN fnd_api.g_exc_unexpected_error
1819: THEN
1820: x_return_status := fnd_api.g_ret_sts_unexp_error;
1821: fnd_msg_pub.count_and_get (p_count => x_msg_count
1822: , p_data => x_msg_data);
1816: fnd_msg_pub.count_and_get (p_count => x_msg_count
1817: , p_data => x_msg_data);
1818: WHEN fnd_api.g_exc_unexpected_error
1819: THEN
1820: x_return_status := fnd_api.g_ret_sts_unexp_error;
1821: fnd_msg_pub.count_and_get (p_count => x_msg_count
1822: , p_data => x_msg_data);
1823: WHEN OTHERS
1824: THEN
1821: fnd_msg_pub.count_and_get (p_count => x_msg_count
1822: , p_data => x_msg_data);
1823: WHEN OTHERS
1824: THEN
1825: x_return_status := fnd_api.g_ret_sts_unexp_error;
1826:
1827: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1828: THEN
1829: fnd_msg_pub.add_exc_msg (g_pkg_name, 'Validate_Material_Status');
1871: THEN
1872: fnd_message.set_name ('INV', 'INV_MISSING_REQUIRED_PARAMETER');
1873: fnd_msg_pub.ADD;
1874: x_validation_status := 'N';
1875: RAISE fnd_api.g_exc_error;
1876: END IF;
1877:
1878: IF (l_debug = 1)
1879: THEN
1951: , x_serial_status_enabled => l_serial_status_enabled
1952: , x_default_serial_status_id => l_default_serial_status_id
1953: );
1954:
1955: IF (x_return_status <> fnd_api.g_ret_sts_success)
1956: THEN
1957: IF (l_debug = 1)
1958: THEN
1959: print_debug (' get_lot_serial_status_control returned with error'
1961: );
1962: END IF;
1963:
1964: x_validation_status := 'N';
1965: RAISE fnd_api.g_exc_unexpected_error;
1966: END IF;
1967:
1968: IF (l_status_id IS NULL)
1969: THEN
2005: );
2006: END IF;
2007:
2008: x_validation_status := l_validation_status;
2009: RAISE fnd_api.g_exc_error;
2010: END IF;
2011: END IF;
2012:
2013: x_validation_status := l_validation_status;
2010: END IF;
2011: END IF;
2012:
2013: x_validation_status := l_validation_status;
2014: x_return_status := fnd_api.g_ret_sts_success;
2015: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
2016: EXCEPTION
2017: WHEN fnd_api.g_exc_error
2018: THEN
2013: x_validation_status := l_validation_status;
2014: x_return_status := fnd_api.g_ret_sts_success;
2015: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
2016: EXCEPTION
2017: WHEN fnd_api.g_exc_error
2018: THEN
2019: x_return_status := fnd_api.g_ret_sts_error;
2020: fnd_msg_pub.count_and_get (p_count => x_msg_count
2021: , p_data => x_msg_data);
2015: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
2016: EXCEPTION
2017: WHEN fnd_api.g_exc_error
2018: THEN
2019: x_return_status := fnd_api.g_ret_sts_error;
2020: fnd_msg_pub.count_and_get (p_count => x_msg_count
2021: , p_data => x_msg_data);
2022: WHEN fnd_api.g_exc_unexpected_error
2023: THEN
2018: THEN
2019: x_return_status := fnd_api.g_ret_sts_error;
2020: fnd_msg_pub.count_and_get (p_count => x_msg_count
2021: , p_data => x_msg_data);
2022: WHEN fnd_api.g_exc_unexpected_error
2023: THEN
2024: x_return_status := fnd_api.g_ret_sts_unexp_error;
2025: fnd_msg_pub.count_and_get (p_count => x_msg_count
2026: , p_data => x_msg_data);
2020: fnd_msg_pub.count_and_get (p_count => x_msg_count
2021: , p_data => x_msg_data);
2022: WHEN fnd_api.g_exc_unexpected_error
2023: THEN
2024: x_return_status := fnd_api.g_ret_sts_unexp_error;
2025: fnd_msg_pub.count_and_get (p_count => x_msg_count
2026: , p_data => x_msg_data);
2027: WHEN OTHERS
2028: THEN
2025: fnd_msg_pub.count_and_get (p_count => x_msg_count
2026: , p_data => x_msg_data);
2027: WHEN OTHERS
2028: THEN
2029: x_return_status := fnd_api.g_ret_sts_unexp_error;
2030:
2031: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
2032: THEN
2033: fnd_msg_pub.add_exc_msg (g_pkg_name, 'Validate_Serial_Status');
2090: END;
2091:
2092: /*********************************************************************************************
2093: * Pseudo-codes: *
2094: * x_return_status := FND_API.G_RET_STS_SUCCESS;
2095: * FND_MSG_PUB.Count_And_Get( p_count => x_msg_count, p_data => x_msg_data);
2096: *
2097: * call INV_LOT_SEL_ATTR.is_enabled to see if the lot attributes is enabled for this
2098: * item/org/category combination
2261: THEN
2262: print_debug ('Validate Attributes', 'Validate_Attributes');
2263: END IF;
2264:
2265: x_return_status := fnd_api.g_ret_sts_success;
2266: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
2267:
2268: IF (l_debug = 1)
2269: THEN
2431: IF (l_rs_lot_attr_category IS NULL AND l_count > 0) THEN
2432: print_debug('Resultant lot category is null', 'Validate_Attributes');
2433: fnd_message.set_name('INV', 'INV_VALID_CAT');
2434: fnd_msg_pub.add;
2435: raise FND_API.G_EXC_ERROR;
2436: end if;
2437:
2438: ******/
2439: FOR i IN 1 .. p_parent_lot_attr_tbl.COUNT
2462: , 'Validate_Attributes'
2463: );
2464: fnd_message.set_name ('INV', 'INV_VALID_CAT');
2465: fnd_msg_pub.ADD;
2466: RAISE fnd_api.g_exc_error;
2467: END IF;
2468:
2469: -- parent lot does not have attributes.
2470: -- use default lot attributes.
2488: , p_lot_serial_number => p_lot_number
2489: , p_attributes => g_lot_attributes_tbl
2490: );
2491:
2492: IF (l_return_status <> fnd_api.g_ret_sts_success)
2493: THEN
2494: x_validation_status := 'N';
2495: x_return_status := l_return_status;
2496: RAISE fnd_api.g_exc_unexpected_error;
2492: IF (l_return_status <> fnd_api.g_ret_sts_success)
2493: THEN
2494: x_validation_status := 'N';
2495: x_return_status := l_return_status;
2496: RAISE fnd_api.g_exc_unexpected_error;
2497: END IF;
2498:
2499: IF (l_debug = 1)
2500: THEN
2617: );
2618: END IF;
2619:
2620: x_validation_status := 'Y';
2621: x_return_status := fnd_api.g_ret_sts_success;
2622: x_msg_count := 0;
2623: x_msg_data := NULL;
2624: --x_lot_attr_tbl := p_result_lot_attr_tbl;
2625: RETURN;
2841: print_debug ('l_status is false', 'Validate_Attributes');
2842: END IF;
2843:
2844: l_validation_status := 'N';
2845: x_return_status := fnd_api.g_ret_sts_error;
2846: x_msg_data := fnd_flex_descval.error_message;
2847: fnd_message.set_name ('INV', 'GENERIC');
2848: fnd_message.set_token ('MSGBODY', x_msg_data);
2849: fnd_msg_pub.ADD;
2847: fnd_message.set_name ('INV', 'GENERIC');
2848: fnd_message.set_token ('MSGBODY', x_msg_data);
2849: fnd_msg_pub.ADD;
2850: x_msg_count := NVL (x_msg_count, 0) + 1;
2851: RAISE fnd_api.g_exc_error;
2852: END IF;
2853: ELSE
2854: -- no context found;
2855: l_validation_status := 'Y';
2852: END IF;
2853: ELSE
2854: -- no context found;
2855: l_validation_status := 'Y';
2856: x_return_status := fnd_api.g_ret_sts_success;
2857: fnd_msg_pub.count_and_get (p_count => x_msg_count
2858: , p_data => x_msg_data);
2859: END IF; -- if l_context_value is not null
2860:
2860:
2861: x_lot_attr_tbl := g_lot_attributes_tbl;
2862: x_validation_status := l_validation_status;
2863: EXCEPTION
2864: WHEN fnd_api.g_exc_error
2865: THEN
2866: x_validation_status := l_validation_status;
2867: x_return_status := fnd_api.g_ret_sts_error;
2868: fnd_msg_pub.count_and_get (p_count => x_msg_count
2863: EXCEPTION
2864: WHEN fnd_api.g_exc_error
2865: THEN
2866: x_validation_status := l_validation_status;
2867: x_return_status := fnd_api.g_ret_sts_error;
2868: fnd_msg_pub.count_and_get (p_count => x_msg_count
2869: , p_data => x_msg_data);
2870: WHEN fnd_api.g_exc_unexpected_error
2871: THEN
2866: x_validation_status := l_validation_status;
2867: x_return_status := fnd_api.g_ret_sts_error;
2868: fnd_msg_pub.count_and_get (p_count => x_msg_count
2869: , p_data => x_msg_data);
2870: WHEN fnd_api.g_exc_unexpected_error
2871: THEN
2872: x_validation_status := l_validation_status;
2873: x_return_status := fnd_api.g_ret_sts_unexp_error;
2874: fnd_msg_pub.count_and_get (p_count => x_msg_count
2869: , p_data => x_msg_data);
2870: WHEN fnd_api.g_exc_unexpected_error
2871: THEN
2872: x_validation_status := l_validation_status;
2873: x_return_status := fnd_api.g_ret_sts_unexp_error;
2874: fnd_msg_pub.count_and_get (p_count => x_msg_count
2875: , p_data => x_msg_data);
2876: WHEN OTHERS
2877: THEN
2875: , p_data => x_msg_data);
2876: WHEN OTHERS
2877: THEN
2878: x_validation_status := l_validation_status;
2879: x_return_status := fnd_api.g_ret_sts_unexp_error;
2880:
2881: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
2882: THEN
2883: fnd_msg_pub.add_exc_msg (g_pkg_name, 'Validate_Attributes');
3005: );
3006: END IF;
3007:
3008: l_validation_status := 'Y';
3009: x_return_status := fnd_api.g_ret_sts_success;
3010: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
3011: l_enabled_attributes :=
3012: inv_lot_sel_attr.is_enabled (p_flex_name => l_attributes_name
3013: , p_organization_id => p_organization_id
3101: EXCEPTION
3102: WHEN OTHERS
3103: THEN
3104: l_validation_status := 'N';
3105: RAISE fnd_api.g_exc_unexpected_error;
3106: END;
3107:
3108: IF (x_return_status <> fnd_api.g_ret_sts_success)
3109: THEN
3104: l_validation_status := 'N';
3105: RAISE fnd_api.g_exc_unexpected_error;
3106: END;
3107:
3108: IF (x_return_status <> fnd_api.g_ret_sts_success)
3109: THEN
3110: l_validation_status := 'N';
3111: RAISE fnd_api.g_exc_unexpected_error;
3112: END IF;
3107:
3108: IF (x_return_status <> fnd_api.g_ret_sts_success)
3109: THEN
3110: l_validation_status := 'N';
3111: RAISE fnd_api.g_exc_unexpected_error;
3112: END IF;
3113:
3114: IF (l_attributes_default_count > 0)
3115: THEN
3227: );
3228: END IF;
3229:
3230: x_validation_status := 'Y';
3231: x_return_status := fnd_api.g_ret_sts_success;
3232: x_msg_count := 0;
3233: x_msg_data := NULL;
3234: x_ser_attr_tbl := g_lot_ser_attributes_tbl;
3235: RETURN;
3478: print_debug ('l_status is false', 'validate_serial_attributes');
3479: END IF;
3480:
3481: l_validation_status := 'N';
3482: x_return_status := fnd_api.g_ret_sts_error;
3483: x_msg_data := fnd_flex_descval.error_message;
3484: fnd_message.set_name ('INV', 'GENERIC');
3485: fnd_message.set_token ('MSGBODY', x_msg_data);
3486: fnd_msg_pub.ADD;
3484: fnd_message.set_name ('INV', 'GENERIC');
3485: fnd_message.set_token ('MSGBODY', x_msg_data);
3486: fnd_msg_pub.ADD;
3487: x_msg_count := NVL (x_msg_count, 0) + 1;
3488: RAISE fnd_api.g_exc_error;
3489: END IF;
3490: ELSE
3491: -- no context found;
3492: l_validation_status := 'Y';
3489: END IF;
3490: ELSE
3491: -- no context found;
3492: l_validation_status := 'Y';
3493: x_return_status := fnd_api.g_ret_sts_success;
3494: fnd_msg_pub.count_and_get (p_count => x_msg_count
3495: , p_data => x_msg_data);
3496: END IF; -- if l_context_value is not null
3497:
3496: END IF; -- if l_context_value is not null
3497:
3498: x_ser_attr_tbl := g_lot_ser_attributes_tbl;
3499: x_validation_status := 'Y';
3500: x_return_status := fnd_api.g_ret_sts_success;
3501: EXCEPTION
3502: WHEN fnd_api.g_exc_error
3503: THEN
3504: x_validation_status := l_validation_status;
3498: x_ser_attr_tbl := g_lot_ser_attributes_tbl;
3499: x_validation_status := 'Y';
3500: x_return_status := fnd_api.g_ret_sts_success;
3501: EXCEPTION
3502: WHEN fnd_api.g_exc_error
3503: THEN
3504: x_validation_status := l_validation_status;
3505: x_return_status := fnd_api.g_ret_sts_error;
3506: fnd_msg_pub.count_and_get (p_count => x_msg_count
3501: EXCEPTION
3502: WHEN fnd_api.g_exc_error
3503: THEN
3504: x_validation_status := l_validation_status;
3505: x_return_status := fnd_api.g_ret_sts_error;
3506: fnd_msg_pub.count_and_get (p_count => x_msg_count
3507: , p_data => x_msg_data);
3508: WHEN fnd_api.g_exc_unexpected_error
3509: THEN
3504: x_validation_status := l_validation_status;
3505: x_return_status := fnd_api.g_ret_sts_error;
3506: fnd_msg_pub.count_and_get (p_count => x_msg_count
3507: , p_data => x_msg_data);
3508: WHEN fnd_api.g_exc_unexpected_error
3509: THEN
3510: x_validation_status := l_validation_status;
3511: x_return_status := fnd_api.g_ret_sts_unexp_error;
3512: fnd_msg_pub.count_and_get (p_count => x_msg_count
3507: , p_data => x_msg_data);
3508: WHEN fnd_api.g_exc_unexpected_error
3509: THEN
3510: x_validation_status := l_validation_status;
3511: x_return_status := fnd_api.g_ret_sts_unexp_error;
3512: fnd_msg_pub.count_and_get (p_count => x_msg_count
3513: , p_data => x_msg_data);
3514: WHEN OTHERS
3515: THEN
3513: , p_data => x_msg_data);
3514: WHEN OTHERS
3515: THEN
3516: x_validation_status := 'E';
3517: x_return_status := fnd_api.g_ret_sts_unexp_error;
3518:
3519: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
3520: THEN
3521: fnd_msg_pub.add_exc_msg (g_pkg_name, 'validate_serial_attributes');
3645: THEN
3646: print_debug ('in validate cost group', 'Validate_Cost_Group');
3647: END IF;
3648:
3649: x_return_status := fnd_api.g_ret_sts_success;
3650: l_start_count := p_st_lot_num_tbl.COUNT;
3651: l_result_count := p_rs_lot_num_tbl.COUNT;
3652:
3653: IF (l_debug = 1)
3722: , x_cost_group_id => v_cost_group_id
3723: , x_return_status => l_return_status
3724: );
3725:
3726: IF (l_return_status <> fnd_api.g_ret_sts_success)
3727: THEN
3728: IF (l_debug = 1)
3729: THEN
3730: print_debug ('error from inv_cost_group_update.proc_get_costgroup'
3734:
3735: fnd_message.set_name ('INV', 'INV_ERROR_GET_COST_GROUP');
3736: fnd_msg_pub.ADD;
3737: x_validation_status := 'N';
3738: RAISE fnd_api.g_exc_error;
3739: END IF;
3740:
3741: IF (l_cost_group_id IS NULL OR l_cost_group_id = -1)
3742: THEN
3745: THEN
3746: fnd_message.set_name ('INV', 'INV_INT_CSTGRP');
3747: fnd_msg_pub.ADD;
3748: x_validation_status := 'N';
3749: RAISE fnd_api.g_exc_error;
3750: END IF;
3751:
3752: IF (x_rs_cost_group_tbl.COUNT = 0 OR x_rs_cost_group_tbl IS NULL)
3753: THEN
3775: THEN
3776: fnd_message.set_name ('INV', 'INV_LOT_DIFF_COSTGROUP');
3777: fnd_msg_pub.ADD;
3778: l_validation_status := 'N';
3779: RAISE fnd_api.g_exc_error;
3780: END IF;
3781: END LOOP;
3782:
3783: l_validation_status := 'Y';
3839: , x_cost_group_id => l_current_cost_group_id
3840: , x_return_status => l_return_status
3841: );
3842:
3843: IF (l_return_status <> fnd_api.g_ret_sts_success)
3844: THEN
3845: fnd_message.set_name ('INV', 'INV_ERROR_GET_COST_GROUP');
3846: fnd_msg_pub.ADD;
3847: x_validation_status := 'N';
3844: THEN
3845: fnd_message.set_name ('INV', 'INV_ERROR_GET_COST_GROUP');
3846: fnd_msg_pub.ADD;
3847: x_validation_status := 'N';
3848: RAISE fnd_api.g_exc_error;
3849: END IF;
3850: END IF;
3851:
3852: IF (l_current_cost_group_id <> l_cost_group_id)
3854: fnd_message.set_name ('INV', 'INV_DIFF_MERGE_COST_GROUP');
3855: fnd_message.set_token ('ENTITY1', l_lot_number);
3856: fnd_msg_pub.ADD;
3857: x_validation_status := 'N';
3858: RAISE fnd_api.g_exc_error;
3859: END IF;
3860: END LOOP;
3861: ELSIF (p_transaction_type_id = inv_globals.g_type_inv_lot_translate)
3862: THEN
3864: IF (l_inventory_item_id <> p_rs_item_id_tbl (1))
3865: THEN
3866: -- do nothing. let the trx manager assign the cost group;
3867: x_validation_status := 'Y';
3868: x_return_status := fnd_api.g_ret_sts_success;
3869: fnd_msg_pub.count_and_get (p_count => x_msg_count
3870: , p_data => x_msg_data
3871: );
3872: RETURN;
3874: END IF;
3875:
3876: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
3877: EXCEPTION
3878: WHEN fnd_api.g_exc_error
3879: THEN
3880: x_return_status := fnd_api.g_ret_sts_error;
3881: fnd_msg_pub.count_and_get (p_count => x_msg_count
3882: , p_data => x_msg_data);
3876: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
3877: EXCEPTION
3878: WHEN fnd_api.g_exc_error
3879: THEN
3880: x_return_status := fnd_api.g_ret_sts_error;
3881: fnd_msg_pub.count_and_get (p_count => x_msg_count
3882: , p_data => x_msg_data);
3883: WHEN fnd_api.g_exc_unexpected_error
3884: THEN
3879: THEN
3880: x_return_status := fnd_api.g_ret_sts_error;
3881: fnd_msg_pub.count_and_get (p_count => x_msg_count
3882: , p_data => x_msg_data);
3883: WHEN fnd_api.g_exc_unexpected_error
3884: THEN
3885: x_return_status := fnd_api.g_ret_sts_unexp_error;
3886: fnd_msg_pub.count_and_get (p_count => x_msg_count
3887: , p_data => x_msg_data);
3881: fnd_msg_pub.count_and_get (p_count => x_msg_count
3882: , p_data => x_msg_data);
3883: WHEN fnd_api.g_exc_unexpected_error
3884: THEN
3885: x_return_status := fnd_api.g_ret_sts_unexp_error;
3886: fnd_msg_pub.count_and_get (p_count => x_msg_count
3887: , p_data => x_msg_data);
3888: WHEN OTHERS
3889: THEN
3886: fnd_msg_pub.count_and_get (p_count => x_msg_count
3887: , p_data => x_msg_data);
3888: WHEN OTHERS
3889: THEN
3890: x_return_status := fnd_api.g_ret_sts_unexp_error;
3891:
3892: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
3893: THEN
3894: fnd_msg_pub.add_exc_msg (g_pkg_name, 'Validate_Material_Status');
4036: THEN
4037: print_debug ('Inside Validate_Quantity', 'Validate_Quantity');
4038: END IF;
4039:
4040: x_return_status := fnd_api.g_ret_sts_success;
4041: x_validation_status := 'Y';
4042:
4043: IF (l_debug = 1)
4044: THEN
4053: , x_msg_count => x_msg_count
4054: , x_msg_data => x_msg_data
4055: );
4056:
4057: IF (x_return_status = fnd_api.g_ret_sts_error)
4058: THEN
4059: RAISE fnd_api.g_exc_error;
4060: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
4061: THEN
4055: );
4056:
4057: IF (x_return_status = fnd_api.g_ret_sts_error)
4058: THEN
4059: RAISE fnd_api.g_exc_error;
4060: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
4061: THEN
4062: RAISE fnd_api.g_exc_unexpected_error;
4063: END IF;
4056:
4057: IF (x_return_status = fnd_api.g_ret_sts_error)
4058: THEN
4059: RAISE fnd_api.g_exc_error;
4060: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
4061: THEN
4062: RAISE fnd_api.g_exc_unexpected_error;
4063: END IF;
4064:
4058: THEN
4059: RAISE fnd_api.g_exc_error;
4060: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error)
4061: THEN
4062: RAISE fnd_api.g_exc_unexpected_error;
4063: END IF;
4064:
4065: IF (l_debug = 1)
4066: THEN
4097: WHEN NO_DATA_FOUND
4098: THEN
4099: fnd_message.set_name ('INV', 'INV_INT_ITEM_CODE');
4100: fnd_msg_pub.ADD;
4101: RAISE fnd_api.g_exc_error;
4102: END;
4103:
4104: IF (l_debug = 1) THEN
4105: print_debug ('l_start_primary_uom is ' || l_start_primary_uom
4122: THEN
4123: IF (l_debug = 1) THEN
4124: print_debug ('Error in getting serial_number control code', 'Validate_Quantity');
4125: END IF;
4126: RAISE fnd_api.g_exc_unexpected_error;
4127: END;
4128: IF (l_debug = 1) THEN
4129: print_debug ('l_serial_code ' || l_serial_code, 'Validate_Quantity');
4130: END IF;
4164: fnd_message.set_token ('ROUTINE'
4165: , g_pkg_name || 'Validate_Quantity');
4166: fnd_msg_pub.ADD;
4167: x_validation_status := 'N';
4168: RAISE fnd_api.g_exc_unexpected_error;
4169: END IF;
4170: ELSE
4171: l_start_primary_qty := l_start_qty;
4172: END IF;
4202: print_debug ('get_immediate_lpn_item_qty has returned error', 'Validate_Quantity');
4203: END IF;
4204: fnd_message.set_name ('INV', 'INV_NOT_ENOUGH_ATT');
4205: fnd_msg_pub.ADD;
4206: RAISE fnd_api.g_exc_error;
4207: END IF;
4208:
4209: IF (l_debug = 1) THEN
4210: print_debug ('l_att_qty is ' || l_att_qty, 'Validate_Quantity');
4214:
4215: IF (l_att_qty < l_start_primary_qty) THEN
4216: fnd_message.set_name ('INV', 'INV_NOT_ENOUGH_ATT');
4217: fnd_msg_pub.ADD;
4218: RAISE fnd_api.g_exc_error;
4219: END IF;
4220:
4221: IF (p_transaction_type_id = inv_globals.g_type_inv_lot_translate) THEN
4222: IF (l_att_qty <> l_start_primary_qty) THEN
4221: IF (p_transaction_type_id = inv_globals.g_type_inv_lot_translate) THEN
4222: IF (l_att_qty <> l_start_primary_qty) THEN
4223: fnd_message.set_name ('INV', 'INV_LOT_TRANSLATE_QTY_ERR');
4224: fnd_msg_pub.ADD;
4225: RAISE fnd_api.g_exc_error;
4226: END IF;
4227: END IF;
4228:
4229: FOR i IN 1 .. l_result_count
4253: fnd_message.set_token ('UOM', l_start_uom_code);
4254: fnd_message.set_token ('ROUTINE', g_pkg_name || 'Validate_Quantity');
4255: fnd_msg_pub.ADD;
4256: x_validation_status := 'N';
4257: RAISE fnd_api.g_exc_unexpected_error;
4258: END IF;
4259: ELSE
4260: l_result_qty := p_rs_quantity_tbl (i);
4261: END IF;
4265: AND p_transaction_type_id = inv_globals.g_type_inv_lot_split
4266: ) THEN
4267: fnd_message.set_name ('INV', 'INV_MIN_LOT_SPLIT');
4268: fnd_msg_pub.ADD;
4269: RAISE fnd_api.g_exc_error;
4270: END IF;
4271:
4272: l_total_qty := l_total_qty + l_result_qty;
4273:
4296: print_debug ('l_lot_serial_count = > ' || l_lot_serial_count, 'Validate_Quantity');
4297: END IF;
4298: fnd_message.set_name ('INV', 'INV_INVLTPU_LOTTRX_QTY');
4299: fnd_msg_pub.ADD;
4300: RAISE fnd_api.g_exc_error;
4301: END IF;
4302: END IF;
4303: END LOOP;
4304:
4304:
4305: IF (l_total_qty = 0) THEN
4306: fnd_message.set_name ('INV', 'INV_INLTPU_QTY');
4307: fnd_msg_pub.ADD;
4308: RAISE fnd_api.g_exc_error;
4309: END IF;
4310:
4311: IF (l_total_qty <> l_start_primary_qty) THEN
4312: IF ( p_transaction_type_id = inv_globals.g_type_inv_lot_split
4313: AND l_total_qty > l_start_primary_qty) THEN
4314: x_validation_status := 'N';
4315: fnd_message.set_name ('INV', 'INV_TOTAL_EXCEED_SPLIT');
4316: fnd_msg_pub.ADD;
4317: RAISE fnd_api.g_exc_error;
4318: ELSIF (p_transaction_type_id = inv_globals.g_type_inv_lot_translate) THEN
4319: x_validation_status := 'N';
4320: fnd_message.set_name ('INV', 'INV_TOTAL_EXCEED_TRANSLATE');
4321: fnd_msg_pub.ADD;
4318: ELSIF (p_transaction_type_id = inv_globals.g_type_inv_lot_translate) THEN
4319: x_validation_status := 'N';
4320: fnd_message.set_name ('INV', 'INV_TOTAL_EXCEED_TRANSLATE');
4321: fnd_msg_pub.ADD;
4322: RAISE fnd_api.g_exc_error;
4323: END IF;
4324: END IF;
4325:
4326: /*Check for qty matching in case of lot serial items...
4334: , 'Validate_Quantity');
4335: END IF;
4336: fnd_message.set_name ('INV', 'INV_LOT_SER_QTY_VIOLATION');
4337: fnd_msg_pub.ADD;
4338: RAISE fnd_api.g_exc_error;
4339: END IF;
4340:
4341: IF ( p_st_ser_number_tbl.COUNT <> l_start_primary_qty
4342: OR p_rs_ser_number_tbl.COUNT <> l_total_qty) THEN
4353: END IF;
4354: x_validation_status := 'N';
4355: fnd_message.set_name ('INV', 'INV_INVLTPU_LOTTRX_QTY');
4356: fnd_msg_pub.ADD;
4357: RAISE fnd_api.g_exc_error;
4358: END IF;
4359: END IF;
4360: /* for lot merge, the check if the starting lot have enough qty to transact in
4361: * the transaction manager we don't check it here.
4385: , g_pkg_name || 'Validate_Quantity'
4386: );
4387: fnd_msg_pub.ADD;
4388: x_validation_status := 'N';
4389: RAISE fnd_api.g_exc_unexpected_error;
4390: END IF;
4391: ELSE
4392: l_start_primary_qty := p_st_quantity_tbl (i);
4393: END IF;
4426: print_debug ('get_immediates_lpn_qty returned error', 'Validate_Quantity');
4427: END IF;
4428: fnd_message.set_name ('INV', 'INV_NOT_ENOUGH_ATT');
4429: fnd_msg_pub.ADD;
4430: RAISE fnd_api.g_exc_error;
4431: END IF;
4432:
4433: IF (l_debug = 1) THEN
4434: print_debug ('l_att_qty is ' || l_att_qty, 'Validate_Quantity');
4438:
4439: IF (l_att_qty < l_start_primary_qty) THEN
4440: fnd_message.set_name ('INV', 'INV_NOT_ENOUGH_ATT');
4441: fnd_msg_pub.ADD;
4442: RAISE fnd_api.g_exc_error;
4443: END IF;
4444:
4445: /*OSFM support for Serialized Lot Items
4446: *Need to calculate the serial numbers for each lot ..it should match with the
4465: print_debug ('l_lot_serial_count = > ' || l_lot_serial_count, 'Validate_Quantity');
4466: END IF;
4467: fnd_message.set_name ('INV', 'INV_INVLTPU_LOTTRX_QTY');
4468: fnd_msg_pub.ADD;
4469: RAISE fnd_api.g_exc_error;
4470: END IF;
4471: END IF;
4472:
4473: l_total_qty := l_total_qty + l_start_primary_qty;
4497: fnd_message.set_token ('UOM', l_start_uom_code);
4498: fnd_message.set_token ('ROUTINE', g_pkg_name || 'Validate_Quantity');
4499: fnd_msg_pub.ADD;
4500: x_validation_status := 'N';
4501: RAISE fnd_api.g_exc_unexpected_error;
4502: END IF;
4503: ELSE
4504: l_result_qty := p_rs_quantity_tbl (1);
4505: END IF;
4512: IF (l_result_qty <> l_total_qty) THEN
4513: x_validation_status := 'N';
4514: fnd_message.set_name ('INV', 'INV_QTY_NOT_MATCHED');
4515: fnd_msg_pub.ADD;
4516: RAISE fnd_api.g_exc_error;
4517: END IF;
4518:
4519: /*For lot - serial items*/
4520: IF (l_serial_code IN (2, 5)) THEN
4521: IF ( TRUNC (l_start_primary_qty) <> TRUNC (l_start_primary_qty, 6)
4522: OR TRUNC (l_total_qty) <> TRUNC (l_total_qty, 6) ) THEN
4523: fnd_message.set_name ('INV', 'INV_LOT_SER_QTY_VIOLATION');
4524: fnd_msg_pub.ADD;
4525: RAISE fnd_api.g_exc_error;
4526: END IF;
4527:
4528: IF ( p_st_ser_number_tbl.COUNT <> l_total_qty
4529: OR p_rs_ser_number_tbl.COUNT <> l_result_qty ) THEN
4529: OR p_rs_ser_number_tbl.COUNT <> l_result_qty ) THEN
4530: x_validation_status := 'N';
4531: fnd_message.set_name ('INV', 'INV_INVLTPU_LOTTRX_QTY');
4532: fnd_msg_pub.ADD;
4533: RAISE fnd_api.g_exc_error;
4534: END IF;
4535: END IF;
4536: END IF;
4537:
4536: END IF;
4537:
4538: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
4539: EXCEPTION
4540: WHEN fnd_api.g_exc_error
4541: THEN
4542: x_return_status := fnd_api.g_ret_sts_error;
4543: fnd_msg_pub.count_and_get (p_count => x_msg_count
4544: , p_data => x_msg_data);
4538: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
4539: EXCEPTION
4540: WHEN fnd_api.g_exc_error
4541: THEN
4542: x_return_status := fnd_api.g_ret_sts_error;
4543: fnd_msg_pub.count_and_get (p_count => x_msg_count
4544: , p_data => x_msg_data);
4545: WHEN fnd_api.g_exc_unexpected_error
4546: THEN
4541: THEN
4542: x_return_status := fnd_api.g_ret_sts_error;
4543: fnd_msg_pub.count_and_get (p_count => x_msg_count
4544: , p_data => x_msg_data);
4545: WHEN fnd_api.g_exc_unexpected_error
4546: THEN
4547: x_return_status := fnd_api.g_ret_sts_unexp_error;
4548: fnd_msg_pub.count_and_get (p_count => x_msg_count
4549: , p_data => x_msg_data);
4543: fnd_msg_pub.count_and_get (p_count => x_msg_count
4544: , p_data => x_msg_data);
4545: WHEN fnd_api.g_exc_unexpected_error
4546: THEN
4547: x_return_status := fnd_api.g_ret_sts_unexp_error;
4548: fnd_msg_pub.count_and_get (p_count => x_msg_count
4549: , p_data => x_msg_data);
4550: WHEN OTHERS
4551: THEN
4548: fnd_msg_pub.count_and_get (p_count => x_msg_count
4549: , p_data => x_msg_data);
4550: WHEN OTHERS
4551: THEN
4552: x_return_status := fnd_api.g_ret_sts_unexp_error;
4553:
4554: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
4555: THEN
4556: fnd_msg_pub.add_exc_msg (g_pkg_name, 'Validate_Quantity');
4580: THEN
4581: fnd_message.set_name ('INV', 'INV_MISSING_REQUIRED_PARAMETER');
4582: fnd_msg_pub.ADD;
4583: x_validation_status := 'N';
4584: RAISE fnd_api.g_exc_error;
4585: END IF;
4586:
4587: print_debug ('Inside Validate_Organization', 'Validate_Organization');
4588: print_debug ('p_organization_id is ' || p_organization_id
4605: THEN
4606: fnd_message.set_name ('INV', 'INV_NO_OPEN_PERIOD');
4607: fnd_msg_pub.ADD;
4608: x_validation_status := 'N';
4609: RAISE fnd_api.g_exc_error;
4610: END IF;
4611: END LOOP;
4612:
4613: IF (l_period_id = 0 OR l_period_id = -1)
4614: THEN
4615: fnd_message.set_name ('INV', 'INV_NO_OPEN_PERIOD');
4616: fnd_msg_pub.ADD;
4617: x_validation_status := 'N';
4618: RAISE fnd_api.g_exc_error;
4619: ELSE
4620: x_validation_status := 'Y';
4621: x_return_status := fnd_api.g_ret_sts_success;
4622: fnd_msg_pub.count_and_get (p_count => x_msg_count
4617: x_validation_status := 'N';
4618: RAISE fnd_api.g_exc_error;
4619: ELSE
4620: x_validation_status := 'Y';
4621: x_return_status := fnd_api.g_ret_sts_success;
4622: fnd_msg_pub.count_and_get (p_count => x_msg_count
4623: , p_data => x_msg_data);
4624: END IF;
4625: EXCEPTION
4622: fnd_msg_pub.count_and_get (p_count => x_msg_count
4623: , p_data => x_msg_data);
4624: END IF;
4625: EXCEPTION
4626: WHEN fnd_api.g_exc_error
4627: THEN
4628: x_return_status := fnd_api.g_ret_sts_error;
4629: fnd_msg_pub.count_and_get (p_count => x_msg_count
4630: , p_data => x_msg_data);
4624: END IF;
4625: EXCEPTION
4626: WHEN fnd_api.g_exc_error
4627: THEN
4628: x_return_status := fnd_api.g_ret_sts_error;
4629: fnd_msg_pub.count_and_get (p_count => x_msg_count
4630: , p_data => x_msg_data);
4631: WHEN fnd_api.g_exc_unexpected_error
4632: THEN
4627: THEN
4628: x_return_status := fnd_api.g_ret_sts_error;
4629: fnd_msg_pub.count_and_get (p_count => x_msg_count
4630: , p_data => x_msg_data);
4631: WHEN fnd_api.g_exc_unexpected_error
4632: THEN
4633: x_return_status := fnd_api.g_ret_sts_unexp_error;
4634: fnd_msg_pub.count_and_get (p_count => x_msg_count
4635: , p_data => x_msg_data);
4629: fnd_msg_pub.count_and_get (p_count => x_msg_count
4630: , p_data => x_msg_data);
4631: WHEN fnd_api.g_exc_unexpected_error
4632: THEN
4633: x_return_status := fnd_api.g_ret_sts_unexp_error;
4634: fnd_msg_pub.count_and_get (p_count => x_msg_count
4635: , p_data => x_msg_data);
4636: WHEN OTHERS
4637: THEN
4634: fnd_msg_pub.count_and_get (p_count => x_msg_count
4635: , p_data => x_msg_data);
4636: WHEN OTHERS
4637: THEN
4638: x_return_status := fnd_api.g_ret_sts_unexp_error;
4639:
4640: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
4641: THEN
4642: fnd_msg_pub.add_exc_msg (g_pkg_name, 'Validate_Organization');
4691:
4692: BEGIN
4693: l_debug := NVL (fnd_profile.VALUE ('INV_DEBUG_TRACE'), 0);
4694: l_validation_status := 'Y';
4695: x_return_status := fnd_api.g_ret_sts_success;
4696:
4697: IF (p_transaction_type_id IS NULL)
4698: THEN
4699: IF (l_debug = 1)
4704:
4705: l_validation_status := 'N';
4706: fnd_message.set_name ('INV', 'INV_MISSING_REQUIRED_PARAMETER');
4707: fnd_msg_pub.ADD;
4708: RAISE fnd_api.g_exc_error;
4709: END IF;
4710:
4711: l_st_var_index := p_st_ser_number_tbl.FIRST;
4712: l_rs_var_index := p_rs_ser_number_tbl.FIRST;
4736:
4737: l_validation_status := 'N';
4738: fnd_message.set_name ('INV', 'INV_SERIAL_MATCH_ERROR');
4739: fnd_msg_pub.ADD;
4740: RAISE fnd_api.g_exc_error;
4741: /*Bug:5147899. Modified the following condition to throw error
4742: only when the group_mark_id holds a not null value other than -1 */
4743: ELSIF ( p_st_ser_grp_mark_id_tbl (i) IS NOT NULL
4744: AND p_st_ser_grp_mark_id_tbl (i) <> -1
4755:
4756: l_validation_status := 'N';
4757: fnd_message.set_name ('INV', 'INV_SERIAL_IN_USE');
4758: fnd_msg_pub.ADD;
4759: RAISE fnd_api.g_exc_error;
4760: ELSE
4761: /*Lot status validations are done in lot_trx_split_validations seperately.
4762: *Here we are only concerned with serial status validations.
4763: *For Lot Split/Translation/Merge transactions we will only validate the status control for the
4864: fnd_msg_pub.count_and_get (p_count => x_msg_count
4865: , p_data => x_msg_data
4866: );
4867: l_validation_status := 'N';
4868: RAISE fnd_api.g_exc_unexpected_error;
4869: END;
4870:
4871: IF (x_return_status = fnd_api.g_ret_sts_error)
4872: THEN
4867: l_validation_status := 'N';
4868: RAISE fnd_api.g_exc_unexpected_error;
4869: END;
4870:
4871: IF (x_return_status = fnd_api.g_ret_sts_error)
4872: THEN
4873: IF (l_debug = 1)
4874: THEN
4875: print_debug ('breadcrumb 100', 'Validate_serials');
4878: );
4879: END IF;
4880:
4881: l_validation_status := 'N';
4882: RAISE fnd_api.g_exc_error;
4883: ELSIF ( x_return_status = fnd_api.g_ret_sts_unexp_error
4884: OR l_validation_status <> 'Y'
4885: )
4886: THEN
4879: END IF;
4880:
4881: l_validation_status := 'N';
4882: RAISE fnd_api.g_exc_error;
4883: ELSIF ( x_return_status = fnd_api.g_ret_sts_unexp_error
4884: OR l_validation_status <> 'Y'
4885: )
4886: THEN
4887: IF (l_debug = 1)
4891: , 'Validate_serials'
4892: );
4893: END IF;
4894:
4895: RAISE fnd_api.g_exc_unexpected_error;
4896: END IF;
4897: END IF;
4898:
4899: l_st_var_index := p_st_ser_number_tbl.NEXT (l_st_var_index);
4949:
4950: l_validation_status := 'N';
4951: fnd_message.set_name ('INV', 'INV_FAIL_VALIDATE_SERIAL');
4952: fnd_msg_pub.ADD;
4953: RAISE fnd_api.g_exc_error;
4954: END IF;
4955:
4956: l_rs_var_index := p_rs_ser_number_tbl.NEXT (l_rs_var_index);
4957: END LOOP;
4957: END LOOP;
4958: END IF;
4959:
4960: x_validation_status := 'Y';
4961: x_return_status := fnd_api.g_ret_sts_success;
4962: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
4963:
4964: IF (l_debug = 1)
4965: THEN
4966: print_debug ('breadcrumb 150', 'Validate_serials');
4967: print_debug ('Serial Validations passed', 'Validate_serials');
4968: END IF;
4969: EXCEPTION
4970: WHEN fnd_api.g_exc_error
4971: THEN
4972: x_validation_status := l_validation_status;
4973: x_return_status := fnd_api.g_ret_sts_error;
4974: fnd_msg_pub.count_and_get (p_count => x_msg_count
4969: EXCEPTION
4970: WHEN fnd_api.g_exc_error
4971: THEN
4972: x_validation_status := l_validation_status;
4973: x_return_status := fnd_api.g_ret_sts_error;
4974: fnd_msg_pub.count_and_get (p_count => x_msg_count
4975: , p_data => x_msg_data);
4976: WHEN fnd_api.g_exc_unexpected_error
4977: THEN
4972: x_validation_status := l_validation_status;
4973: x_return_status := fnd_api.g_ret_sts_error;
4974: fnd_msg_pub.count_and_get (p_count => x_msg_count
4975: , p_data => x_msg_data);
4976: WHEN fnd_api.g_exc_unexpected_error
4977: THEN
4978: x_validation_status := l_validation_status;
4979: x_return_status := fnd_api.g_ret_sts_unexp_error;
4980: fnd_msg_pub.count_and_get (p_count => x_msg_count
4975: , p_data => x_msg_data);
4976: WHEN fnd_api.g_exc_unexpected_error
4977: THEN
4978: x_validation_status := l_validation_status;
4979: x_return_status := fnd_api.g_ret_sts_unexp_error;
4980: fnd_msg_pub.count_and_get (p_count => x_msg_count
4981: , p_data => x_msg_data);
4982: WHEN OTHERS
4983: THEN
4981: , p_data => x_msg_data);
4982: WHEN OTHERS
4983: THEN
4984: x_validation_status := 'E';
4985: x_return_status := fnd_api.g_ret_sts_unexp_error;
4986:
4987: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
4988: THEN
4989: fnd_msg_pub.add_exc_msg (g_pkg_name, 'Validate_serials');
5028: WHEN NO_DATA_FOUND
5029: THEN
5030: fnd_message.set_name ('INV', 'INV_INVALID_ITEM');
5031: fnd_msg_pub.ADD;
5032: RAISE fnd_api.g_exc_unexpected_error;
5033: END;
5034:
5035: print_debug ('Shelf Life Period ' || l_shelf_life_code, 'Compute Lot Exp');
5036: print_debug ('Item ' || p_item_id, 'Compute Lot Exp');
5057: WHEN NO_DATA_FOUND
5058: THEN
5059: fnd_message.set_name ('INV', 'INV_INVALID_LOT');
5060: fnd_msg_pub.ADD;
5061: RAISE fnd_api.g_exc_unexpected_error;
5062: END;
5063:
5064: print_debug ('Lot exp date after split1 ' || l_lotexpdate
5065: , 'Compute Lot Exp'
5068: IF (l_lotexpdate IS NULL)
5069: THEN
5070: fnd_message.set_name ('INV', 'INV_INVALID_LOT_EXP');
5071: fnd_msg_pub.ADD;
5072: RAISE fnd_api.g_exc_unexpected_error;
5073: END IF;
5074:
5075: -- Update all the resulting lots with this exp date
5076: FOR i IN 1 .. p_rs_lot_exp_tbl.COUNT
5099: fnd_message.set_token ('ENTITY1'
5100: , 'MTL_TRANSACTION_LOTS_INTERFACE'
5101: );
5102: fnd_msg_pub.ADD;
5103: RAISE fnd_api.g_exc_unexpected_error;
5104: END;
5105:
5106: print_debug ('Lot exp date after split3 ' || l_lotexpdate
5107: , 'Compute Lot Exp'
5140: IF (l_lotexpdate IS NULL)
5141: THEN
5142: fnd_message.set_name ('INV', 'INV_INVALID_LOT_EXP');
5143: fnd_msg_pub.ADD;
5144: RAISE fnd_api.g_exc_unexpected_error;
5145: END IF;
5146:
5147: p_rs_lot_exp_tbl (1) := fnd_date.canonical_to_date (l_lotexpdate);
5148:
5165: fnd_message.set_token ('ENTITY1'
5166: , 'MTL_TRANSACTION_LOTS_INTERFACE'
5167: );
5168: fnd_msg_pub.ADD;
5169: RAISE fnd_api.g_exc_unexpected_error;
5170: END;
5171:
5172: print_debug ('Lot exp date update merge2 ' || l_lotexpdate
5173: , 'Compute Lot Exp'
5187: WHEN NO_DATA_FOUND
5188: THEN
5189: fnd_message.set_name ('INV', 'INV_INVALID_LOT');
5190: fnd_msg_pub.ADD;
5191: RAISE fnd_api.g_exc_unexpected_error;
5192: END;
5193:
5194: print_debug ('Lot exp date after translate1 ' || l_lotexpdate
5195: , 'Compute Lot Exp'
5198: IF (l_lotexpdate IS NULL)
5199: THEN
5200: fnd_message.set_name ('INV', 'INV_INVALID_LOT_EXP');
5201: fnd_msg_pub.ADD;
5202: RAISE fnd_api.g_exc_unexpected_error;
5203: END IF;
5204:
5205: BEGIN
5206: UPDATE mtl_transaction_lots_interface mtli
5219: fnd_message.set_token ('ENTITY1'
5220: , 'MTL_TRANSACTION_LOTS_INTERFACE'
5221: );
5222: fnd_msg_pub.ADD;
5223: RAISE fnd_api.g_exc_unexpected_error;
5224: END;
5225:
5226: print_debug ('Lot exp date update translate2 ' || l_lotexpdate
5227: , 'Compute Lot Exp'
5245: WHEN NO_DATA_FOUND
5246: THEN
5247: fnd_message.set_name ('INV', 'INV_INVALID_LOT');
5248: fnd_msg_pub.ADD;
5249: RAISE fnd_api.g_exc_unexpected_error;
5250: END;
5251:
5252: print_debug ('Lot exp date user defined :split1 ' || l_lotexpdate
5253: , 'Compute Lot Exp'
5269: IF (l_lotexpdate IS NULL)
5270: THEN
5271: fnd_message.set_name ('INV', 'INV_INVALID_LOT_EXP');
5272: fnd_msg_pub.ADD;
5273: RAISE fnd_api.g_exc_unexpected_error;
5274: END IF;
5275:
5276: BEGIN
5277: UPDATE mtl_transaction_lots_interface mtli
5291: fnd_message.set_token ('ENTITY1'
5292: , 'MTL_TRANSACTION_LOTS_INTERFACE'
5293: );
5294: fnd_msg_pub.ADD;
5295: RAISE fnd_api.g_exc_unexpected_error;
5296: END;
5297:
5298: print_debug ( 'Lot exp date user defined : after update split3 '
5299: || l_lotexpdate
5336: , 'Compute Lot Exp'
5337: );
5338: fnd_message.set_name ('INV', 'INV_INVALID_LOT');
5339: fnd_msg_pub.ADD;
5340: RAISE fnd_api.g_exc_unexpected_error;
5341: END;
5342:
5343: print_debug ( 'Lot exp date user defined : Merge3 '
5344: || l_lotexpdate
5358: IF (l_lotexpdate IS NULL)
5359: THEN
5360: fnd_message.set_name ('INV', 'INV_INVALID_LOT_EXP');
5361: fnd_msg_pub.ADD;
5362: RAISE fnd_api.g_exc_unexpected_error;
5363: END IF;
5364:
5365: BEGIN
5366: UPDATE mtl_transaction_lots_interface mtli
5380: fnd_message.set_token ('ENTITY1'
5381: , 'MTL_TRANSACTION_LOTS_INTERFACE'
5382: );
5383: fnd_msg_pub.ADD;
5384: RAISE fnd_api.g_exc_unexpected_error;
5385: END;
5386:
5387: print_debug ( 'Lot exp date user defined : after update Merge6 '
5388: || l_lotexpdate
5406: WHEN NO_DATA_FOUND
5407: THEN
5408: fnd_message.set_name ('INV', 'INV_INVALID_LOT');
5409: fnd_msg_pub.ADD;
5410: RAISE fnd_api.g_exc_unexpected_error;
5411: END;
5412:
5413: print_debug ( 'Lot exp date user defined : Translate1 '
5414: || l_lotexpdate
5418: IF (l_lotexpdate IS NULL)
5419: THEN
5420: fnd_message.set_name ('INV', 'INV_INVALID_LOT_EXP');
5421: fnd_msg_pub.ADD;
5422: RAISE fnd_api.g_exc_unexpected_error;
5423: END IF;
5424:
5425: BEGIN
5426: UPDATE mtl_transaction_lots_interface mtli
5440: fnd_message.set_token ('ENTITY1'
5441: , 'MTL_TRANSACTION_LOTS_INTERFACE'
5442: );
5443: fnd_msg_pub.ADD;
5444: RAISE fnd_api.g_exc_unexpected_error;
5445: END;
5446:
5447: print_debug
5448: ( 'Lot exp date user defined : after update Translate'
5452: END IF;
5453: END IF;
5454: END IF;
5455:
5456: x_return_status := fnd_api.g_ret_sts_success;
5457: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
5458: EXCEPTION
5459: WHEN fnd_api.g_exc_error
5460: THEN
5455:
5456: x_return_status := fnd_api.g_ret_sts_success;
5457: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
5458: EXCEPTION
5459: WHEN fnd_api.g_exc_error
5460: THEN
5461: x_return_status := fnd_api.g_ret_sts_error;
5462: fnd_msg_pub.count_and_get (p_count => x_msg_count
5463: , p_data => x_msg_data);
5457: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
5458: EXCEPTION
5459: WHEN fnd_api.g_exc_error
5460: THEN
5461: x_return_status := fnd_api.g_ret_sts_error;
5462: fnd_msg_pub.count_and_get (p_count => x_msg_count
5463: , p_data => x_msg_data);
5464: WHEN fnd_api.g_exc_unexpected_error
5465: THEN
5460: THEN
5461: x_return_status := fnd_api.g_ret_sts_error;
5462: fnd_msg_pub.count_and_get (p_count => x_msg_count
5463: , p_data => x_msg_data);
5464: WHEN fnd_api.g_exc_unexpected_error
5465: THEN
5466: x_return_status := fnd_api.g_ret_sts_unexp_error;
5467: fnd_msg_pub.count_and_get (p_count => x_msg_count
5468: , p_data => x_msg_data);
5462: fnd_msg_pub.count_and_get (p_count => x_msg_count
5463: , p_data => x_msg_data);
5464: WHEN fnd_api.g_exc_unexpected_error
5465: THEN
5466: x_return_status := fnd_api.g_ret_sts_unexp_error;
5467: fnd_msg_pub.count_and_get (p_count => x_msg_count
5468: , p_data => x_msg_data);
5469: WHEN OTHERS
5470: THEN
5467: fnd_msg_pub.count_and_get (p_count => x_msg_count
5468: , p_data => x_msg_data);
5469: WHEN OTHERS
5470: THEN
5471: x_return_status := fnd_api.g_ret_sts_unexp_error;
5472:
5473: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
5474: THEN
5475: fnd_msg_pub.add_exc_msg (g_pkg_name, 'compute_lot_expiration');
5506: l_update_attr BOOLEAN := FALSE;
5507: l_debug BOOLEAN := TRUE;
5508: BEGIN
5509: x_validation_status := 'Y';
5510: x_return_status := fnd_api.g_ret_sts_success;
5511:
5512: IF (NVL (fnd_profile.VALUE ('INV_DEBUG_TRACE'), 0) = 0)
5513: THEN
5514: l_debug := FALSE;
5546: );
5547: END IF;
5548:
5549: x_validation_status := 'N';
5550: RAISE fnd_api.g_exc_unexpected_error;
5551: END IF;
5552:
5553: SAVEPOINT initial_state_svpt;
5554: l_restrict_serial_rcpt :=
5587: print_debug ('returning..', 'update_item_serial');
5588: END IF;
5589:
5590: x_validation_status := 'Y';
5591: x_return_status := fnd_api.g_ret_sts_success;
5592: RETURN;
5593: END IF;
5594:
5595: IF ((p_to_item_id IS NOT NULL) AND (p_item_id <> p_to_item_id))
5688: /*Bug:5397573. Modified the following message from INV_SERIAL_UNIQUENESS
5689: to INV_JOB_SERIAL_UNIQUENESS. */
5690: fnd_message.set_name ('INV', 'INV_JOB_SERIAL_UNIQUENESS');
5691: fnd_msg_pub.ADD;
5692: RAISE fnd_api.g_exc_error;
5693: END IF;
5694:
5695: IF (l_update_attr) THEN
5696: BEGIN
5836: print_debug ('All updations done, Exitting the procedure', 'update_item_serial');
5837: END IF;
5838:
5839: EXCEPTION
5840: WHEN fnd_api.g_exc_error
5841: THEN
5842: x_return_status := fnd_api.g_ret_sts_error;
5843: fnd_msg_pub.count_and_get (p_count => x_msg_count
5844: , p_data => x_msg_data);
5838:
5839: EXCEPTION
5840: WHEN fnd_api.g_exc_error
5841: THEN
5842: x_return_status := fnd_api.g_ret_sts_error;
5843: fnd_msg_pub.count_and_get (p_count => x_msg_count
5844: , p_data => x_msg_data);
5845: WHEN fnd_api.g_exc_unexpected_error
5846: THEN
5841: THEN
5842: x_return_status := fnd_api.g_ret_sts_error;
5843: fnd_msg_pub.count_and_get (p_count => x_msg_count
5844: , p_data => x_msg_data);
5845: WHEN fnd_api.g_exc_unexpected_error
5846: THEN
5847: x_return_status := fnd_api.g_ret_sts_unexp_error;
5848: fnd_msg_pub.count_and_get (p_count => x_msg_count
5849: , p_data => x_msg_data);
5843: fnd_msg_pub.count_and_get (p_count => x_msg_count
5844: , p_data => x_msg_data);
5845: WHEN fnd_api.g_exc_unexpected_error
5846: THEN
5847: x_return_status := fnd_api.g_ret_sts_unexp_error;
5848: fnd_msg_pub.count_and_get (p_count => x_msg_count
5849: , p_data => x_msg_data);
5850: WHEN rollback_serial_update
5851: THEN
5851: THEN
5852: ROLLBACK TO initial_state_svpt;
5853: WHEN OTHERS
5854: THEN
5855: x_return_status := fnd_api.g_ret_sts_unexp_error;
5856:
5857: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
5858: THEN
5859: fnd_msg_pub.add_exc_msg (g_pkg_name, 'update_item_serial');