793: l_exists NUMBER(1);
794: l_not_upd NUMBER;
795:
796: BEGIN
797: x_return_status := OKL_API.G_RET_STS_SUCCESS;
798:
799: l_exists := OKL_LEGAL_ENTITY_UTIL.check_le_id_exists(p_chrv_rec.legal_entity_id) ;
800:
801: IF (l_exists<>1) THEN
799: l_exists := OKL_LEGAL_ENTITY_UTIL.check_le_id_exists(p_chrv_rec.legal_entity_id) ;
800:
801: IF (l_exists<>1) THEN
802: Okc_Api.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'LEGAL_ENTITY_ID');
803: RAISE OKL_API.G_EXCEPTION_ERROR;
804: END IF;
805:
806: IF p_mode = 'UPD'
807: THEN
808: OPEN check_upd_le_fund_csr(p_chrv_rec.id);
809: FETCH check_upd_le_fund_csr INTO l_not_upd;
810: CLOSE check_upd_le_fund_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_FUND');
814: RAISE OKL_API.G_EXCEPTION_ERROR;
815: END IF;
816: OPEN check_upd_le_adv_rcpt_csr(p_chrv_rec.id);
810: CLOSE check_upd_le_fund_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_FUND');
814: RAISE OKL_API.G_EXCEPTION_ERROR;
815: END IF;
816: OPEN check_upd_le_adv_rcpt_csr(p_chrv_rec.id);
817: FETCH check_upd_le_adv_rcpt_csr INTO l_not_upd;
818: CLOSE check_upd_le_adv_rcpt_csr;
816: OPEN check_upd_le_adv_rcpt_csr(p_chrv_rec.id);
817: FETCH check_upd_le_adv_rcpt_csr INTO l_not_upd;
818: CLOSE check_upd_le_adv_rcpt_csr;
819: IF l_not_upd = 1 THEN
820: OKL_API.SET_MESSAGE(p_app_name => g_app_name,
821: p_msg_name => 'OKL_LA_LE_UPD_ADV_RCPT');
822: RAISE OKL_API.G_EXCEPTION_ERROR;
823: END IF;
824: OPEN check_upd_le_ins_qte_csr(p_chrv_rec.id);
818: CLOSE check_upd_le_adv_rcpt_csr;
819: IF l_not_upd = 1 THEN
820: OKL_API.SET_MESSAGE(p_app_name => g_app_name,
821: p_msg_name => 'OKL_LA_LE_UPD_ADV_RCPT');
822: RAISE OKL_API.G_EXCEPTION_ERROR;
823: END IF;
824: OPEN check_upd_le_ins_qte_csr(p_chrv_rec.id);
825: FETCH check_upd_le_ins_qte_csr INTO l_not_upd;
826: CLOSE check_upd_le_ins_qte_csr;
824: OPEN check_upd_le_ins_qte_csr(p_chrv_rec.id);
825: FETCH check_upd_le_ins_qte_csr INTO l_not_upd;
826: CLOSE check_upd_le_ins_qte_csr;
827: IF l_not_upd = 1 THEN
828: OKL_API.SET_MESSAGE(p_app_name => g_app_name,
829: p_msg_name => 'OKL_LA_LE_UPD_INS_QT');
830: RAISE OKL_API.G_EXCEPTION_ERROR;
831: END IF;
832: END IF;
826: CLOSE check_upd_le_ins_qte_csr;
827: IF l_not_upd = 1 THEN
828: OKL_API.SET_MESSAGE(p_app_name => g_app_name,
829: p_msg_name => 'OKL_LA_LE_UPD_INS_QT');
830: RAISE OKL_API.G_EXCEPTION_ERROR;
831: END IF;
832: END IF;
833:
834: EXCEPTION
831: END IF;
832: END IF;
833:
834: EXCEPTION
835: WHEN OKL_API.G_EXCEPTION_ERROR then
836: x_return_status := OKL_API.G_RET_STS_ERROR;
837:
838: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR then
839: x_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
832: END IF;
833:
834: EXCEPTION
835: WHEN OKL_API.G_EXCEPTION_ERROR then
836: x_return_status := OKL_API.G_RET_STS_ERROR;
837:
838: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR then
839: x_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
840:
834: EXCEPTION
835: WHEN OKL_API.G_EXCEPTION_ERROR then
836: x_return_status := OKL_API.G_RET_STS_ERROR;
837:
838: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR then
839: x_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
840:
841: WHEN OTHERS then
842: x_return_status := OKL_API.G_RET_STS_ERROR;
835: WHEN OKL_API.G_EXCEPTION_ERROR then
836: x_return_status := OKL_API.G_RET_STS_ERROR;
837:
838: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR then
839: x_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
840:
841: WHEN OTHERS then
842: x_return_status := OKL_API.G_RET_STS_ERROR;
843: END Validate_Legal_Entity;
838: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR then
839: x_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
840:
841: WHEN OTHERS then
842: x_return_status := OKL_API.G_RET_STS_ERROR;
843: END Validate_Legal_Entity;
844:
845: --Start of Comments
846: