113: * EFFECTS:
114: * Determines if it is not ok to perform a Supplier Merge.
115: *
116: * RETURNS:
117: * x_return_status - (a) FND_API.G_RET_STS_SUCCESS if validation successful
118: * (b) FND_API.G_RET_STS_ERROR if error during validation
119: * (c) FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
120: *
121: * x_result - (a) FND_API.G_TRUE if restrictions are met
114: * Determines if it is not ok to perform a Supplier Merge.
115: *
116: * RETURNS:
117: * x_return_status - (a) FND_API.G_RET_STS_SUCCESS if validation successful
118: * (b) FND_API.G_RET_STS_ERROR if error during validation
119: * (c) FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
120: *
121: * x_result - (a) FND_API.G_TRUE if restrictions are met
122: * (b) FND_API.G_FALSE if not ok to perform Supplier Merge
115: *
116: * RETURNS:
117: * x_return_status - (a) FND_API.G_RET_STS_SUCCESS if validation successful
118: * (b) FND_API.G_RET_STS_ERROR if error during validation
119: * (c) FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
120: *
121: * x_result - (a) FND_API.G_TRUE if restrictions are met
122: * (b) FND_API.G_FALSE if not ok to perform Supplier Merge
123: *
117: * x_return_status - (a) FND_API.G_RET_STS_SUCCESS if validation successful
118: * (b) FND_API.G_RET_STS_ERROR if error during validation
119: * (c) FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
120: *
121: * x_result - (a) FND_API.G_TRUE if restrictions are met
122: * (b) FND_API.G_FALSE if not ok to perform Supplier Merge
123: *
124: *===========================================================================
125: */
118: * (b) FND_API.G_RET_STS_ERROR if error during validation
119: * (c) FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
120: *
121: * x_result - (a) FND_API.G_TRUE if restrictions are met
122: * (b) FND_API.G_FALSE if not ok to perform Supplier Merge
123: *
124: *===========================================================================
125: */
126: PROCEDURE validate_merge
159: ( p_log_head => l_module
160: );
161: END IF;
162:
163: x_return_status := FND_API.G_RET_STS_SUCCESS; -- Initialize return status
164:
165: l_progress := '000';
166:
167: --
165: l_progress := '000';
166:
167: --
168:
169: IF (NOT FND_API.Compatible_API_Call
170: ( p_current_version_number => l_api_version,
171: p_caller_version_number => p_api_version,
172: p_api_name => l_api_name,
173: p_pkg_name => g_pkg_name
173: p_pkg_name => g_pkg_name
174: )
175: ) THEN
176:
177: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
178: END IF;
179:
180: -- get vendor name info in case we need to report an error
181: get_vdr_and_site_name
540: , x_can_merge => l_consigned_can_merge
541: , x_validation_error => x_validation_error
542: );
543:
544: IF (l_consigned_ret_sts = FND_API.G_RET_STS_SUCCESS) THEN
545: IF (l_consigned_can_merge = FND_API.G_FALSE) THEN
546: RAISE PO_CONSIGNMENT_EXIST;
547: END IF;
548: ELSE
541: , x_validation_error => x_validation_error
542: );
543:
544: IF (l_consigned_ret_sts = FND_API.G_RET_STS_SUCCESS) THEN
545: IF (l_consigned_can_merge = FND_API.G_FALSE) THEN
546: RAISE PO_CONSIGNMENT_EXIST;
547: END IF;
548: ELSE
549: x_result := FND_API.G_FALSE;
545: IF (l_consigned_can_merge = FND_API.G_FALSE) THEN
546: RAISE PO_CONSIGNMENT_EXIST;
547: END IF;
548: ELSE
549: x_result := FND_API.G_FALSE;
550: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
551: END IF;
552:
553: IF (g_debug_stmt) THEN
546: RAISE PO_CONSIGNMENT_EXIST;
547: END IF;
548: ELSE
549: x_result := FND_API.G_FALSE;
550: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
551: END IF;
552:
553: IF (g_debug_stmt) THEN
554: PO_DEBUG.debug_end
556: );
557: END IF;
558:
559: -- If no exceptions were raised in previous loops, then validation passed
560: x_result := FND_API.G_TRUE;
561:
562: EXCEPTION
563:
564: WHEN GA_FOR_SITE_AND_PGOA_SITE_DIFF THEN
561:
562: EXCEPTION
563:
564: WHEN GA_FOR_SITE_AND_PGOA_SITE_DIFF THEN
565: x_result := FND_API.G_FALSE;
566: x_return_status := FND_API.G_RET_STS_ERROR;
567:
568: IF (g_debug_stmt) THEN
569: PO_DEBUG.debug_stmt
562: EXCEPTION
563:
564: WHEN GA_FOR_SITE_AND_PGOA_SITE_DIFF THEN
565: x_result := FND_API.G_FALSE;
566: x_return_status := FND_API.G_RET_STS_ERROR;
567:
568: IF (g_debug_stmt) THEN
569: PO_DEBUG.debug_stmt
570: ( p_log_head => l_module,
579:
580: APP_EXCEPTION.raise_exception;
581:
582: WHEN GA_FOR_SITE_W_POREF_FRM_OTR_OU THEN
583: x_result := FND_API.G_FALSE;
584: x_return_status := FND_API.G_RET_STS_ERROR;
585:
586: IF (g_debug_stmt) THEN
587: PO_DEBUG.debug_stmt
580: APP_EXCEPTION.raise_exception;
581:
582: WHEN GA_FOR_SITE_W_POREF_FRM_OTR_OU THEN
583: x_result := FND_API.G_FALSE;
584: x_return_status := FND_API.G_RET_STS_ERROR;
585:
586: IF (g_debug_stmt) THEN
587: PO_DEBUG.debug_stmt
588: ( p_log_head => l_module,
597:
598: APP_EXCEPTION.raise_exception;
599:
600: WHEN GA_FOR_SITE_W_POREF_DIFF_SITE THEN
601: x_result := FND_API.G_FALSE;
602: x_return_status := FND_API.G_RET_STS_ERROR;
603:
604: IF (g_debug_stmt) THEN
605: PO_DEBUG.debug_stmt
598: APP_EXCEPTION.raise_exception;
599:
600: WHEN GA_FOR_SITE_W_POREF_DIFF_SITE THEN
601: x_result := FND_API.G_FALSE;
602: x_return_status := FND_API.G_RET_STS_ERROR;
603:
604: IF (g_debug_stmt) THEN
605: PO_DEBUG.debug_stmt
606: ( p_log_head => l_module,
615:
616: APP_EXCEPTION.raise_exception;
617:
618: WHEN PGOA_FOR_SITE_AND_GA_SITE_DIFF THEN
619: x_result := FND_API.G_FALSE;
620: x_return_status := FND_API.G_RET_STS_ERROR;
621:
622: IF (g_debug_stmt) THEN
623: PO_DEBUG.debug_stmt
616: APP_EXCEPTION.raise_exception;
617:
618: WHEN PGOA_FOR_SITE_AND_GA_SITE_DIFF THEN
619: x_result := FND_API.G_FALSE;
620: x_return_status := FND_API.G_RET_STS_ERROR;
621:
622: IF (g_debug_stmt) THEN
623: PO_DEBUG.debug_stmt
624: ( p_log_head => l_module,
632:
633: APP_EXCEPTION.raise_exception;
634:
635: WHEN SPO_FOR_SITE_AND_GA_SITE_DIFF THEN
636: x_result := FND_API.G_FALSE;
637: x_return_status := FND_API.G_RET_STS_ERROR;
638:
639: IF (g_debug_stmt) THEN
640: PO_DEBUG.debug_stmt
633: APP_EXCEPTION.raise_exception;
634:
635: WHEN SPO_FOR_SITE_AND_GA_SITE_DIFF THEN
636: x_result := FND_API.G_FALSE;
637: x_return_status := FND_API.G_RET_STS_ERROR;
638:
639: IF (g_debug_stmt) THEN
640: PO_DEBUG.debug_stmt
641: ( p_log_head => l_module,
650:
651: APP_EXCEPTION.raise_exception;
652:
653: WHEN REQ_FOR_VDR_REF_GA_IN_OTHER_OU THEN
654: x_result := FND_API.G_FALSE;
655: x_return_status := FND_API.G_RET_STS_ERROR;
656:
657: IF (g_debug_stmt) THEN
658: PO_DEBUG.debug_stmt
651: APP_EXCEPTION.raise_exception;
652:
653: WHEN REQ_FOR_VDR_REF_GA_IN_OTHER_OU THEN
654: x_result := FND_API.G_FALSE;
655: x_return_status := FND_API.G_RET_STS_ERROR;
656:
657: IF (g_debug_stmt) THEN
658: PO_DEBUG.debug_stmt
659: ( p_log_head => l_module,
667:
668: APP_EXCEPTION.raise_exception;
669:
670: WHEN REQ_FOR_SITE_REF_GA_DIFF_SITE THEN
671: x_result := FND_API.G_FALSE;
672: x_return_status := FND_API.G_RET_STS_ERROR;
673:
674: IF (g_debug_stmt) THEN
675: PO_DEBUG.debug_stmt
668: APP_EXCEPTION.raise_exception;
669:
670: WHEN REQ_FOR_SITE_REF_GA_DIFF_SITE THEN
671: x_result := FND_API.G_FALSE;
672: x_return_status := FND_API.G_RET_STS_ERROR;
673:
674: IF (g_debug_stmt) THEN
675: PO_DEBUG.debug_stmt
676: ( p_log_head => l_module,
685:
686: APP_EXCEPTION.raise_exception;
687:
688: WHEN GA_FOR_SITE_W_REQREF_DIFF_SITE THEN
689: x_result := FND_API.G_FALSE;
690: x_return_status := FND_API.G_RET_STS_ERROR;
691:
692: IF (g_debug_stmt) THEN
693: PO_DEBUG.debug_stmt
686: APP_EXCEPTION.raise_exception;
687:
688: WHEN GA_FOR_SITE_W_REQREF_DIFF_SITE THEN
689: x_result := FND_API.G_FALSE;
690: x_return_status := FND_API.G_RET_STS_ERROR;
691:
692: IF (g_debug_stmt) THEN
693: PO_DEBUG.debug_stmt
694: ( p_log_head => l_module,
703:
704: APP_EXCEPTION.raise_exception;
705:
706: WHEN PO_CONSIGNMENT_EXIST THEN
707: x_result := FND_API.G_FALSE;
708: FND_MESSAGE.set_name('PO', x_validation_error);
709:
710: APP_EXCEPTION.raise_exception;
711:
712: WHEN PO_INVALID_VENDOR_SITE_ID THEN
713:
714: -- bug2814492
715: -- set x_result to G_FALSE whenever there is an error
716: x_result := FND_API.G_FALSE;
717: po_message_s.sql_error(l_api_name, l_progress || '-1', sqlcode);
718: x_return_status := FND_API.G_RET_STS_ERROR;
719:
720: WHEN FND_API.G_EXC_ERROR THEN
714: -- bug2814492
715: -- set x_result to G_FALSE whenever there is an error
716: x_result := FND_API.G_FALSE;
717: po_message_s.sql_error(l_api_name, l_progress || '-1', sqlcode);
718: x_return_status := FND_API.G_RET_STS_ERROR;
719:
720: WHEN FND_API.G_EXC_ERROR THEN
721: -- bug2814492
722: x_result := FND_API.G_FALSE;
716: x_result := FND_API.G_FALSE;
717: po_message_s.sql_error(l_api_name, l_progress || '-1', sqlcode);
718: x_return_status := FND_API.G_RET_STS_ERROR;
719:
720: WHEN FND_API.G_EXC_ERROR THEN
721: -- bug2814492
722: x_result := FND_API.G_FALSE;
723: po_message_s.sql_error(l_api_name, l_progress ||'-2', sqlcode);
724: x_return_status := FND_API.G_RET_STS_ERROR;
718: x_return_status := FND_API.G_RET_STS_ERROR;
719:
720: WHEN FND_API.G_EXC_ERROR THEN
721: -- bug2814492
722: x_result := FND_API.G_FALSE;
723: po_message_s.sql_error(l_api_name, l_progress ||'-2', sqlcode);
724: x_return_status := FND_API.G_RET_STS_ERROR;
725:
726: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
720: WHEN FND_API.G_EXC_ERROR THEN
721: -- bug2814492
722: x_result := FND_API.G_FALSE;
723: po_message_s.sql_error(l_api_name, l_progress ||'-2', sqlcode);
724: x_return_status := FND_API.G_RET_STS_ERROR;
725:
726: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
727: -- bug2814492
728: x_result := FND_API.G_FALSE;
722: x_result := FND_API.G_FALSE;
723: po_message_s.sql_error(l_api_name, l_progress ||'-2', sqlcode);
724: x_return_status := FND_API.G_RET_STS_ERROR;
725:
726: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
727: -- bug2814492
728: x_result := FND_API.G_FALSE;
729: po_message_s.sql_error(l_api_name, l_progress || '-3', sqlcode);
730: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
724: x_return_status := FND_API.G_RET_STS_ERROR;
725:
726: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
727: -- bug2814492
728: x_result := FND_API.G_FALSE;
729: po_message_s.sql_error(l_api_name, l_progress || '-3', sqlcode);
730: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
731:
732: WHEN OTHERS THEN
726: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
727: -- bug2814492
728: x_result := FND_API.G_FALSE;
729: po_message_s.sql_error(l_api_name, l_progress || '-3', sqlcode);
730: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
731:
732: WHEN OTHERS THEN
733: -- bug2814492
734: x_result := FND_API.G_FALSE;
730: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
731:
732: WHEN OTHERS THEN
733: -- bug2814492
734: x_result := FND_API.G_FALSE;
735: po_message_s.sql_error(l_api_name, l_progress || '-4', sqlcode);
736: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
737:
738: END validate_merge;
732: WHEN OTHERS THEN
733: -- bug2814492
734: x_result := FND_API.G_FALSE;
735: po_message_s.sql_error(l_api_name, l_progress || '-4', sqlcode);
736: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
737:
738: END validate_merge;
739:
740: /**==========================================================================
752: * Updates the Global Agreements' Org Assignment table - replaces every
753: * instance of the old Supplier/SiteName with the new vendor_site_id.
754: *
755: * RETURNS:
756: * x_return_status - (a) FND_API.G_RET_STS_SUCCESS if validation successful
757: * (b) FND_API.G_RET_STS_ERROR if error during validation
758: * (c) FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
759: *
760: *===========================================================================
753: * instance of the old Supplier/SiteName with the new vendor_site_id.
754: *
755: * RETURNS:
756: * x_return_status - (a) FND_API.G_RET_STS_SUCCESS if validation successful
757: * (b) FND_API.G_RET_STS_ERROR if error during validation
758: * (c) FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
759: *
760: *===========================================================================
761: */
754: *
755: * RETURNS:
756: * x_return_status - (a) FND_API.G_RET_STS_SUCCESS if validation successful
757: * (b) FND_API.G_RET_STS_ERROR if error during validation
758: * (c) FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
759: *
760: *===========================================================================
761: */
762: PROCEDURE update_org_assignments
783: ( p_log_head => l_module
784: );
785: END IF;
786:
787: x_return_status := FND_API.G_RET_STS_SUCCESS; -- Initialize return status
788: l_progress := '000';
789:
790: IF ( NOT FND_API.compatible_api_call(l_api_version,p_api_version,l_api_name,G_PKG_NAME) ) THEN
791: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
786:
787: x_return_status := FND_API.G_RET_STS_SUCCESS; -- Initialize return status
788: l_progress := '000';
789:
790: IF ( NOT FND_API.compatible_api_call(l_api_version,p_api_version,l_api_name,G_PKG_NAME) ) THEN
791: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
792: END IF;
793:
794: l_progress := '010';
787: x_return_status := FND_API.G_RET_STS_SUCCESS; -- Initialize return status
788: l_progress := '000';
789:
790: IF ( NOT FND_API.compatible_api_call(l_api_version,p_api_version,l_api_name,G_PKG_NAME) ) THEN
791: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
792: END IF;
793:
794: l_progress := '010';
795:
875:
876: EXCEPTION
877:
878: WHEN PO_INVALID_VENDOR_SITE_ID THEN
879: x_return_status := FND_API.G_RET_STS_ERROR;
880:
881: WHEN FND_API.G_EXC_ERROR THEN
882: x_return_status := FND_API.G_RET_STS_ERROR;
883:
877:
878: WHEN PO_INVALID_VENDOR_SITE_ID THEN
879: x_return_status := FND_API.G_RET_STS_ERROR;
880:
881: WHEN FND_API.G_EXC_ERROR THEN
882: x_return_status := FND_API.G_RET_STS_ERROR;
883:
884: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
885: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
878: WHEN PO_INVALID_VENDOR_SITE_ID THEN
879: x_return_status := FND_API.G_RET_STS_ERROR;
880:
881: WHEN FND_API.G_EXC_ERROR THEN
882: x_return_status := FND_API.G_RET_STS_ERROR;
883:
884: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
885: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
886:
880:
881: WHEN FND_API.G_EXC_ERROR THEN
882: x_return_status := FND_API.G_RET_STS_ERROR;
883:
884: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
885: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
886:
887: WHEN OTHERS THEN
888: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
881: WHEN FND_API.G_EXC_ERROR THEN
882: x_return_status := FND_API.G_RET_STS_ERROR;
883:
884: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
885: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
886:
887: WHEN OTHERS THEN
888: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
889:
884: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
885: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
886:
887: WHEN OTHERS THEN
888: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
889:
890: END update_org_assignments;
891:
892:
1263: l_progress := '010';
1264:
1265: WSH_PO_INTEGRATION_GRP.vendor_merge
1266: ( p_api_version_number => 1.0,
1267: p_init_msg_list => FND_API.G_TRUE,
1268: p_commit => FND_API.G_FALSE,
1269: p_in_rec => l_fte_in_rec,
1270: x_out_rec => l_fte_out_rec,
1271: x_return_status => l_return_status,
1264:
1265: WSH_PO_INTEGRATION_GRP.vendor_merge
1266: ( p_api_version_number => 1.0,
1267: p_init_msg_list => FND_API.G_TRUE,
1268: p_commit => FND_API.G_FALSE,
1269: p_in_rec => l_fte_in_rec,
1270: x_out_rec => l_fte_out_rec,
1271: x_return_status => l_return_status,
1272: x_msg_count => l_msg_count,
1283: p_message => 'Called WSH Merge API. status = ' || l_return_status
1284: );
1285: END IF;
1286:
1287: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1288: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1289: END IF;
1290:
1291: l_progress := '030';
1284: );
1285: END IF;
1286:
1287: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1288: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1289: END IF;
1290:
1291: l_progress := '030';
1292:
1377: END IF;
1378:
1379: l_progress := '000';
1380:
1381: IF (PO_CONTERMS_UTL_GRP.is_contracts_enabled = FND_API.G_TRUE) THEN
1382:
1383: OKC_MANAGE_DELIVERABLES_GRP.updateExtPartyOnDeliverables
1384: ( p_api_version => 1.0,
1385: p_init_msg_list => FND_API.G_TRUE,
1381: IF (PO_CONTERMS_UTL_GRP.is_contracts_enabled = FND_API.G_TRUE) THEN
1382:
1383: OKC_MANAGE_DELIVERABLES_GRP.updateExtPartyOnDeliverables
1384: ( p_api_version => 1.0,
1385: p_init_msg_list => FND_API.G_TRUE,
1386: p_commit => FND_API.G_FALSE,
1387: p_document_class => 'PO',
1388: p_from_external_party_id => p_from_vendor_id,
1389: p_from_external_party_site_id => p_from_site_id,
1382:
1383: OKC_MANAGE_DELIVERABLES_GRP.updateExtPartyOnDeliverables
1384: ( p_api_version => 1.0,
1385: p_init_msg_list => FND_API.G_TRUE,
1386: p_commit => FND_API.G_FALSE,
1387: p_document_class => 'PO',
1388: p_from_external_party_id => p_from_vendor_id,
1389: p_from_external_party_site_id => p_from_site_id,
1390: p_to_external_party_id => p_to_vendor_id,
1406: p_message => 'Called OKC Merge API. status = ' || l_return_status
1407: );
1408: END IF;
1409:
1410: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1411: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1412: END IF;
1413:
1414: IF (g_debug_stmt) THEN
1407: );
1408: END IF;
1409:
1410: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1411: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1412: END IF;
1413:
1414: IF (g_debug_stmt) THEN
1415: PO_DEBUG.debug_end