43: END;
44:
45: PROCEDURE create_party(
46: p_api_version IN NUMBER,
47: p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE,
48: x_return_status OUT NOCOPY VARCHAR2,
49: x_msg_count OUT NOCOPY NUMBER,
50: x_msg_data OUT NOCOPY VARCHAR2,
51: p_kpl_rec IN party_rec_type,
157:
158:
159: PROCEDURE create_from_template(
160: p_api_version IN NUMBER,
161: p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE,
162: x_return_status OUT NOCOPY VARCHAR2,
163: x_msg_count OUT NOCOPY NUMBER,
164: x_msg_data OUT NOCOPY VARCHAR2,
165: p_contract_number IN VARCHAR2,
203: x_msg_data => x_msg_data,
204: p_chr_id => p_source_chr_id,
205: p_contract_number => p_contract_number,
206: p_contract_number_modifier => null,
207: p_renew_ref_yn => OKC_API.G_FALSE,
208: p_trans_type => 'CFA',
209: x_chr_id => x_chr_id);
210: ELSE
211: OKL_COPY_CONTRACT_PUB.copy_lease_contract_new(
216: x_msg_data => x_msg_data,
217: p_chr_id => p_source_chr_id,
218: p_contract_number => p_contract_number,
219: p_contract_number_modifier => NULL,
220: p_renew_ref_yn => OKC_API.G_FALSE,
221: p_trans_type => 'CFA',
222: x_chr_id => x_chr_id);
223: END IF;
224:
257: -- Version : 1.0
258: -- End of comments
259: PROCEDURE create_from_contract(
260: p_api_version IN NUMBER,
261: p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE,
262: x_return_status OUT NOCOPY VARCHAR2,
263: x_msg_count OUT NOCOPY NUMBER,
264: x_msg_data OUT NOCOPY VARCHAR2,
265: p_contract_number IN VARCHAR2,
289: x_msg_data => x_msg_data,
290: p_chr_id => p_source_chr_id,
291: p_contract_number => p_contract_number,
292: p_contract_number_modifier => null,
293: p_renew_ref_yn => OKC_API.G_FALSE,
294: p_trans_type => 'CFA',
295: x_chr_id => x_chr_id);
296: ELSE
297: OKL_COPY_CONTRACT_PUB.copy_lease_contract_new(
302: x_msg_data => x_msg_data,
303: p_chr_id => p_source_chr_id,
304: p_contract_number => p_contract_number,
305: p_contract_number_modifier => NULL,
306: p_renew_ref_yn => OKC_API.G_FALSE,
307: p_trans_type => 'CFA',
308: x_chr_id => x_chr_id);
309: END IF;
310:
307: p_trans_type => 'CFA',
308: x_chr_id => x_chr_id);
309: END IF;
310:
311: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
312: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
313: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
314: RAISE OKC_API.G_EXCEPTION_ERROR;
315: END IF;
308: x_chr_id => x_chr_id);
309: END IF;
310:
311: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
312: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
313: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
314: RAISE OKC_API.G_EXCEPTION_ERROR;
315: END IF;
316:
309: END IF;
310:
311: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
312: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
313: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
314: RAISE OKC_API.G_EXCEPTION_ERROR;
315: END IF;
316:
317: END;
310:
311: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
312: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
313: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
314: RAISE OKC_API.G_EXCEPTION_ERROR;
315: END IF;
316:
317: END;
318:
318:
319:
320: PROCEDURE create_new_deal(
321: p_api_version IN NUMBER,
322: p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE,
323: x_return_status OUT NOCOPY VARCHAR2,
324: x_msg_count OUT NOCOPY NUMBER,
325: x_msg_data OUT NOCOPY VARCHAR2,
326: p_contract_number IN VARCHAR2,
403: AND cplv.chr_id = p_source_id; -- vendor program id
404:
405:
406: BEGIN
407: x_return_status := OKC_API.START_ACTIVITY(
408: p_api_name => l_api_name,
409: p_pkg_name => g_pkg_name,
410: p_init_msg_list => p_init_msg_list,
411: l_api_version => l_api_version,
413: p_api_type => g_api_type,
414: x_return_status => x_return_status);
415:
416: -- check if activity started successfully
417: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
418: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
419: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
420: RAISE OKC_API.G_EXCEPTION_ERROR;
421: END IF;
414: x_return_status => x_return_status);
415:
416: -- check if activity started successfully
417: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
418: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
419: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
420: RAISE OKC_API.G_EXCEPTION_ERROR;
421: END IF;
422:
415:
416: -- check if activity started successfully
417: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
418: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
419: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
420: RAISE OKC_API.G_EXCEPTION_ERROR;
421: END IF;
422:
423: lp_chrv_rec.sfwt_flag := 'N';
416: -- check if activity started successfully
417: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
418: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
419: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
420: RAISE OKC_API.G_EXCEPTION_ERROR;
421: END IF;
422:
423: lp_chrv_rec.sfwt_flag := 'N';
424: lp_chrv_rec.object_version_number := 1.0;
457: p_khrv_rec => lp_khrv_rec,
458: x_chrv_rec => lx_chrv_rec,
459: x_khrv_rec => lx_khrv_rec);
460:
461: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
462: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
463: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
464: RAISE OKC_API.G_EXCEPTION_ERROR;
465: END IF;
458: x_chrv_rec => lx_chrv_rec,
459: x_khrv_rec => lx_khrv_rec);
460:
461: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
462: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
463: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
464: RAISE OKC_API.G_EXCEPTION_ERROR;
465: END IF;
466:
459: x_khrv_rec => lx_khrv_rec);
460:
461: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
462: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
463: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
464: RAISE OKC_API.G_EXCEPTION_ERROR;
465: END IF;
466:
467: x_chr_id := lx_chrv_rec.id;
460:
461: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
462: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
463: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
464: RAISE OKC_API.G_EXCEPTION_ERROR;
465: END IF;
466:
467: x_chr_id := lx_chrv_rec.id;
468:
506: x_cplv_tbl => lx_cplv_tbl,
507: p_kplv_tbl => l_kplv_tbl,
508: x_kplv_tbl => lx_kplv_tbl);
509:
510: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
511: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
512: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
513: RAISE OKC_API.G_EXCEPTION_ERROR;
514: END IF;
507: p_kplv_tbl => l_kplv_tbl,
508: x_kplv_tbl => lx_kplv_tbl);
509:
510: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
511: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
512: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
513: RAISE OKC_API.G_EXCEPTION_ERROR;
514: END IF;
515:
508: x_kplv_tbl => lx_kplv_tbl);
509:
510: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
511: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
512: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
513: RAISE OKC_API.G_EXCEPTION_ERROR;
514: END IF;
515:
516: END IF;
509:
510: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
511: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
512: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
513: RAISE OKC_API.G_EXCEPTION_ERROR;
514: END IF;
515:
516: END IF;
517:
519: IF ( p_customer_name IS NOT NULL ) THEN
520:
521: -- now we attach the party to the header
522: lp_cplv_rec.object_version_number := 1.0;
523: lp_cplv_rec.sfwt_flag := OKC_API.G_FALSE;
524: lp_cplv_rec.dnz_chr_id := x_chr_id;
525: lp_cplv_rec.chr_id := x_chr_id;
526: lp_cplv_rec.cle_id := NULL;
527: lp_cplv_rec.object1_id1 := p_customer_id1;
532: OPEN check_party_csr(x_chr_id);
533: FETCH check_party_csr INTO row_count;
534: CLOSE check_party_csr;
535: IF row_count = 1 THEN
536: x_return_status := OKC_API.g_ret_sts_error;
537: OKC_API.SET_MESSAGE(p_app_name => g_app_name, p_msg_name => 'Party_already_exists');
538: RAISE OKC_API.G_EXCEPTION_ERROR;
539: END IF;
540:
533: FETCH check_party_csr INTO row_count;
534: CLOSE check_party_csr;
535: IF row_count = 1 THEN
536: x_return_status := OKC_API.g_ret_sts_error;
537: OKC_API.SET_MESSAGE(p_app_name => g_app_name, p_msg_name => 'Party_already_exists');
538: RAISE OKC_API.G_EXCEPTION_ERROR;
539: END IF;
540:
541:
534: CLOSE check_party_csr;
535: IF row_count = 1 THEN
536: x_return_status := OKC_API.g_ret_sts_error;
537: OKC_API.SET_MESSAGE(p_app_name => g_app_name, p_msg_name => 'Party_already_exists');
538: RAISE OKC_API.G_EXCEPTION_ERROR;
539: END IF;
540:
541:
542: OPEN role_csr(lp_cplv_rec.rle_code);
545:
546: IF (l_access_level = 'S') THEN
547:
548: okl_la_validation_util_pvt.VALIDATE_ROLE_JTOT (p_api_version => p_api_version,
549: p_init_msg_list => OKC_API.G_FALSE,
550: x_return_status => x_return_status,
551: x_msg_count => x_msg_count,
552: x_msg_data => x_msg_data,
553: p_object_name => lp_cplv_rec.jtot_object1_code,
552: x_msg_data => x_msg_data,
553: p_object_name => lp_cplv_rec.jtot_object1_code,
554: p_id1 => lp_cplv_rec.object1_id1,
555: p_id2 => lp_cplv_rec.object1_id2);
556: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
557: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
558: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
559: RAISE OKC_API.G_EXCEPTION_ERROR;
560: END IF;
553: p_object_name => lp_cplv_rec.jtot_object1_code,
554: p_id1 => lp_cplv_rec.object1_id1,
555: p_id2 => lp_cplv_rec.object1_id2);
556: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
557: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
558: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
559: RAISE OKC_API.G_EXCEPTION_ERROR;
560: END IF;
561:
554: p_id1 => lp_cplv_rec.object1_id1,
555: p_id2 => lp_cplv_rec.object1_id2);
556: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
557: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
558: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
559: RAISE OKC_API.G_EXCEPTION_ERROR;
560: END IF;
561:
562: END IF;
555: p_id2 => lp_cplv_rec.object1_id2);
556: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
557: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
558: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
559: RAISE OKC_API.G_EXCEPTION_ERROR;
560: END IF;
561:
562: END IF;
563:
571: x_cplv_rec => lx_cplv_rec,
572: p_kplv_rec => lp_kplv_rec,
573: x_kplv_rec => lx_kplv_rec);
574:
575: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
576: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
577: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
578: RAISE OKC_API.G_EXCEPTION_ERROR;
579: END IF;
572: p_kplv_rec => lp_kplv_rec,
573: x_kplv_rec => lx_kplv_rec);
574:
575: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
576: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
577: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
578: RAISE OKC_API.G_EXCEPTION_ERROR;
579: END IF;
580:
573: x_kplv_rec => lx_kplv_rec);
574:
575: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
576: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
577: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
578: RAISE OKC_API.G_EXCEPTION_ERROR;
579: END IF;
580:
581: END IF;
574:
575: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
576: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
577: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
578: RAISE OKC_API.G_EXCEPTION_ERROR;
579: END IF;
580:
581: END IF;
582:
580:
581: END IF;
582:
583:
584: OKC_API.END_ACTIVITY(x_msg_count => x_msg_count, x_msg_data => x_msg_data);
585:
586: EXCEPTION
587: WHEN OKC_API.G_EXCEPTION_ERROR THEN
588: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
583:
584: OKC_API.END_ACTIVITY(x_msg_count => x_msg_count, x_msg_data => x_msg_data);
585:
586: EXCEPTION
587: WHEN OKC_API.G_EXCEPTION_ERROR THEN
588: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
589: p_api_name => l_api_name,
590: p_pkg_name => g_pkg_name,
591: p_exc_name => 'OKC_API.G_RET_STS_ERROR',
584: OKC_API.END_ACTIVITY(x_msg_count => x_msg_count, x_msg_data => x_msg_data);
585:
586: EXCEPTION
587: WHEN OKC_API.G_EXCEPTION_ERROR THEN
588: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
589: p_api_name => l_api_name,
590: p_pkg_name => g_pkg_name,
591: p_exc_name => 'OKC_API.G_RET_STS_ERROR',
592: x_msg_count => x_msg_count,
587: WHEN OKC_API.G_EXCEPTION_ERROR THEN
588: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
589: p_api_name => l_api_name,
590: p_pkg_name => g_pkg_name,
591: p_exc_name => 'OKC_API.G_RET_STS_ERROR',
592: x_msg_count => x_msg_count,
593: x_msg_data => x_msg_data,
594: p_api_type => g_api_type);
595:
592: x_msg_count => x_msg_count,
593: x_msg_data => x_msg_data,
594: p_api_type => g_api_type);
595:
596: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
597: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
598: p_api_name => l_api_name,
599: p_pkg_name => g_pkg_name,
600: p_exc_name => 'OKC_API.G_RET_STS_UNEXP_ERROR',
593: x_msg_data => x_msg_data,
594: p_api_type => g_api_type);
595:
596: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
597: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
598: p_api_name => l_api_name,
599: p_pkg_name => g_pkg_name,
600: p_exc_name => 'OKC_API.G_RET_STS_UNEXP_ERROR',
601: x_msg_count => x_msg_count,
596: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
597: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
598: p_api_name => l_api_name,
599: p_pkg_name => g_pkg_name,
600: p_exc_name => 'OKC_API.G_RET_STS_UNEXP_ERROR',
601: x_msg_count => x_msg_count,
602: x_msg_data => x_msg_data,
603: p_api_type => g_api_type);
604:
602: x_msg_data => x_msg_data,
603: p_api_type => g_api_type);
604:
605: WHEN OTHERS THEN
606: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
607: p_api_name => l_api_name,
608: p_pkg_name => g_pkg_name,
609: p_exc_name => 'OTHERS',
610: x_msg_count => x_msg_count,
622: -- Version : 1.0
623: -- End of comments
624: PROCEDURE create_deal(
625: p_api_version IN NUMBER,
626: p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE,
627: x_return_status OUT NOCOPY VARCHAR2,
628: x_msg_count OUT NOCOPY NUMBER,
629: x_msg_data OUT NOCOPY VARCHAR2,
630: p_source_code IN VARCHAR2,
738: l_check VARCHAR2(1);
739: l_parameter_list wf_parameter_list_t;
740: BEGIN
741:
742: x_return_status := Okc_Api.G_RET_STS_SUCCESS;
743: IF (p_source_code = 'new') THEN
744: wf_event.AddParameterToList(G_WF_ITM_CONTRACT_ID,p_chr_id,l_parameter_list);
745:
746: OKL_WF_PVT.raise_event (p_api_version => p_api_version,
765: OKC_CONTEXT.SET_OKC_ORG_CONTEXT(
766: p_org_id => p_org_id,
767: p_organization_id => p_organization_id);
768:
769: x_return_status := OKC_API.START_ACTIVITY(
770: p_api_name => l_api_name,
771: p_pkg_name => g_pkg_name,
772: p_init_msg_list => p_init_msg_list,
773: l_api_version => l_api_version,
775: p_api_type => g_api_type,
776: x_return_status => x_return_status);
777:
778: -- check if activity started successfully
779: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
780: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
781: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
782: RAISE OKC_API.G_EXCEPTION_ERROR;
783: END IF;
776: x_return_status => x_return_status);
777:
778: -- check if activity started successfully
779: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
780: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
781: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
782: RAISE OKC_API.G_EXCEPTION_ERROR;
783: END IF;
784:
777:
778: -- check if activity started successfully
779: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
780: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
781: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
782: RAISE OKC_API.G_EXCEPTION_ERROR;
783: END IF;
784:
785: IF(p_customer_name IS NULL) THEN
778: -- check if activity started successfully
779: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
780: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
781: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
782: RAISE OKC_API.G_EXCEPTION_ERROR;
783: END IF;
784:
785: IF(p_customer_name IS NULL) THEN
786: IF p_scs_code = 'MASTER_LEASE' THEN
783: END IF;
784:
785: IF(p_customer_name IS NULL) THEN
786: IF p_scs_code = 'MASTER_LEASE' THEN
787: x_return_status := OKC_API.g_ret_sts_error;
788: l_ak_prompt := GET_AK_PROMPT('OKL_LA_DEAL_CREAT', 'OKL_CUSTOMER_NAME');
789: OKC_API.SET_MESSAGE( p_app_name => g_app_name
790: , p_msg_name => 'OKL_REQUIRED_VALUE'
791: , p_token1 => 'COL_NAME'
785: IF(p_customer_name IS NULL) THEN
786: IF p_scs_code = 'MASTER_LEASE' THEN
787: x_return_status := OKC_API.g_ret_sts_error;
788: l_ak_prompt := GET_AK_PROMPT('OKL_LA_DEAL_CREAT', 'OKL_CUSTOMER_NAME');
789: OKC_API.SET_MESSAGE( p_app_name => g_app_name
790: , p_msg_name => 'OKL_REQUIRED_VALUE'
791: , p_token1 => 'COL_NAME'
792: , p_token1_value => l_ak_prompt
793: );
790: , p_msg_name => 'OKL_REQUIRED_VALUE'
791: , p_token1 => 'COL_NAME'
792: , p_token1_value => l_ak_prompt
793: );
794: RAISE OKC_API.G_EXCEPTION_ERROR;
795: END IF;
796: END IF;
797:
798: IF(p_program_name IS NOT NULL AND p_scs_code <> 'MASTER_LEASE' ) THEN
802: close l_program_csr;
803:
804: IF( l_program_id IS NULL ) THEN
805:
806: x_return_status := OKC_API.g_ret_sts_error;
807: l_ak_prompt := GET_AK_PROMPT('OKL_LA_DEAL_CREAT', 'OKL_PROGRAM');
808: OKC_API.SET_MESSAGE( p_app_name => g_app_name
809: , p_msg_name => 'OKL_LLA_INVALID_LOV_VALUE'
810: , p_token1 => 'COL_NAME'
804: IF( l_program_id IS NULL ) THEN
805:
806: x_return_status := OKC_API.g_ret_sts_error;
807: l_ak_prompt := GET_AK_PROMPT('OKL_LA_DEAL_CREAT', 'OKL_PROGRAM');
808: OKC_API.SET_MESSAGE( p_app_name => g_app_name
809: , p_msg_name => 'OKL_LLA_INVALID_LOV_VALUE'
810: , p_token1 => 'COL_NAME'
811: , p_token1_value => l_ak_prompt
812: );
809: , p_msg_name => 'OKL_LLA_INVALID_LOV_VALUE'
810: , p_token1 => 'COL_NAME'
811: , p_token1_value => l_ak_prompt
812: );
813: RAISE OKC_API.G_EXCEPTION_ERROR;
814:
815: END IF;
816: END IF;
817:
815: END IF;
816: END IF;
817:
818: IF(p_source_code <> 'new' AND p_source_contract_number IS NULL) THEN
819: x_return_status := OKC_API.g_ret_sts_error;
820: l_ak_prompt := GET_AK_PROMPT('OKL_LA_DEAL_CREAT', 'OKL_CONTRACT_SOURCE');
821: OKC_API.SET_MESSAGE( p_app_name => g_app_name
822: , p_msg_name => 'OKL_REQUIRED_VALUE'
823: , p_token1 => 'COL_NAME'
817:
818: IF(p_source_code <> 'new' AND p_source_contract_number IS NULL) THEN
819: x_return_status := OKC_API.g_ret_sts_error;
820: l_ak_prompt := GET_AK_PROMPT('OKL_LA_DEAL_CREAT', 'OKL_CONTRACT_SOURCE');
821: OKC_API.SET_MESSAGE( p_app_name => g_app_name
822: , p_msg_name => 'OKL_REQUIRED_VALUE'
823: , p_token1 => 'COL_NAME'
824: , p_token1_value => l_ak_prompt
825: );
822: , p_msg_name => 'OKL_REQUIRED_VALUE'
823: , p_token1 => 'COL_NAME'
824: , p_token1_value => l_ak_prompt
825: );
826: RAISE OKC_API.G_EXCEPTION_ERROR;
827: END IF;
828:
829: IF(p_customer_name IS NOT NULL) THEN
830:
844: p_ak_region => 'OKL_LA_DEAL_CREAT',
845: p_ak_attribute => 'OKL_CUSTOMER_NAME'
846: );
847:
848: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
849: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
850: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
851: RAISE OKC_API.G_EXCEPTION_ERROR;
852: END IF;
845: p_ak_attribute => 'OKL_CUSTOMER_NAME'
846: );
847:
848: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
849: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
850: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
851: RAISE OKC_API.G_EXCEPTION_ERROR;
852: END IF;
853:
846: );
847:
848: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
849: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
850: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
851: RAISE OKC_API.G_EXCEPTION_ERROR;
852: END IF;
853:
854: END IF;
847:
848: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
849: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
850: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
851: RAISE OKC_API.G_EXCEPTION_ERROR;
852: END IF;
853:
854: END IF;
855:
905:
906: END IF;
907:
908: IF(p_source_chr_id IS NULL) THEN
909: x_return_status := OKC_API.g_ret_sts_error;
910: l_ak_prompt := GET_AK_PROMPT('OKL_LA_DEAL_CREAT', 'OKL_CONTRACT_SOURCE');
911: OKC_API.SET_MESSAGE( p_app_name => g_app_name
912: , p_msg_name => 'OKL_LLA_INVALID_LOV_VALUE'
913: , p_token1 => 'COL_NAME'
907:
908: IF(p_source_chr_id IS NULL) THEN
909: x_return_status := OKC_API.g_ret_sts_error;
910: l_ak_prompt := GET_AK_PROMPT('OKL_LA_DEAL_CREAT', 'OKL_CONTRACT_SOURCE');
911: OKC_API.SET_MESSAGE( p_app_name => g_app_name
912: , p_msg_name => 'OKL_LLA_INVALID_LOV_VALUE'
913: , p_token1 => 'COL_NAME'
914: , p_token1_value => l_ak_prompt
915: );
912: , p_msg_name => 'OKL_LLA_INVALID_LOV_VALUE'
913: , p_token1 => 'COL_NAME'
914: , p_token1_value => l_ak_prompt
915: );
916: RAISE OKC_API.G_EXCEPTION_ERROR;
917: END IF;
918:
919: END IF;
920:
939: p_program_id => p_program_id,
940: x_chr_id => x_chr_id,
941: p_legal_entity_id => p_legal_entity_id);
942:
943: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
944: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
945: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
946: RAISE OKC_API.G_EXCEPTION_ERROR;
947: END IF;
940: x_chr_id => x_chr_id,
941: p_legal_entity_id => p_legal_entity_id);
942:
943: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
944: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
945: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
946: RAISE OKC_API.G_EXCEPTION_ERROR;
947: END IF;
948:
941: p_legal_entity_id => p_legal_entity_id);
942:
943: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
944: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
945: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
946: RAISE OKC_API.G_EXCEPTION_ERROR;
947: END IF;
948:
949: l_chr_id := x_chr_id;
942:
943: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
944: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
945: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
946: RAISE OKC_API.G_EXCEPTION_ERROR;
947: END IF;
948:
949: l_chr_id := x_chr_id;
950:
962: x_msg_count => x_msg_count,
963: x_msg_data => x_msg_data,
964: p_chr_id => l_chr_id);
965:
966: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
967: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
968: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
969: RAISE OKC_API.G_EXCEPTION_ERROR;
970: END IF;
963: x_msg_data => x_msg_data,
964: p_chr_id => l_chr_id);
965:
966: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
967: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
968: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
969: RAISE OKC_API.G_EXCEPTION_ERROR;
970: END IF;
971:
964: p_chr_id => l_chr_id);
965:
966: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
967: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
968: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
969: RAISE OKC_API.G_EXCEPTION_ERROR;
970: END IF;
971:
972: END IF;
965:
966: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
967: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
968: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
969: RAISE OKC_API.G_EXCEPTION_ERROR;
970: END IF;
971:
972: END IF;
973:
997: x_chr_id => x_chr_id);
998:
999: END IF;
1000:
1001: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1002: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1003: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1004: RAISE OKC_API.G_EXCEPTION_ERROR;
1005: END IF;
998:
999: END IF;
1000:
1001: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1002: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1003: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1004: RAISE OKC_API.G_EXCEPTION_ERROR;
1005: END IF;
1006:
999: END IF;
1000:
1001: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1002: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1003: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1004: RAISE OKC_API.G_EXCEPTION_ERROR;
1005: END IF;
1006:
1007: -- update contract header for template_yn
1000:
1001: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1002: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1003: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1004: RAISE OKC_API.G_EXCEPTION_ERROR;
1005: END IF;
1006:
1007: -- update contract header for template_yn
1008: IF ( p_template_type IS NOT NULL AND ( p_source_code = 'copy' OR p_source_code = 'template')) THEN
1045: p_khrv_rec => lp_khrv_rec,
1046: x_chrv_rec => lx_chrv_rec,
1047: x_khrv_rec => lx_khrv_rec);
1048:
1049: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1050: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1051: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1052: RAISE OKC_API.G_EXCEPTION_ERROR;
1053: END IF;
1046: x_chrv_rec => lx_chrv_rec,
1047: x_khrv_rec => lx_khrv_rec);
1048:
1049: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1050: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1051: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1052: RAISE OKC_API.G_EXCEPTION_ERROR;
1053: END IF;
1054:
1047: x_khrv_rec => lx_khrv_rec);
1048:
1049: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1050: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1051: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1052: RAISE OKC_API.G_EXCEPTION_ERROR;
1053: END IF;
1054:
1055: ELSIF ( p_template_type IS NULL AND ( p_source_code = 'copy' OR p_source_code = 'template')) THEN
1048:
1049: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1050: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1051: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1052: RAISE OKC_API.G_EXCEPTION_ERROR;
1053: END IF;
1054:
1055: ELSIF ( p_template_type IS NULL AND ( p_source_code = 'copy' OR p_source_code = 'template')) THEN
1056:
1081: p_khrv_rec => lp_khrv_rec,
1082: x_chrv_rec => lx_chrv_rec,
1083: x_khrv_rec => lx_khrv_rec);
1084:
1085: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1086: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1087: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1088: RAISE OKC_API.G_EXCEPTION_ERROR;
1089: END IF;
1082: x_chrv_rec => lx_chrv_rec,
1083: x_khrv_rec => lx_khrv_rec);
1084:
1085: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1086: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1087: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1088: RAISE OKC_API.G_EXCEPTION_ERROR;
1089: END IF;
1090:
1083: x_khrv_rec => lx_khrv_rec);
1084:
1085: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1086: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1087: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1088: RAISE OKC_API.G_EXCEPTION_ERROR;
1089: END IF;
1090:
1091: END IF;
1084:
1085: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1086: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1087: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1088: RAISE OKC_API.G_EXCEPTION_ERROR;
1089: END IF;
1090:
1091: END IF;
1092:
1097: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
1098: RAISE OKL_API.G_EXCEPTION_ERROR;
1099: END IF;
1100:
1101: OKC_API.END_ACTIVITY(x_msg_count => x_msg_count,
1102: x_msg_data => x_msg_data);
1103: EXCEPTION
1104: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1105: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1100:
1101: OKC_API.END_ACTIVITY(x_msg_count => x_msg_count,
1102: x_msg_data => x_msg_data);
1103: EXCEPTION
1104: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1105: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1106: p_api_name => l_api_name,
1107: p_pkg_name => g_pkg_name,
1108: p_exc_name => 'OKC_API.G_RET_STS_ERROR',
1101: OKC_API.END_ACTIVITY(x_msg_count => x_msg_count,
1102: x_msg_data => x_msg_data);
1103: EXCEPTION
1104: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1105: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1106: p_api_name => l_api_name,
1107: p_pkg_name => g_pkg_name,
1108: p_exc_name => 'OKC_API.G_RET_STS_ERROR',
1109: x_msg_count => x_msg_count,
1104: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1105: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1106: p_api_name => l_api_name,
1107: p_pkg_name => g_pkg_name,
1108: p_exc_name => 'OKC_API.G_RET_STS_ERROR',
1109: x_msg_count => x_msg_count,
1110: x_msg_data => x_msg_data,
1111: p_api_type => g_api_type);
1112:
1109: x_msg_count => x_msg_count,
1110: x_msg_data => x_msg_data,
1111: p_api_type => g_api_type);
1112:
1113: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1114: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1115: p_api_name => l_api_name,
1116: p_pkg_name => g_pkg_name,
1117: p_exc_name => 'OKC_API.G_RET_STS_UNEXP_ERROR',
1110: x_msg_data => x_msg_data,
1111: p_api_type => g_api_type);
1112:
1113: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1114: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1115: p_api_name => l_api_name,
1116: p_pkg_name => g_pkg_name,
1117: p_exc_name => 'OKC_API.G_RET_STS_UNEXP_ERROR',
1118: x_msg_count => x_msg_count,
1113: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1114: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1115: p_api_name => l_api_name,
1116: p_pkg_name => g_pkg_name,
1117: p_exc_name => 'OKC_API.G_RET_STS_UNEXP_ERROR',
1118: x_msg_count => x_msg_count,
1119: x_msg_data => x_msg_data,
1120: p_api_type => g_api_type);
1121:
1119: x_msg_data => x_msg_data,
1120: p_api_type => g_api_type);
1121:
1122: WHEN OTHERS THEN
1123: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1124: p_api_name => l_api_name,
1125: p_pkg_name => g_pkg_name,
1126: p_exc_name => 'OTHERS',
1127: x_msg_count => x_msg_count,
1131:
1132:
1133: PROCEDURE update_deal(
1134: p_api_version IN NUMBER,
1135: p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE,
1136: x_return_status OUT NOCOPY VARCHAR2,
1137: x_msg_count OUT NOCOPY NUMBER,
1138: x_msg_data OUT NOCOPY VARCHAR2,
1139: p_durv_rec IN upd_deal_rec_type,
1158: IS
1159: l_check VARCHAR2(1);
1160: l_parameter_list wf_parameter_list_t;
1161: BEGIN
1162: x_return_status := Okc_Api.G_RET_STS_SUCCESS;
1163: -- Raise the event if it is a new Contract
1164: l_check := Okl_Lla_Util_Pvt.check_new_contract(p_chr_id);
1165: IF (l_check= OKL_API.G_TRUE) THEN
1166: wf_event.AddParameterToList(G_WF_ITM_CONTRACT_ID,p_chr_id,l_parameter_list);
1186: l_chr_id := p_durv_rec.chr_id;
1187: okl_context.set_okc_org_context(p_chr_id => l_chr_id );
1188: END IF;
1189:
1190: x_return_status := OKC_API.START_ACTIVITY(
1191: p_api_name => l_api_name,
1192: p_pkg_name => g_pkg_name,
1193: p_init_msg_list => p_init_msg_list,
1194: l_api_version => l_api_version,
1196: p_api_type => g_api_type,
1197: x_return_status => x_return_status);
1198:
1199: -- check if activity started successfully
1200: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1201: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1202: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1203: RAISE OKC_API.G_EXCEPTION_ERROR;
1204: END IF;
1197: x_return_status => x_return_status);
1198:
1199: -- check if activity started successfully
1200: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1201: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1202: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1203: RAISE OKC_API.G_EXCEPTION_ERROR;
1204: END IF;
1205:
1198:
1199: -- check if activity started successfully
1200: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1201: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1202: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1203: RAISE OKC_API.G_EXCEPTION_ERROR;
1204: END IF;
1205:
1206: lp_chrv_rec.id := p_durv_rec.chr_id;
1199: -- check if activity started successfully
1200: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1201: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1202: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1203: RAISE OKC_API.G_EXCEPTION_ERROR;
1204: END IF;
1205:
1206: lp_chrv_rec.id := p_durv_rec.chr_id;
1207: lp_khrv_rec.id := p_durv_rec.chr_id;
1226: p_chrv_rec => lp_chrv_rec,
1227: p_khrv_rec => lp_khrv_rec,
1228: x_chrv_rec => lx_chrv_rec,
1229: x_khrv_rec => lx_khrv_rec);
1230: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1231: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1232: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1233: RAISE OKC_API.G_EXCEPTION_ERROR;
1234: END IF;
1227: p_khrv_rec => lp_khrv_rec,
1228: x_chrv_rec => lx_chrv_rec,
1229: x_khrv_rec => lx_khrv_rec);
1230: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1231: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1232: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1233: RAISE OKC_API.G_EXCEPTION_ERROR;
1234: END IF;
1235: raise_business_event(p_chr_id => p_durv_rec.chr_id
1228: x_chrv_rec => lx_chrv_rec,
1229: x_khrv_rec => lx_khrv_rec);
1230: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1231: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1232: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1233: RAISE OKC_API.G_EXCEPTION_ERROR;
1234: END IF;
1235: raise_business_event(p_chr_id => p_durv_rec.chr_id
1236: ,x_return_status => x_return_status);
1229: x_khrv_rec => lx_khrv_rec);
1230: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1231: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1232: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1233: RAISE OKC_API.G_EXCEPTION_ERROR;
1234: END IF;
1235: raise_business_event(p_chr_id => p_durv_rec.chr_id
1236: ,x_return_status => x_return_status);
1237: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
1238: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1239: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
1240: RAISE OKL_API.G_EXCEPTION_ERROR;
1241: END IF;
1242: OKC_API.END_ACTIVITY(x_msg_count => x_msg_count, x_msg_data => x_msg_data);
1243:
1244: EXCEPTION
1245: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1246: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1241: END IF;
1242: OKC_API.END_ACTIVITY(x_msg_count => x_msg_count, x_msg_data => x_msg_data);
1243:
1244: EXCEPTION
1245: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1246: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1247: p_api_name => l_api_name,
1248: p_pkg_name => g_pkg_name,
1249: p_exc_name => 'OKC_API.G_RET_STS_ERROR',
1242: OKC_API.END_ACTIVITY(x_msg_count => x_msg_count, x_msg_data => x_msg_data);
1243:
1244: EXCEPTION
1245: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1246: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1247: p_api_name => l_api_name,
1248: p_pkg_name => g_pkg_name,
1249: p_exc_name => 'OKC_API.G_RET_STS_ERROR',
1250: x_msg_count => x_msg_count,
1245: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1246: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1247: p_api_name => l_api_name,
1248: p_pkg_name => g_pkg_name,
1249: p_exc_name => 'OKC_API.G_RET_STS_ERROR',
1250: x_msg_count => x_msg_count,
1251: x_msg_data => x_msg_data,
1252: p_api_type => g_api_type);
1253:
1250: x_msg_count => x_msg_count,
1251: x_msg_data => x_msg_data,
1252: p_api_type => g_api_type);
1253:
1254: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1255: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1256: p_api_name => l_api_name,
1257: p_pkg_name => g_pkg_name,
1258: p_exc_name => 'OKC_API.G_RET_STS_UNEXP_ERROR',
1251: x_msg_data => x_msg_data,
1252: p_api_type => g_api_type);
1253:
1254: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1255: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1256: p_api_name => l_api_name,
1257: p_pkg_name => g_pkg_name,
1258: p_exc_name => 'OKC_API.G_RET_STS_UNEXP_ERROR',
1259: x_msg_count => x_msg_count,
1254: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1255: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1256: p_api_name => l_api_name,
1257: p_pkg_name => g_pkg_name,
1258: p_exc_name => 'OKC_API.G_RET_STS_UNEXP_ERROR',
1259: x_msg_count => x_msg_count,
1260: x_msg_data => x_msg_data,
1261: p_api_type => g_api_type);
1262:
1260: x_msg_data => x_msg_data,
1261: p_api_type => g_api_type);
1262:
1263: WHEN OTHERS THEN
1264: x_return_status := OKC_API.HANDLE_EXCEPTIONS(
1265: p_api_name => l_api_name,
1266: p_pkg_name => g_pkg_name,
1267: p_exc_name => 'OTHERS',
1268: x_msg_count => x_msg_count,