777: l_exists NUMBER(1);
778: l_not_upd NUMBER;
779:
780: BEGIN
781: x_return_status := OKL_API.G_RET_STS_SUCCESS;
782:
783: l_exists := OKL_LEGAL_ENTITY_UTIL.check_le_id_exists(p_chrv_rec.legal_entity_id) ;
784:
785: IF (l_exists<>1) THEN
783: l_exists := OKL_LEGAL_ENTITY_UTIL.check_le_id_exists(p_chrv_rec.legal_entity_id) ;
784:
785: IF (l_exists<>1) THEN
786: Okc_Api.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'LEGAL_ENTITY_ID');
787: RAISE OKL_API.G_EXCEPTION_ERROR;
788: END IF;
789:
790: IF p_mode = 'UPD'
791: THEN
792: OPEN check_upd_le_fund_csr(p_chrv_rec.id);
793: FETCH check_upd_le_fund_csr INTO l_not_upd;
794: CLOSE check_upd_le_fund_csr;
795: IF l_not_upd = 1 THEN
796: OKL_API.SET_MESSAGE(p_app_name => g_app_name,
797: p_msg_name => 'OKL_LA_LE_UPD_FUND');
798: RAISE OKL_API.G_EXCEPTION_ERROR;
799: END IF;
800: OPEN check_upd_le_adv_rcpt_csr(p_chrv_rec.id);
794: CLOSE check_upd_le_fund_csr;
795: IF l_not_upd = 1 THEN
796: OKL_API.SET_MESSAGE(p_app_name => g_app_name,
797: p_msg_name => 'OKL_LA_LE_UPD_FUND');
798: RAISE OKL_API.G_EXCEPTION_ERROR;
799: END IF;
800: OPEN check_upd_le_adv_rcpt_csr(p_chrv_rec.id);
801: FETCH check_upd_le_adv_rcpt_csr INTO l_not_upd;
802: CLOSE check_upd_le_adv_rcpt_csr;
800: OPEN check_upd_le_adv_rcpt_csr(p_chrv_rec.id);
801: FETCH check_upd_le_adv_rcpt_csr INTO l_not_upd;
802: CLOSE check_upd_le_adv_rcpt_csr;
803: IF l_not_upd = 1 THEN
804: OKL_API.SET_MESSAGE(p_app_name => g_app_name,
805: p_msg_name => 'OKL_LA_LE_UPD_ADV_RCPT');
806: RAISE OKL_API.G_EXCEPTION_ERROR;
807: END IF;
808: OPEN check_upd_le_ins_qte_csr(p_chrv_rec.id);
802: CLOSE check_upd_le_adv_rcpt_csr;
803: IF l_not_upd = 1 THEN
804: OKL_API.SET_MESSAGE(p_app_name => g_app_name,
805: p_msg_name => 'OKL_LA_LE_UPD_ADV_RCPT');
806: RAISE OKL_API.G_EXCEPTION_ERROR;
807: END IF;
808: OPEN check_upd_le_ins_qte_csr(p_chrv_rec.id);
809: FETCH check_upd_le_ins_qte_csr INTO l_not_upd;
810: CLOSE check_upd_le_ins_qte_csr;
808: OPEN check_upd_le_ins_qte_csr(p_chrv_rec.id);
809: FETCH check_upd_le_ins_qte_csr INTO l_not_upd;
810: CLOSE check_upd_le_ins_qte_csr;
811: IF l_not_upd = 1 THEN
812: OKL_API.SET_MESSAGE(p_app_name => g_app_name,
813: p_msg_name => 'OKL_LA_LE_UPD_INS_QT');
814: RAISE OKL_API.G_EXCEPTION_ERROR;
815: END IF;
816: END IF;
810: CLOSE check_upd_le_ins_qte_csr;
811: IF l_not_upd = 1 THEN
812: OKL_API.SET_MESSAGE(p_app_name => g_app_name,
813: p_msg_name => 'OKL_LA_LE_UPD_INS_QT');
814: RAISE OKL_API.G_EXCEPTION_ERROR;
815: END IF;
816: END IF;
817:
818: EXCEPTION
815: END IF;
816: END IF;
817:
818: EXCEPTION
819: WHEN OKL_API.G_EXCEPTION_ERROR then
820: x_return_status := OKL_API.G_RET_STS_ERROR;
821:
822: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR then
823: x_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
816: END IF;
817:
818: EXCEPTION
819: WHEN OKL_API.G_EXCEPTION_ERROR then
820: x_return_status := OKL_API.G_RET_STS_ERROR;
821:
822: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR then
823: x_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
824:
818: EXCEPTION
819: WHEN OKL_API.G_EXCEPTION_ERROR then
820: x_return_status := OKL_API.G_RET_STS_ERROR;
821:
822: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR then
823: x_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
824:
825: WHEN OTHERS then
826: x_return_status := OKL_API.G_RET_STS_ERROR;
819: WHEN OKL_API.G_EXCEPTION_ERROR then
820: x_return_status := OKL_API.G_RET_STS_ERROR;
821:
822: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR then
823: x_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
824:
825: WHEN OTHERS then
826: x_return_status := OKL_API.G_RET_STS_ERROR;
827: END Validate_Legal_Entity;
822: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR then
823: x_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
824:
825: WHEN OTHERS then
826: x_return_status := OKL_API.G_RET_STS_ERROR;
827: END Validate_Legal_Entity;
828:
829: --Start of Comments
830: