80: l_api_name ,
81: G_PKG_NAME )
82: THEN
83: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
84: FND_MSG_PUB.ADD;
85: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
86: END IF;
87: -- Initialize message list if p_init_msg_list is set to TRUE.
88: IF FND_API.to_Boolean( p_init_msg_list ) THEN
85: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
86: END IF;
87: -- Initialize message list if p_init_msg_list is set to TRUE.
88: IF FND_API.to_Boolean( p_init_msg_list ) THEN
89: FND_MSG_PUB.initialize;
90: END IF;
91: -- Initialize API return status to success
92: x_return_status := FND_API.G_RET_STS_SUCCESS;
93:
99: l_lpn.license_plate_number := NULL;
100: l_result := WMS_CONTAINER_PUB.Validate_LPN(l_lpn);
101: IF (l_result = INV_Validate.F) THEN
102: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_LPN');
103: FND_MSG_PUB.ADD;
104: RAISE FND_API.G_EXC_ERROR;
105: END IF;
106:
107: /* End of input validation */
110: OPEN c_lpn;
111: FETCH c_lpn INTO l_lpn_exist;
112: IF c_lpn%FOUND THEN
113: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_NON_EMPTY_LPN');
114: FND_MSG_PUB.ADD;
115: RAISE FND_API.G_EXC_ERROR;
116: END IF;
117: CLOSE c_lpn;
118:
120: OPEN c_lpn_contents;
121: FETCH c_lpn_contents INTO l_lpn_contents_exist;
122: IF c_lpn_contents%FOUND THEN
123: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_NON_EMPTY_LPN');
124: FND_MSG_PUB.ADD;
125: RAISE FND_API.G_EXC_ERROR;
126: END IF;
127: CLOSE c_lpn_contents;
128:
130: OPEN c_lpn_serial_contents;
131: FETCH c_lpn_serial_contents INTO l_lpn_serial_contents_exist;
132: IF c_lpn_serial_contents%FOUND THEN
133: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_NON_EMPTY_LPN');
134: FND_MSG_PUB.ADD;
135: RAISE FND_API.G_EXC_ERROR;
136: END IF;
137: CLOSE c_lpn_serial_contents;
138:
166: COMMIT WORK;
167: END IF;
168: -- Standard call to get message count and if count is 1,
169: -- get message info.
170: FND_MSG_PUB.Count_And_Get
171: ( p_count => x_msg_count,
172: p_data => x_msg_data
173: );
174: EXCEPTION
174: EXCEPTION
175: WHEN FND_API.G_EXC_ERROR THEN
176: ROLLBACK TO Purge_LPN_PUB;
177: x_return_status := FND_API.G_RET_STS_ERROR;
178: FND_MSG_PUB.Count_And_Get
179: ( p_count => x_msg_count,
180: p_data => x_msg_data
181: );
182: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
181: );
182: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
183: ROLLBACK TO Purge_LPN_PUB;
184: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
185: FND_MSG_PUB.Count_And_Get
186: ( p_count => x_msg_count,
187: p_data => x_msg_data
188: );
189: WHEN OTHERS THEN
188: );
189: WHEN OTHERS THEN
190: ROLLBACK TO Purge_LPN_PUB;
191: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
192: IF FND_MSG_PUB.Check_Msg_Level
193: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
194: THEN
195: FND_MSG_PUB.Add_Exc_Msg
196: ( G_PKG_NAME ,
189: WHEN OTHERS THEN
190: ROLLBACK TO Purge_LPN_PUB;
191: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
192: IF FND_MSG_PUB.Check_Msg_Level
193: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
194: THEN
195: FND_MSG_PUB.Add_Exc_Msg
196: ( G_PKG_NAME ,
197: l_api_name
191: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
192: IF FND_MSG_PUB.Check_Msg_Level
193: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
194: THEN
195: FND_MSG_PUB.Add_Exc_Msg
196: ( G_PKG_NAME ,
197: l_api_name
198: );
199: END IF;
196: ( G_PKG_NAME ,
197: l_api_name
198: );
199: END IF;
200: FND_MSG_PUB.Count_And_Get
201: ( p_count => x_msg_count,
202: p_data => x_msg_data
203: );
204:
271: l_api_name ,
272: G_PKG_NAME )
273: THEN
274: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
275: FND_MSG_PUB.ADD;
276: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
277: END IF;
278: -- Initialize message list if p_init_msg_list is set to TRUE.
279: IF FND_API.to_Boolean( p_init_msg_list ) THEN
276: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
277: END IF;
278: -- Initialize message list if p_init_msg_list is set to TRUE.
279: IF FND_API.to_Boolean( p_init_msg_list ) THEN
280: FND_MSG_PUB.initialize;
281: END IF;
282: -- Initialize API return status to success
283: x_return_status := FND_API.G_RET_STS_SUCCESS;
284:
290: l_lpn.license_plate_number := NULL;
291: l_result := WMS_CONTAINER_PUB.Validate_LPN(l_lpn);
292: IF (l_result = INV_Validate.F) THEN
293: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_LPN');
294: FND_MSG_PUB.ADD;
295: RAISE FND_API.G_EXC_ERROR;
296: END IF;
297:
298: /* Validate Explosion Level */
297:
298: /* Validate Explosion Level */
299: IF (p_explosion_level < 0) THEN
300: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_EXP_LVL');
301: FND_MSG_PUB.ADD;
302: RAISE FND_API.G_EXC_ERROR;
303: END IF;
304: /* End of input validation */
305:
458: COMMIT WORK;
459: END IF;
460: -- Standard call to get message count and if count is 1,
461: -- get message info.
462: FND_MSG_PUB.Count_And_Get
463: ( p_count => x_msg_count,
464: p_data => x_msg_data
465: );
466: EXCEPTION
466: EXCEPTION
467: WHEN FND_API.G_EXC_ERROR THEN
468: ROLLBACK TO Explode_LPN_PUB;
469: x_return_status := FND_API.G_RET_STS_ERROR;
470: FND_MSG_PUB.Count_And_Get
471: ( p_count => x_msg_count,
472: p_data => x_msg_data
473: );
474: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
473: );
474: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
475: ROLLBACK TO Explode_LPN_PUB;
476: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
477: FND_MSG_PUB.Count_And_Get
478: ( p_count => x_msg_count,
479: p_data => x_msg_data
480: );
481: WHEN OTHERS THEN
480: );
481: WHEN OTHERS THEN
482: ROLLBACK TO Explode_LPN_PUB;
483: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
484: IF FND_MSG_PUB.Check_Msg_Level
485: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
486: THEN
487: FND_MSG_PUB.Add_Exc_Msg
488: ( G_PKG_NAME ,
481: WHEN OTHERS THEN
482: ROLLBACK TO Explode_LPN_PUB;
483: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
484: IF FND_MSG_PUB.Check_Msg_Level
485: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
486: THEN
487: FND_MSG_PUB.Add_Exc_Msg
488: ( G_PKG_NAME ,
489: l_api_name
483: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
484: IF FND_MSG_PUB.Check_Msg_Level
485: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
486: THEN
487: FND_MSG_PUB.Add_Exc_Msg
488: ( G_PKG_NAME ,
489: l_api_name
490: );
491: END IF;
488: ( G_PKG_NAME ,
489: l_api_name
490: );
491: END IF;
492: FND_MSG_PUB.Count_And_Get
493: ( p_count => x_msg_count,
494: p_data => x_msg_data
495: );
496:
526: l_api_name ,
527: G_PKG_NAME )
528: THEN
529: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
530: FND_MSG_PUB.ADD;
531: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
532: END IF;
533: -- Initialize message list if p_init_msg_list is set to TRUE.
534: IF FND_API.to_Boolean( p_init_msg_list ) THEN
531: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
532: END IF;
533: -- Initialize message list if p_init_msg_list is set to TRUE.
534: IF FND_API.to_Boolean( p_init_msg_list ) THEN
535: FND_MSG_PUB.initialize;
536: END IF;
537: -- Initialize API return status to success
538: x_return_status := FND_API.G_RET_STS_SUCCESS;
539:
545: l_lpn_source.license_plate_number := NULL;
546: l_result := WMS_CONTAINER_PUB.Validate_LPN(l_lpn_source);
547: IF (l_result = INV_Validate.F) THEN
548: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_LPN');
549: FND_MSG_PUB.ADD;
550: RAISE FND_API.G_EXC_ERROR;
551: END IF;
552:
553: /* Validate destination LPN */
555: l_lpn_dest.license_plate_number := NULL;
556: l_result := WMS_CONTAINER_PUB.Validate_LPN(l_lpn_dest);
557: IF (l_result = INV_Validate.F) THEN
558: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_LPN');
559: FND_MSG_PUB.ADD;
560: RAISE FND_API.G_EXC_ERROR;
561: END IF;
562: /* End of input validation */
563:
580: COMMIT WORK;
581: END IF;
582: -- Standard call to get message count and if count is 1,
583: -- get message info.
584: FND_MSG_PUB.Count_And_Get
585: ( p_count => x_msg_count,
586: p_data => x_msg_data
587: );
588: EXCEPTION
588: EXCEPTION
589: WHEN FND_API.G_EXC_ERROR THEN
590: ROLLBACK TO Transfer_LPN_Contents_PUB;
591: x_return_status := FND_API.G_RET_STS_ERROR;
592: FND_MSG_PUB.Count_And_Get
593: ( p_count => x_msg_count,
594: p_data => x_msg_data
595: );
596: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
595: );
596: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
597: ROLLBACK TO Transfer_LPN_Contents_PUB;
598: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
599: FND_MSG_PUB.Count_And_Get
600: ( p_count => x_msg_count,
601: p_data => x_msg_data
602: );
603: WHEN OTHERS THEN
602: );
603: WHEN OTHERS THEN
604: ROLLBACK TO Transfer_LPN_Contents_PUB;
605: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
606: IF FND_MSG_PUB.Check_Msg_Level
607: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
608: THEN
609: FND_MSG_PUB.Add_Exc_Msg
610: ( G_PKG_NAME ,
603: WHEN OTHERS THEN
604: ROLLBACK TO Transfer_LPN_Contents_PUB;
605: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
606: IF FND_MSG_PUB.Check_Msg_Level
607: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
608: THEN
609: FND_MSG_PUB.Add_Exc_Msg
610: ( G_PKG_NAME ,
611: l_api_name
605: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
606: IF FND_MSG_PUB.Check_Msg_Level
607: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
608: THEN
609: FND_MSG_PUB.Add_Exc_Msg
610: ( G_PKG_NAME ,
611: l_api_name
612: );
613: END IF;
610: ( G_PKG_NAME ,
611: l_api_name
612: );
613: END IF;
614: FND_MSG_PUB.Count_And_Get
615: ( p_count => x_msg_count,
616: p_data => x_msg_data
617: );
618:
682: l_api_name ,
683: G_PKG_NAME )
684: THEN
685: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
686: FND_MSG_PUB.ADD;
687: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
688: END IF;
689: -- Initialize message list if p_init_msg_list is set to TRUE.
690: IF FND_API.to_Boolean( p_init_msg_list ) THEN
687: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
688: END IF;
689: -- Initialize message list if p_init_msg_list is set to TRUE.
690: IF FND_API.to_Boolean( p_init_msg_list ) THEN
691: FND_MSG_PUB.initialize;
692: END IF;
693: -- Initialize API return status to success
694: x_return_status := FND_API.G_RET_STS_SUCCESS;
695:
700: l_org.organization_id := p_organization_id;
701: l_result := INV_Validate.Organization(l_org);
702: IF (l_result = INV_Validate.F) THEN
703: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_ORG');
704: FND_MSG_PUB.ADD;
705: RAISE FND_API.G_EXC_ERROR;
706: END IF;
707:
708: /* Validate Source item */
709: l_source_item.inventory_item_id := p_source_item_id;
710: l_result := INV_Validate.inventory_item(l_source_item, l_org);
711: IF (l_result = INV_Validate.F) THEN
712: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_ITEM');
713: FND_MSG_PUB.ADD;
714: RAISE FND_API.G_EXC_ERROR;
715: END IF;
716:
717: /* Validate Source Quantity */
716:
717: /* Validate Source Quantity */
718: IF ((p_source_qty IS NULL) OR (p_source_qty <= 0)) THEN
719: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_SRC_QTY');
720: FND_MSG_PUB.ADD;
721: RAISE FND_API.G_EXC_ERROR;
722: END IF;
723:
724: /* Validate Source UOM */
724: /* Validate Source UOM */
725: l_result := INV_Validate.Uom(p_source_qty_uom, l_org, l_source_item);
726: IF (l_result = INV_Validate.F) THEN
727: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_SRC_UOM');
728: FND_MSG_PUB.ADD;
729: RAISE FND_API.G_EXC_ERROR;
730: END IF;
731:
732: /* Validate Quantity Per Container */
732: /* Validate Quantity Per Container */
733: IF (p_qty_per_cont IS NOT NULL) THEN
734: IF (p_qty_per_cont <= 0) THEN
735: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVLD_QTY_PER_CONT');
736: FND_MSG_PUB.ADD;
737: RAISE FND_API.G_EXC_ERROR;
738: END IF;
739: END IF;
740:
742: IF (p_qty_per_cont IS NOT NULL) THEN
743: l_result := INV_Validate.Uom(p_qty_per_cont_uom, l_org, l_source_item);
744: IF (l_result = INV_Validate.F) THEN
745: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVLD_QTY_PER_UOM');
746: FND_MSG_PUB.ADD;
747: RAISE FND_API.G_EXC_ERROR;
748: END IF;
749: END IF;
750:
753: l_dest_cont_item.inventory_item_id := p_dest_cont_item_id;
754: l_result := INV_Validate.inventory_item(l_dest_cont_item, l_org);
755: IF (l_result = INV_Validate.F) THEN
756: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_CONT_ITEM');
757: FND_MSG_PUB.ADD;
758: RAISE FND_API.G_EXC_ERROR;
759: ELSIF (l_dest_cont_item.container_item_flag = 'N') THEN
760: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_ITEM_NOT_A_CONT');
761: FND_MSG_PUB.ADD;
757: FND_MSG_PUB.ADD;
758: RAISE FND_API.G_EXC_ERROR;
759: ELSIF (l_dest_cont_item.container_item_flag = 'N') THEN
760: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_ITEM_NOT_A_CONT');
761: FND_MSG_PUB.ADD;
762: RAISE FND_API.G_EXC_ERROR;
763: END IF;
764: END IF;
765: /* End of input validation */
776: (l_source_item.weight_uom_code IS NULL) OR
777: (l_source_item.unit_volume IS NULL) OR
778: (l_source_item.volume_uom_code IS NULL)) THEN
779: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_NOT_ENOUGH_INFO');
780: FND_MSG_PUB.ADD;
781: RAISE FND_API.G_EXC_ERROR;
782: END IF;
783:
784: /* Volume constraint */
788: l_dest_cont_item.volume_uom_code,
789: NULL, NULL);
790: IF (l_temp_value = -99999) THEN
791: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_CONVERSION');
792: FND_MSG_PUB.ADD;
793: RAISE FND_API.G_EXC_ERROR;
794: END IF;
795:
796: IF (l_dest_cont_item.internal_volume IS NOT NULL) THEN
799: IF (l_temp_value <= l_dest_cont_item.internal_volume) THEN
800: l_max_load_quantity := FLOOR(l_dest_cont_item.internal_volume/l_temp_value);
801: ELSE
802: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_ITEM_TOO_LARGE');
803: FND_MSG_PUB.ADD;
804: RAISE FND_API.G_EXC_ERROR;
805: END IF;
806: END IF;
807: /* Weight constraint */
811: l_dest_cont_item.weight_uom_code,
812: NULL, NULL);
813: IF (l_temp_value = -99999) THEN
814: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_CONVERSION');
815: FND_MSG_PUB.ADD;
816: RAISE FND_API.G_EXC_ERROR;
817: END IF;
818:
819: /* Select the most constraining value for l_max_load_quantity */
827: l_temp_value);
828: END IF;
829: ELSE
830: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_ITEM_TOO_LARGE');
831: FND_MSG_PUB.ADD;
832: RAISE FND_API.G_EXC_ERROR;
833: END IF;
834: END IF;
835: END IF;
843: p_source_qty_uom,
844: NULL, NULL);
845: IF (l_max_load_quantity = -99999) THEN
846: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_CONVERSION');
847: FND_MSG_PUB.ADD;
848: RAISE FND_API.G_EXC_ERROR;
849: END IF;
850: END IF;
851:
857: p_source_qty_uom,
858: NULL, NULL);
859: IF (l_qty_per_cont = -99999) THEN
860: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_CONVERSION');
861: FND_MSG_PUB.ADD;
862: RAISE FND_API.G_EXC_ERROR;
863: END IF;
864:
865: IF (l_qty_per_cont > l_max_load_quantity) THEN
863: END IF;
864:
865: IF (l_qty_per_cont > l_max_load_quantity) THEN
866: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_OVERPACKED_OPERATION');
867: FND_MSG_PUB.ADD;
868: RAISE FND_API.G_EXC_ERROR;
869: ELSE
870: p_qty_required := CEIL(p_source_qty/l_qty_per_cont);
871: END IF;
888: l_cont_item.inventory_item_id := v_container_item.container_item_id;
889: l_result := INV_Validate.inventory_item(l_cont_item, l_org);
890: IF (l_result = INV_Validate.F) THEN
891: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_CONT_ITEM');
892: FND_MSG_PUB.ADD;
893: RAISE FND_API.G_EXC_ERROR;
894: END IF;
895:
896: /* Get the max load quantity for that given container */
898: (l_source_item.inventory_item_id, 6, v_container_item.max_load_quantity,
899: l_source_item.primary_uom_code, p_source_qty_uom, NULL, NULL);
900: IF (l_temp_load_quantity = -99999) THEN
901: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_CONVERSION');
902: FND_MSG_PUB.ADD;
903: RAISE FND_API.G_EXC_ERROR;
904: END IF;
905:
906: -- Calculate the min value, i.e. how much space is empty in the final container
931: /* No containers were found that can store the source item */
932: IF (l_curr_min_container = 0) THEN
933: p_qty_required := 0;
934: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_NO_CONTAINER_FOUND');
935: FND_MSG_PUB.ADD;
936: RAISE FND_API.G_EXC_ERROR;
937: ELSE
938: /* Valid container found. Store this information in the output parameters */
939: p_dest_cont_item_id := l_curr_min_container;
947: COMMIT WORK;
948: END IF;
949: -- Standard call to get message count and if count is 1,
950: -- get message info.
951: FND_MSG_PUB.Count_And_Get
952: ( p_count => x_msg_count,
953: p_data => x_msg_data
954: );
955: EXCEPTION
955: EXCEPTION
956: WHEN FND_API.G_EXC_ERROR THEN
957: ROLLBACK TO Container_Required_Qty_PUB;
958: x_return_status := FND_API.G_RET_STS_ERROR;
959: FND_MSG_PUB.Count_And_Get
960: ( p_count => x_msg_count,
961: p_data => x_msg_data
962: );
963: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
962: );
963: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
964: ROLLBACK TO Container_Required_Qty_PUB;
965: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
966: FND_MSG_PUB.Count_And_Get
967: ( p_count => x_msg_count,
968: p_data => x_msg_data
969: );
970: WHEN OTHERS THEN
969: );
970: WHEN OTHERS THEN
971: ROLLBACK TO Container_Required_Qty_PUB;
972: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
973: IF FND_MSG_PUB.Check_Msg_Level
974: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
975: THEN
976: FND_MSG_PUB.Add_Exc_Msg
977: ( G_PKG_NAME ,
970: WHEN OTHERS THEN
971: ROLLBACK TO Container_Required_Qty_PUB;
972: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
973: IF FND_MSG_PUB.Check_Msg_Level
974: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
975: THEN
976: FND_MSG_PUB.Add_Exc_Msg
977: ( G_PKG_NAME ,
978: l_api_name
972: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
973: IF FND_MSG_PUB.Check_Msg_Level
974: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
975: THEN
976: FND_MSG_PUB.Add_Exc_Msg
977: ( G_PKG_NAME ,
978: l_api_name
979: );
980: END IF;
977: ( G_PKG_NAME ,
978: l_api_name
979: );
980: END IF;
981: FND_MSG_PUB.Count_And_Get
982: ( p_count => x_msg_count,
983: p_data => x_msg_data
984: );
985:
1038: l_api_name ,
1039: G_PKG_NAME )
1040: THEN
1041: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
1042: FND_MSG_PUB.ADD;
1043: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1044: END IF;
1045: -- Initialize message list if p_init_msg_list is set to TRUE.
1046: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1043: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1044: END IF;
1045: -- Initialize message list if p_init_msg_list is set to TRUE.
1046: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1047: FND_MSG_PUB.initialize;
1048: END IF;
1049: -- Initialize API return status to success
1050: x_return_status := FND_API.G_RET_STS_SUCCESS;
1051:
1054:
1055: /* Validate that enough info has been passed in */
1056: IF ((p_lpn_id IS NULL) AND (p_inventory_item_id IS NULL)) THEN
1057: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_NOT_ENOUGH_INFO');
1058: FND_MSG_PUB.ADD;
1059: RAISE FND_API.G_EXC_ERROR;
1060: END IF;
1061:
1062: /* Validate LPN */
1065: l_lpn.license_plate_number := NULL;
1066: l_result := WMS_CONTAINER_PUB.Validate_LPN(l_lpn);
1067: IF (l_result = INV_Validate.F) THEN
1068: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_LPN');
1069: FND_MSG_PUB.ADD;
1070: RAISE FND_API.G_EXC_ERROR;
1071: END IF;
1072: END IF;
1073: /* End of input validation */
1195: COMMIT WORK;
1196: END IF;
1197: -- Standard call to get message count and if count is 1,
1198: -- get message info.
1199: FND_MSG_PUB.Count_And_Get
1200: ( p_count => x_msg_count,
1201: p_data => x_msg_data
1202: );
1203:
1204: EXCEPTION
1205: WHEN FND_API.G_EXC_ERROR THEN
1206: ROLLBACK TO Get_Outermost_LPN_PUB;
1207: x_return_status := FND_API.G_RET_STS_ERROR;
1208: FND_MSG_PUB.Count_And_Get
1209: ( p_count => x_msg_count,
1210: p_data => x_msg_data
1211: );
1212: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1211: );
1212: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1213: ROLLBACK TO Get_Outermost_LPN_PUB;
1214: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1215: FND_MSG_PUB.Count_And_Get
1216: ( p_count => x_msg_count,
1217: p_data => x_msg_data
1218: );
1219: WHEN OTHERS THEN
1219: WHEN OTHERS THEN
1220: DBMS_SQL.CLOSE_CURSOR(l_CursorID);
1221: ROLLBACK TO Get_Outermost_LPN_PUB;
1222: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1223: IF FND_MSG_PUB.Check_Msg_Level
1224: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1225: THEN
1226: FND_MSG_PUB.Add_Exc_Msg
1227: ( G_PKG_NAME ,
1220: DBMS_SQL.CLOSE_CURSOR(l_CursorID);
1221: ROLLBACK TO Get_Outermost_LPN_PUB;
1222: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1223: IF FND_MSG_PUB.Check_Msg_Level
1224: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1225: THEN
1226: FND_MSG_PUB.Add_Exc_Msg
1227: ( G_PKG_NAME ,
1228: l_api_name
1222: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1223: IF FND_MSG_PUB.Check_Msg_Level
1224: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1225: THEN
1226: FND_MSG_PUB.Add_Exc_Msg
1227: ( G_PKG_NAME ,
1228: l_api_name
1229: );
1230: END IF;
1227: ( G_PKG_NAME ,
1228: l_api_name
1229: );
1230: END IF;
1231: FND_MSG_PUB.Count_And_Get
1232: ( p_count => x_msg_count,
1233: p_data => x_msg_data
1234: );
1235:
1295: l_api_name ,
1296: G_PKG_NAME )
1297: THEN
1298: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
1299: FND_MSG_PUB.ADD;
1300: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1301: END IF;
1302: -- Initialize message list if p_init_msg_list is set to TRUE.
1303: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1300: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1301: END IF;
1302: -- Initialize message list if p_init_msg_list is set to TRUE.
1303: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1304: FND_MSG_PUB.initialize;
1305: END IF;
1306: -- Initialize API return status to success
1307: x_return_status := FND_API.G_RET_STS_SUCCESS;
1308:
1313: l_org.organization_id := p_organization_id;
1314: l_result := INV_Validate.Organization(l_org);
1315: IF (l_result = INV_Validate.F) THEN
1316: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INVALID_ORG');
1317: FND_MSG_PUB.ADD;
1318: RAISE FND_API.G_EXC_ERROR;
1319: END IF;
1320: /* End of input validation */
1321:
1449: COMMIT WORK;
1450: END IF;
1451: -- Standard call to get message count and if count is 1,
1452: -- get message info.
1453: FND_MSG_PUB.Count_And_Get
1454: ( p_count => x_msg_count,
1455: p_data => x_msg_data
1456: );
1457:
1458: EXCEPTION
1459: WHEN FND_API.G_EXC_ERROR THEN
1460: ROLLBACK TO Get_LPN_List_PUB;
1461: x_return_status := FND_API.G_RET_STS_ERROR;
1462: FND_MSG_PUB.Count_And_Get
1463: ( p_count => x_msg_count,
1464: p_data => x_msg_data
1465: );
1466: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1465: );
1466: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1467: ROLLBACK TO Get_LPN_List_PUB;
1468: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1469: FND_MSG_PUB.Count_And_Get
1470: ( p_count => x_msg_count,
1471: p_data => x_msg_data
1472: );
1473: WHEN OTHERS THEN
1473: WHEN OTHERS THEN
1474: DBMS_SQL.CLOSE_CURSOR(l_CursorID);
1475: ROLLBACK TO Get_LPN_List_PUB;
1476: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1477: IF FND_MSG_PUB.Check_Msg_Level
1478: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1479: THEN
1480: FND_MSG_PUB.Add_Exc_Msg
1481: ( G_PKG_NAME ,
1474: DBMS_SQL.CLOSE_CURSOR(l_CursorID);
1475: ROLLBACK TO Get_LPN_List_PUB;
1476: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1477: IF FND_MSG_PUB.Check_Msg_Level
1478: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1479: THEN
1480: FND_MSG_PUB.Add_Exc_Msg
1481: ( G_PKG_NAME ,
1482: l_api_name
1476: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1477: IF FND_MSG_PUB.Check_Msg_Level
1478: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1479: THEN
1480: FND_MSG_PUB.Add_Exc_Msg
1481: ( G_PKG_NAME ,
1482: l_api_name
1483: );
1484: END IF;
1481: ( G_PKG_NAME ,
1482: l_api_name
1483: );
1484: END IF;
1485: FND_MSG_PUB.Count_And_Get
1486: ( p_count => x_msg_count,
1487: p_data => x_msg_data
1488: );
1489:
1808: , l_api_name
1809: , G_PKG_NAME
1810: ) THEN
1811: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
1812: FND_MSG_PUB.ADD;
1813: RAISE FND_API.G_EXC_ERROR;
1814: END IF;
1815:
1816: --
1816: --
1817: -- Initialize message list.
1818: --
1819: IF fnd_api.to_boolean(p_init_msg_lst) THEN
1820: fnd_msg_pub.initialize;
1821: END IF;
1822:
1823: --
1824: -- Initialize API return status to success
1870: IF (l_debug = 1) THEN
1871: mdebug ('Drop LPN cannot be the picked LPN.');
1872: END IF;
1873: FND_MESSAGE.SET_NAME('WMS', 'WMS_PICK_LPN_INVLD_DROP_LPN');
1874: FND_MSG_PUB.ADD;
1875: RAISE FND_API.G_EXC_ERROR;
1876: END IF;
1877:
1878: --
1927: IF (l_debug = 1) THEN
1928: mdebug('Drop LPN does not have child LPNs with picked inventory.');
1929: END IF;
1930: FND_MESSAGE.SET_NAME('WMS', 'WMS_DROP_LPN_NOT_PICKED');
1931: FND_MSG_PUB.ADD;
1932: RAISE FND_API.G_EXC_ERROR;
1933: END IF;
1934: END IF;
1935:
1967: IF (l_debug = 1) THEN
1968: mdebug('Picked and drop LPNs are on different deliveries.');
1969: END IF;
1970: FND_MESSAGE.SET_NAME('WMS', 'WMS_DROP_LPN_DIFF_DELIV');
1971: FND_MSG_PUB.ADD;
1972: RAISE FND_API.G_EXC_ERROR;
1973: ELSE
1974: --
1975: -- Drop LPN and picked LPN are on the same delivery
2006: IF (l_debug = 1) THEN
2007: mdebug('LPNs are on diff deliveries.');
2008: END IF;
2009: FND_MESSAGE.SET_NAME('WMS', 'WMS_DROP_LPN_DIFF_DELIV');
2010: FND_MSG_PUB.ADD;
2011: RAISE FND_API.G_EXC_ERROR;
2012: ELSE
2013: --
2014: -- Drop LPN has a child LPN that is assigned to the
2035: WHEN fnd_api.g_exc_error THEN
2036: x_return_status := fnd_api.g_ret_sts_error;
2037:
2038: -- Get message count and data
2039: fnd_msg_pub.count_and_get
2040: ( p_count => x_msg_count
2041: , p_data => x_msg_data
2042: );
2043: IF (l_debug = 1) THEN
2046:
2047: WHEN OTHERS THEN
2048: x_return_status := fnd_api.g_ret_sts_unexp_error ;
2049:
2050: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
2051: THEN
2052: fnd_msg_pub.add_exc_msg
2053: ( g_pkg_name
2054: , l_api_name
2048: x_return_status := fnd_api.g_ret_sts_unexp_error ;
2049:
2050: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
2051: THEN
2052: fnd_msg_pub.add_exc_msg
2053: ( g_pkg_name
2054: , l_api_name
2055: );
2056: END IF;
2055: );
2056: END IF;
2057:
2058: -- Get message count and data
2059: fnd_msg_pub.count_and_get
2060: ( p_count => x_msg_count
2061: , p_data => x_msg_data
2062: );
2063: IF (l_debug = 1) THEN
2127: , l_api_name
2128: , G_PKG_NAME
2129: ) THEN
2130: FND_MESSAGE.SET_NAME('WMS', 'WMS_CONT_INCOMPATIBLE_API_CALL');
2131: FND_MSG_PUB.ADD;
2132: RAISE FND_API.G_EXC_ERROR;
2133: END IF;
2134:
2135:
2138: -- Initialize message list.
2139: --
2140:
2141: IF fnd_api.to_boolean(p_init_msg_lst) THEN
2142: fnd_msg_pub.initialize;
2143: END IF;
2144:
2145:
2146: BEGIN