15: BEGIN
16: x_return_status := G_RET_STS_SUCCESS;
17: EXCEPTION
18:
19: WHEN OKL_API.G_EXCEPTION_ERROR THEN
20: x_return_status := G_RET_STS_ERROR;
21:
22: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
23: x_return_status := G_RET_STS_UNEXP_ERROR;
18:
19: WHEN OKL_API.G_EXCEPTION_ERROR THEN
20: x_return_status := G_RET_STS_ERROR;
21:
22: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
23: x_return_status := G_RET_STS_UNEXP_ERROR;
24:
25: WHEN OTHERS THEN
26: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
22: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
23: x_return_status := G_RET_STS_UNEXP_ERROR;
24:
25: WHEN OTHERS THEN
26: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
27: p_msg_name => G_DB_ERROR,
28: p_token1 => G_PROG_NAME_TOKEN,
29: p_token1_value => l_program_name,
30: p_token2 => G_SQLCODE_TOKEN,
79: x_return_status := G_RET_STS_SUCCESS;
80:
81: EXCEPTION
82:
83: WHEN OKL_API.G_EXCEPTION_ERROR THEN
84: x_return_status := G_RET_STS_ERROR;
85:
86: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
87: x_return_status := G_RET_STS_UNEXP_ERROR;
82:
83: WHEN OKL_API.G_EXCEPTION_ERROR THEN
84: x_return_status := G_RET_STS_ERROR;
85:
86: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
87: x_return_status := G_RET_STS_UNEXP_ERROR;
88:
89: WHEN OTHERS THEN
90: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
86: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
87: x_return_status := G_RET_STS_UNEXP_ERROR;
88:
89: WHEN OTHERS THEN
90: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
91: p_msg_name => G_DB_ERROR,
92: p_token1 => G_PROG_NAME_TOKEN,
93: p_token1_value => l_program_name,
94: p_token2 => G_SQLCODE_TOKEN,
171: x_return_status := G_RET_STS_SUCCESS;
172:
173: EXCEPTION
174:
175: WHEN OKL_API.G_EXCEPTION_ERROR THEN
176: x_return_status := G_RET_STS_ERROR;
177:
178: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
179: x_return_status := G_RET_STS_UNEXP_ERROR;
174:
175: WHEN OKL_API.G_EXCEPTION_ERROR THEN
176: x_return_status := G_RET_STS_ERROR;
177:
178: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
179: x_return_status := G_RET_STS_UNEXP_ERROR;
180:
181: WHEN OTHERS THEN
182: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
178: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
179: x_return_status := G_RET_STS_UNEXP_ERROR;
180:
181: WHEN OTHERS THEN
182: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
183: p_msg_name => G_DB_ERROR,
184: p_token1 => G_PROG_NAME_TOKEN,
185: p_token1_value => l_program_name,
186: p_token2 => G_SQLCODE_TOKEN,
219: l_amt_flag := 'Y';
220: l_assoc_total := l_assoc_total + p_assoc_assets_tbl(i).amount;
221: END IF;
222: IF (p_assoc_assets_tbl(i).amount IS NULL) AND l_amt_flag = 'Y' THEN
223: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME, p_msg_name => 'OKL_LINKASSET_NULL_FOUND');
224: RAISE OKL_API.G_EXCEPTION_ERROR;
225: END IF;
226: END IF;
227: END LOOP;
220: l_assoc_total := l_assoc_total + p_assoc_assets_tbl(i).amount;
221: END IF;
222: IF (p_assoc_assets_tbl(i).amount IS NULL) AND l_amt_flag = 'Y' THEN
223: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME, p_msg_name => 'OKL_LINKASSET_NULL_FOUND');
224: RAISE OKL_API.G_EXCEPTION_ERROR;
225: END IF;
226: END IF;
227: END LOOP;
228:
226: END IF;
227: END LOOP;
228:
229: IF l_amt_flag = 'Y' AND l_assoc_total <> p_service_amount THEN
230: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
231: p_msg_name => 'OKL_LINKASSET_AMT_MISMATCH',
232: p_token1 => 'LINE_COST',
233: p_token1_value => p_service_amount,
234: p_token2 => 'ASSOC_TOTAL',
232: p_token1 => 'LINE_COST',
233: p_token1_value => p_service_amount,
234: p_token2 => 'ASSOC_TOTAL',
235: p_token2_value => l_assoc_total);
236: RAISE OKL_API.G_EXCEPTION_ERROR;
237: END IF;
238:
239: IF l_amt_flag = 'Y' THEN
240: x_derive_assoc_amt := 'N';
245: x_return_status := G_RET_STS_SUCCESS;
246:
247: EXCEPTION
248:
249: WHEN OKL_API.G_EXCEPTION_ERROR THEN
250: x_return_status := G_RET_STS_ERROR;
251:
252: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
253: x_return_status := G_RET_STS_UNEXP_ERROR;
248:
249: WHEN OKL_API.G_EXCEPTION_ERROR THEN
250: x_return_status := G_RET_STS_ERROR;
251:
252: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
253: x_return_status := G_RET_STS_UNEXP_ERROR;
254:
255: WHEN OTHERS THEN
256: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
252: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
253: x_return_status := G_RET_STS_UNEXP_ERROR;
254:
255: WHEN OTHERS THEN
256: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
257: p_msg_name => G_DB_ERROR,
258: p_token1 => G_PROG_NAME_TOKEN,
259: p_token1_value => l_program_name,
260: p_token2 => G_SQLCODE_TOKEN,
432: x_return_status := G_RET_STS_SUCCESS;
433:
434: EXCEPTION
435:
436: WHEN OKL_API.G_EXCEPTION_ERROR THEN
437: x_return_status := G_RET_STS_ERROR;
438:
439: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
440: x_return_status := G_RET_STS_UNEXP_ERROR;
435:
436: WHEN OKL_API.G_EXCEPTION_ERROR THEN
437: x_return_status := G_RET_STS_ERROR;
438:
439: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
440: x_return_status := G_RET_STS_UNEXP_ERROR;
441:
442: WHEN OTHERS THEN
443: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
439: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
440: x_return_status := G_RET_STS_UNEXP_ERROR;
441:
442: WHEN OTHERS THEN
443: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
444: p_msg_name => G_DB_ERROR,
445: p_token1 => G_PROG_NAME_TOKEN,
446: p_token1_value => l_program_name,
447: p_token2 => G_SQLCODE_TOKEN,
503: x_return_status := G_RET_STS_SUCCESS;
504:
505: EXCEPTION
506:
507: WHEN OKL_API.G_EXCEPTION_ERROR THEN
508: x_return_status := G_RET_STS_ERROR;
509:
510: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
511: x_return_status := G_RET_STS_UNEXP_ERROR;
506:
507: WHEN OKL_API.G_EXCEPTION_ERROR THEN
508: x_return_status := G_RET_STS_ERROR;
509:
510: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
511: x_return_status := G_RET_STS_UNEXP_ERROR;
512:
513: WHEN OTHERS THEN
514: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
510: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
511: x_return_status := G_RET_STS_UNEXP_ERROR;
512:
513: WHEN OTHERS THEN
514: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
515: p_msg_name => G_DB_ERROR,
516: p_token1 => G_PROG_NAME_TOKEN,
517: p_token1_value => l_program_name,
518: p_token2 => G_SQLCODE_TOKEN,
570: ,x_lrev_tbl => lx_assoc_assets_tbl
571: );
572:
573: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
574: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
575: ELSIF x_return_status = G_RET_STS_ERROR THEN
576: RAISE OKL_API.G_EXCEPTION_ERROR;
577: END IF;
578:
572:
573: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
574: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
575: ELSIF x_return_status = G_RET_STS_ERROR THEN
576: RAISE OKL_API.G_EXCEPTION_ERROR;
577: END IF;
578:
579: EXCEPTION
580:
577: END IF;
578:
579: EXCEPTION
580:
581: WHEN OKL_API.G_EXCEPTION_ERROR THEN
582: x_return_status := G_RET_STS_ERROR;
583:
584: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
585: x_return_status := G_RET_STS_UNEXP_ERROR;
580:
581: WHEN OKL_API.G_EXCEPTION_ERROR THEN
582: x_return_status := G_RET_STS_ERROR;
583:
584: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
585: x_return_status := G_RET_STS_UNEXP_ERROR;
586:
587: WHEN OTHERS THEN
588: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
584: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
585: x_return_status := G_RET_STS_UNEXP_ERROR;
586:
587: WHEN OTHERS THEN
588: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
589: p_msg_name => G_DB_ERROR,
590: p_token1 => G_PROG_NAME_TOKEN,
591: p_token1_value => l_program_name,
592: p_token2 => G_SQLCODE_TOKEN,
630: ,x_return_status => x_return_status
631: );
632:
633: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
634: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
635: ELSIF x_return_status = G_RET_STS_ERROR THEN
636: RAISE OKL_API.G_EXCEPTION_ERROR;
637: END IF;
638:
632:
633: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
634: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
635: ELSIF x_return_status = G_RET_STS_ERROR THEN
636: RAISE OKL_API.G_EXCEPTION_ERROR;
637: END IF;
638:
639: IF l_deleted_assoc_assets_tbl.COUNT > 0 THEN
640: okl_lre_pvt.delete_row (
644: ,x_msg_count => x_msg_count
645: ,x_msg_data => x_msg_data
646: ,p_lrev_tbl => l_deleted_assoc_assets_tbl );
647: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
648: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
649: ELSIF x_return_status = G_RET_STS_ERROR THEN
650: RAISE OKL_API.G_EXCEPTION_ERROR;
651: END IF;
652: END IF;
646: ,p_lrev_tbl => l_deleted_assoc_assets_tbl );
647: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
648: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
649: ELSIF x_return_status = G_RET_STS_ERROR THEN
650: RAISE OKL_API.G_EXCEPTION_ERROR;
651: END IF;
652: END IF;
653:
654: IF l_line_relation_tbl.COUNT > 0 THEN
695: ,x_lrev_tbl => lx_assoc_assets_tbl
696: );
697:
698: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
699: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
700: ELSIF x_return_status = G_RET_STS_ERROR THEN
701: RAISE OKL_API.G_EXCEPTION_ERROR;
702: END IF;
703:
697:
698: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
699: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
700: ELSIF x_return_status = G_RET_STS_ERROR THEN
701: RAISE OKL_API.G_EXCEPTION_ERROR;
702: END IF;
703:
704: END IF;
705:
715: ,x_lrev_tbl => lx_assoc_assets_tbl
716: );
717:
718: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
719: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
720: ELSIF x_return_status = G_RET_STS_ERROR THEN
721: RAISE OKL_API.G_EXCEPTION_ERROR;
722: END IF;
723:
717:
718: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
719: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
720: ELSIF x_return_status = G_RET_STS_ERROR THEN
721: RAISE OKL_API.G_EXCEPTION_ERROR;
722: END IF;
723:
724: END IF;
725:
726: x_return_status := G_RET_STS_SUCCESS;
727:
728: EXCEPTION
729:
730: WHEN OKL_API.G_EXCEPTION_ERROR THEN
731: x_return_status := G_RET_STS_ERROR;
732:
733: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
734: x_return_status := G_RET_STS_UNEXP_ERROR;
729:
730: WHEN OKL_API.G_EXCEPTION_ERROR THEN
731: x_return_status := G_RET_STS_ERROR;
732:
733: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
734: x_return_status := G_RET_STS_UNEXP_ERROR;
735:
736: WHEN OTHERS THEN
737: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
733: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
734: x_return_status := G_RET_STS_UNEXP_ERROR;
735:
736: WHEN OTHERS THEN
737: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
738: p_msg_name => G_DB_ERROR,
739: p_token1 => G_PROG_NAME_TOKEN,
740: p_token1_value => l_program_name,
741: p_token2 => G_SQLCODE_TOKEN,
821:
822: x_return_status := G_RET_STS_SUCCESS;
823: EXCEPTION
824:
825: WHEN OKL_API.G_EXCEPTION_ERROR THEN
826: x_return_status := G_RET_STS_ERROR;
827:
828: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
829: x_return_status := G_RET_STS_UNEXP_ERROR;
824:
825: WHEN OKL_API.G_EXCEPTION_ERROR THEN
826: x_return_status := G_RET_STS_ERROR;
827:
828: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
829: x_return_status := G_RET_STS_UNEXP_ERROR;
830:
831: WHEN OTHERS THEN
832: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
828: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
829: x_return_status := G_RET_STS_UNEXP_ERROR;
830:
831: WHEN OTHERS THEN
832: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
833: p_msg_name => G_DB_ERROR,
834: p_token1 => G_PROG_NAME_TOKEN,
835: p_token1_value => l_program_name,
836: p_token2 => G_SQLCODE_TOKEN,
868: p_target_service_id => p_target_service_id,
869: x_lrship_tbl => l_lrship_tbl,
870: x_return_status => x_return_status);
871: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
872: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
873: ELSIF x_return_status = G_RET_STS_ERROR THEN
874: RAISE OKL_API.G_EXCEPTION_ERROR;
875: END IF;
876:
870: x_return_status => x_return_status);
871: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
872: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
873: ELSIF x_return_status = G_RET_STS_ERROR THEN
874: RAISE OKL_API.G_EXCEPTION_ERROR;
875: END IF;
876:
877: -- Set the original asset id for the records
878: IF (l_lrship_tbl.COUNT > 0) THEN
893: ,p_lrev_tbl => l_lrship_tbl
894: ,x_lrev_tbl => lx_lrship_tbl );
895:
896: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
897: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
898: ELSIF x_return_status = G_RET_STS_ERROR THEN
899: RAISE OKL_API.G_EXCEPTION_ERROR;
900: END IF;
901: END IF;
895:
896: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
897: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
898: ELSIF x_return_status = G_RET_STS_ERROR THEN
899: RAISE OKL_API.G_EXCEPTION_ERROR;
900: END IF;
901: END IF;
902:
903: x_return_status := G_RET_STS_SUCCESS;
903: x_return_status := G_RET_STS_SUCCESS;
904:
905: EXCEPTION
906:
907: WHEN OKL_API.G_EXCEPTION_ERROR THEN
908:
909: x_return_status := G_RET_STS_ERROR;
910:
911: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
907: WHEN OKL_API.G_EXCEPTION_ERROR THEN
908:
909: x_return_status := G_RET_STS_ERROR;
910:
911: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
912:
913: x_return_status := G_RET_STS_UNEXP_ERROR;
914:
915: WHEN OTHERS THEN
913: x_return_status := G_RET_STS_UNEXP_ERROR;
914:
915: WHEN OTHERS THEN
916:
917: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
918: p_msg_name => G_DB_ERROR,
919: p_token1 => G_PROG_NAME_TOKEN,
920: p_token1_value => l_api_name,
921: p_token2 => G_SQLCODE_TOKEN,
955: ,x_svcv_rec => lx_service_rec
956: );
957:
958: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
959: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
960: ELSIF x_return_status = G_RET_STS_ERROR THEN
961: RAISE OKL_API.G_EXCEPTION_ERROR;
962: END IF;
963:
957:
958: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
959: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
960: ELSIF x_return_status = G_RET_STS_ERROR THEN
961: RAISE OKL_API.G_EXCEPTION_ERROR;
962: END IF;
963:
964: x_service_id := lx_service_rec.id;
965:
964: x_service_id := lx_service_rec.id;
965:
966: EXCEPTION
967:
968: WHEN OKL_API.G_EXCEPTION_ERROR THEN
969: x_return_status := G_RET_STS_ERROR;
970:
971: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
972: x_return_status := G_RET_STS_UNEXP_ERROR;
967:
968: WHEN OKL_API.G_EXCEPTION_ERROR THEN
969: x_return_status := G_RET_STS_ERROR;
970:
971: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
972: x_return_status := G_RET_STS_UNEXP_ERROR;
973:
974: WHEN OTHERS THEN
975: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
971: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
972: x_return_status := G_RET_STS_UNEXP_ERROR;
973:
974: WHEN OTHERS THEN
975: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
976: p_msg_name => G_DB_ERROR,
977: p_token1 => G_PROG_NAME_TOKEN,
978: p_token1_value => l_program_name,
979: p_token2 => G_SQLCODE_TOKEN,
1013: ,x_svcv_rec => lx_service_rec
1014: );
1015:
1016: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1017: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1018: ELSIF x_return_status = G_RET_STS_ERROR THEN
1019: RAISE OKL_API.G_EXCEPTION_ERROR;
1020: END IF;
1021:
1015:
1016: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1017: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1018: ELSIF x_return_status = G_RET_STS_ERROR THEN
1019: RAISE OKL_API.G_EXCEPTION_ERROR;
1020: END IF;
1021:
1022: EXCEPTION
1023:
1020: END IF;
1021:
1022: EXCEPTION
1023:
1024: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1025: x_return_status := G_RET_STS_ERROR;
1026:
1027: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1028: x_return_status := G_RET_STS_UNEXP_ERROR;
1023:
1024: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1025: x_return_status := G_RET_STS_ERROR;
1026:
1027: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1028: x_return_status := G_RET_STS_UNEXP_ERROR;
1029:
1030: WHEN OTHERS THEN
1031: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1027: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1028: x_return_status := G_RET_STS_UNEXP_ERROR;
1029:
1030: WHEN OTHERS THEN
1031: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1032: p_msg_name => G_DB_ERROR,
1033: p_token1 => G_PROG_NAME_TOKEN,
1034: p_token1_value => l_program_name,
1035: p_token2 => G_SQLCODE_TOKEN,
1078: ,x_msg_data => x_msg_data
1079: );
1080:
1081: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1082: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1083: ELSIF x_return_status = G_RET_STS_ERROR THEN
1084: RAISE OKL_API.G_EXCEPTION_ERROR;
1085: END IF;
1086:
1080:
1081: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1082: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1083: ELSIF x_return_status = G_RET_STS_ERROR THEN
1084: RAISE OKL_API.G_EXCEPTION_ERROR;
1085: END IF;
1086:
1087: EXCEPTION
1088:
1085: END IF;
1086:
1087: EXCEPTION
1088:
1089: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1090: x_return_status := G_RET_STS_ERROR;
1091:
1092: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1093: x_return_status := G_RET_STS_UNEXP_ERROR;
1088:
1089: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1090: x_return_status := G_RET_STS_ERROR;
1091:
1092: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1093: x_return_status := G_RET_STS_UNEXP_ERROR;
1094:
1095: WHEN OTHERS THEN
1096: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1092: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1093: x_return_status := G_RET_STS_UNEXP_ERROR;
1094:
1095: WHEN OTHERS THEN
1096: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1097: p_msg_name => G_DB_ERROR,
1098: p_token1 => G_PROG_NAME_TOKEN,
1099: p_token1_value => l_program_name,
1100: p_token2 => G_SQLCODE_TOKEN,
1141: ,x_msg_data => x_msg_data
1142: );
1143:
1144: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1145: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1146: ELSIF x_return_status = G_RET_STS_ERROR THEN
1147: RAISE OKL_API.G_EXCEPTION_ERROR;
1148: END IF;
1149:
1143:
1144: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1145: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1146: ELSIF x_return_status = G_RET_STS_ERROR THEN
1147: RAISE OKL_API.G_EXCEPTION_ERROR;
1148: END IF;
1149:
1150: EXCEPTION
1151:
1148: END IF;
1149:
1150: EXCEPTION
1151:
1152: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1153: x_return_status := G_RET_STS_ERROR;
1154:
1155: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1156: x_return_status := G_RET_STS_UNEXP_ERROR;
1151:
1152: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1153: x_return_status := G_RET_STS_ERROR;
1154:
1155: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1156: x_return_status := G_RET_STS_UNEXP_ERROR;
1157:
1158: WHEN OTHERS THEN
1159: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1155: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1156: x_return_status := G_RET_STS_UNEXP_ERROR;
1157:
1158: WHEN OTHERS THEN
1159: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1160: p_msg_name => G_DB_ERROR,
1161: p_token1 => G_PROG_NAME_TOKEN,
1162: p_token1_value => l_program_name,
1163: p_token2 => G_SQLCODE_TOKEN,
1205: ,x_msg_data => x_msg_data
1206: );
1207:
1208: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1209: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1210: ELSIF x_return_status = G_RET_STS_ERROR THEN
1211: RAISE OKL_API.G_EXCEPTION_ERROR;
1212: END IF;
1213:
1207:
1208: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1209: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1210: ELSIF x_return_status = G_RET_STS_ERROR THEN
1211: RAISE OKL_API.G_EXCEPTION_ERROR;
1212: END IF;
1213:
1214: EXCEPTION
1215:
1212: END IF;
1213:
1214: EXCEPTION
1215:
1216: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1217: x_return_status := G_RET_STS_ERROR;
1218:
1219: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1220: x_return_status := G_RET_STS_UNEXP_ERROR;
1215:
1216: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1217: x_return_status := G_RET_STS_ERROR;
1218:
1219: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1220: x_return_status := G_RET_STS_UNEXP_ERROR;
1221:
1222: WHEN OTHERS THEN
1223: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1219: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1220: x_return_status := G_RET_STS_UNEXP_ERROR;
1221:
1222: WHEN OTHERS THEN
1223: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1224: p_msg_name => G_DB_ERROR,
1225: p_token1 => G_PROG_NAME_TOKEN,
1226: p_token1_value => l_program_name,
1227: p_token2 => G_SQLCODE_TOKEN,
1268: ,x_msg_data => x_msg_data
1269: );
1270:
1271: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1272: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1273: ELSIF x_return_status = G_RET_STS_ERROR THEN
1274: RAISE OKL_API.G_EXCEPTION_ERROR;
1275: END IF;
1276:
1270:
1271: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1272: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1273: ELSIF x_return_status = G_RET_STS_ERROR THEN
1274: RAISE OKL_API.G_EXCEPTION_ERROR;
1275: END IF;
1276:
1277: EXCEPTION
1278:
1275: END IF;
1276:
1277: EXCEPTION
1278:
1279: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1280: x_return_status := G_RET_STS_ERROR;
1281:
1282: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1283: x_return_status := G_RET_STS_UNEXP_ERROR;
1278:
1279: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1280: x_return_status := G_RET_STS_ERROR;
1281:
1282: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1283: x_return_status := G_RET_STS_UNEXP_ERROR;
1284:
1285: WHEN OTHERS THEN
1286: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1282: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1283: x_return_status := G_RET_STS_UNEXP_ERROR;
1284:
1285: WHEN OTHERS THEN
1286: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1287: p_msg_name => G_DB_ERROR,
1288: p_token1 => G_PROG_NAME_TOKEN,
1289: p_token1_value => l_program_name,
1290: p_token2 => G_SQLCODE_TOKEN,
1346:
1347: IF p_expense_level_tbl(p_expense_level_tbl.FIRST).periods <>
1348: TRUNC (p_expense_level_tbl(p_expense_level_tbl.FIRST).periods) THEN
1349:
1350: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME, p_msg_name => 'OKL_RECEXP_PERIODS_INVALID');
1351: RAISE OKL_API.G_EXCEPTION_ERROR;
1352:
1353: END IF;
1354:
1347: IF p_expense_level_tbl(p_expense_level_tbl.FIRST).periods <>
1348: TRUNC (p_expense_level_tbl(p_expense_level_tbl.FIRST).periods) THEN
1349:
1350: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME, p_msg_name => 'OKL_RECEXP_PERIODS_INVALID');
1351: RAISE OKL_API.G_EXCEPTION_ERROR;
1352:
1353: END IF;
1354:
1355: l_periodic_amount :=
1363: ,x_return_status => l_return_status
1364: );
1365:
1366: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1367: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1368: ELSIF l_return_status = G_RET_STS_ERROR THEN
1369: RAISE OKL_API.G_EXCEPTION_ERROR;
1370: END IF;
1371:
1365:
1366: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1367: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1368: ELSIF l_return_status = G_RET_STS_ERROR THEN
1369: RAISE OKL_API.G_EXCEPTION_ERROR;
1370: END IF;
1371:
1372: IF p_assoc_asset_tbl.COUNT > 0 THEN
1373:
1380: ,x_return_status => l_return_status
1381: );
1382:
1383: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1384: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1385: ELSIF l_return_status = G_RET_STS_ERROR THEN
1386: RAISE OKL_API.G_EXCEPTION_ERROR;
1387: END IF;
1388:
1382:
1383: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1384: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1385: ELSIF l_return_status = G_RET_STS_ERROR THEN
1386: RAISE OKL_API.G_EXCEPTION_ERROR;
1387: END IF;
1388:
1389: IF (l_derive_assoc_amt = 'Y') THEN
1390:
1399: ,x_msg_data => x_msg_data
1400: );
1401:
1402: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1403: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1404: ELSIF l_return_status = G_RET_STS_ERROR THEN
1405: RAISE OKL_API.G_EXCEPTION_ERROR;
1406: END IF;
1407:
1401:
1402: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1403: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1404: ELSIF l_return_status = G_RET_STS_ERROR THEN
1405: RAISE OKL_API.G_EXCEPTION_ERROR;
1406: END IF;
1407:
1408: END IF;
1409:
1417: ,x_msg_data => x_msg_data
1418: );
1419:
1420: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1421: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1422: ELSIF l_return_status = G_RET_STS_ERROR THEN
1423: RAISE OKL_API.G_EXCEPTION_ERROR;
1424: END IF;
1425:
1419:
1420: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1421: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1422: ELSIF l_return_status = G_RET_STS_ERROR THEN
1423: RAISE OKL_API.G_EXCEPTION_ERROR;
1424: END IF;
1425:
1426: IF l_line_relation_tbl.COUNT > 0 THEN
1427:
1433: ,x_msg_data => x_msg_data
1434: );
1435:
1436: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1437: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1438: ELSIF l_return_status = G_RET_STS_ERROR THEN
1439: RAISE OKL_API.G_EXCEPTION_ERROR;
1440: END IF;
1441:
1435:
1436: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1437: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1438: ELSIF l_return_status = G_RET_STS_ERROR THEN
1439: RAISE OKL_API.G_EXCEPTION_ERROR;
1440: END IF;
1441:
1442: END IF;
1443:
1441:
1442: END IF;
1443:
1444: IF (p_payment_level_tbl.COUNT > 0 AND p_payment_header_rec.stream_type_id IS NULL) THEN
1445: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1446: p_msg_name => 'OKL_SALES_NO_PAYMENTHEAD');
1447: RAISE OKL_API.G_EXCEPTION_ERROR;
1448: ELSIF (p_payment_header_rec.stream_type_id IS NOT NULL AND p_payment_level_tbl.COUNT = 0 ) THEN
1449: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1443:
1444: IF (p_payment_level_tbl.COUNT > 0 AND p_payment_header_rec.stream_type_id IS NULL) THEN
1445: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1446: p_msg_name => 'OKL_SALES_NO_PAYMENTHEAD');
1447: RAISE OKL_API.G_EXCEPTION_ERROR;
1448: ELSIF (p_payment_header_rec.stream_type_id IS NOT NULL AND p_payment_level_tbl.COUNT = 0 ) THEN
1449: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1450: p_msg_name => 'OKL_SALES_NO_PAYMENTLINES');
1451: RAISE OKL_API.G_EXCEPTION_ERROR;
1445: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1446: p_msg_name => 'OKL_SALES_NO_PAYMENTHEAD');
1447: RAISE OKL_API.G_EXCEPTION_ERROR;
1448: ELSIF (p_payment_header_rec.stream_type_id IS NOT NULL AND p_payment_level_tbl.COUNT = 0 ) THEN
1449: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1450: p_msg_name => 'OKL_SALES_NO_PAYMENTLINES');
1451: RAISE OKL_API.G_EXCEPTION_ERROR;
1452: END IF;
1453:
1447: RAISE OKL_API.G_EXCEPTION_ERROR;
1448: ELSIF (p_payment_header_rec.stream_type_id IS NOT NULL AND p_payment_level_tbl.COUNT = 0 ) THEN
1449: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1450: p_msg_name => 'OKL_SALES_NO_PAYMENTLINES');
1451: RAISE OKL_API.G_EXCEPTION_ERROR;
1452: END IF;
1453:
1454: IF p_payment_level_tbl.COUNT > 0 THEN
1455:
1462: ,x_msg_data => x_msg_data
1463: );
1464:
1465: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1466: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1467: ELSIF l_return_status = G_RET_STS_ERROR THEN
1468: RAISE OKL_API.G_EXCEPTION_ERROR;
1469: END IF;
1470:
1464:
1465: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1466: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1467: ELSIF l_return_status = G_RET_STS_ERROR THEN
1468: RAISE OKL_API.G_EXCEPTION_ERROR;
1469: END IF;
1470:
1471: END IF;
1472:
1479: ,x_msg_data => x_msg_data
1480: );
1481:
1482: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1483: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1484: ELSIF l_return_status = G_RET_STS_ERROR THEN
1485: RAISE OKL_API.G_EXCEPTION_ERROR;
1486: END IF;
1487:
1481:
1482: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1483: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1484: ELSIF l_return_status = G_RET_STS_ERROR THEN
1485: RAISE OKL_API.G_EXCEPTION_ERROR;
1486: END IF;
1487:
1488: x_return_status := G_RET_STS_SUCCESS;
1489:
1488: x_return_status := G_RET_STS_SUCCESS;
1489:
1490: EXCEPTION
1491:
1492: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1493:
1494: IF p_transaction_control = G_TRUE THEN
1495: ROLLBACK TO l_program_name;
1496: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
1497: END IF;
1498:
1499: x_return_status := G_RET_STS_ERROR;
1500:
1501: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1502:
1503: IF p_transaction_control = G_TRUE THEN
1504: ROLLBACK TO l_program_name;
1505: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
1508: x_return_status := G_RET_STS_UNEXP_ERROR;
1509:
1510: WHEN OTHERS THEN
1511:
1512: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1513: p_msg_name => G_DB_ERROR,
1514: p_token1 => G_PROG_NAME_TOKEN,
1515: p_token1_value => l_api_name,
1516: p_token2 => G_SQLCODE_TOKEN,
1570:
1571: x_return_status := G_RET_STS_SUCCESS;
1572: EXCEPTION
1573:
1574: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1575: x_return_status := G_RET_STS_ERROR;
1576:
1577: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1578: x_return_status := G_RET_STS_UNEXP_ERROR;
1573:
1574: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1575: x_return_status := G_RET_STS_ERROR;
1576:
1577: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1578: x_return_status := G_RET_STS_UNEXP_ERROR;
1579:
1580: WHEN OTHERS THEN
1581: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1577: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1578: x_return_status := G_RET_STS_UNEXP_ERROR;
1579:
1580: WHEN OTHERS THEN
1581: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1582: p_msg_name => G_DB_ERROR,
1583: p_token1 => G_PROG_NAME_TOKEN,
1584: p_token1_value => l_program_name,
1585: p_token2 => G_SQLCODE_TOKEN,
1629: get_line_relations_tbl (p_service_id => p_service_id
1630: ,x_line_relation_tbl => l_copy_relation_tbl
1631: ,x_return_status => x_return_status);
1632: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1633: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1634: ELSIF x_return_status = G_RET_STS_ERROR THEN
1635: RAISE OKL_API.G_EXCEPTION_ERROR;
1636: END IF;
1637:
1631: ,x_return_status => x_return_status);
1632: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1633: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1634: ELSIF x_return_status = G_RET_STS_ERROR THEN
1635: RAISE OKL_API.G_EXCEPTION_ERROR;
1636: END IF;
1637:
1638: SELECT LVL.AMOUNT * LVL.NUMBER_OF_PERIODS
1639: INTO ln_service_amount
1663: ,x_msg_count => x_msg_count
1664: ,x_msg_data => x_msg_data );
1665:
1666: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1667: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1668: ELSIF x_return_status = G_RET_STS_ERROR THEN
1669: RAISE OKL_API.G_EXCEPTION_ERROR;
1670: END IF;
1671:
1665:
1666: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1667: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1668: ELSIF x_return_status = G_RET_STS_ERROR THEN
1669: RAISE OKL_API.G_EXCEPTION_ERROR;
1670: END IF;
1671:
1672: FOR i IN l_copy_relation_tbl.FIRST .. l_copy_relation_tbl.LAST LOOP
1673: IF l_copy_relation_tbl.EXISTS(i) THEN
1691: ,p_lrev_tbl => l_line_relation_tbl
1692: ,x_lrev_tbl => lx_line_relation_tbl);
1693:
1694: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1695: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1696: ELSIF x_return_status = G_RET_STS_ERROR THEN
1697: RAISE OKL_API.G_EXCEPTION_ERROR;
1698: END IF;
1699: END IF;
1693:
1694: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
1695: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1696: ELSIF x_return_status = G_RET_STS_ERROR THEN
1697: RAISE OKL_API.G_EXCEPTION_ERROR;
1698: END IF;
1699: END IF;
1700: END IF;
1701:
1702: x_return_status := G_RET_STS_SUCCESS;
1703:
1704: EXCEPTION
1705:
1706: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1707:
1708: IF p_transaction_control = G_TRUE THEN
1709: ROLLBACK TO l_program_name;
1710: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
1711: END IF;
1712:
1713: x_return_status := G_RET_STS_ERROR;
1714:
1715: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1716:
1717: IF p_transaction_control = G_TRUE THEN
1718: ROLLBACK TO l_program_name;
1719: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
1722: x_return_status := G_RET_STS_UNEXP_ERROR;
1723:
1724: WHEN OTHERS THEN
1725:
1726: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1727: p_msg_name => G_DB_ERROR,
1728: p_token1 => G_PROG_NAME_TOKEN,
1729: p_token1_value => l_api_name,
1730: p_token2 => G_SQLCODE_TOKEN,
1789:
1790: IF p_expense_level_tbl(p_expense_level_tbl.FIRST).periods <>
1791: TRUNC (p_expense_level_tbl(p_expense_level_tbl.FIRST).periods) THEN
1792:
1793: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME, p_msg_name => 'OKL_RECEXP_PERIODS_INVALID');
1794: RAISE OKL_API.G_EXCEPTION_ERROR;
1795:
1796: END IF;
1797:
1790: IF p_expense_level_tbl(p_expense_level_tbl.FIRST).periods <>
1791: TRUNC (p_expense_level_tbl(p_expense_level_tbl.FIRST).periods) THEN
1792:
1793: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME, p_msg_name => 'OKL_RECEXP_PERIODS_INVALID');
1794: RAISE OKL_API.G_EXCEPTION_ERROR;
1795:
1796: END IF;
1797:
1798: l_periodic_amount :=
1806: ,x_return_status => l_return_status
1807: );
1808:
1809: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1810: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1811: ELSIF l_return_status = G_RET_STS_ERROR THEN
1812: RAISE OKL_API.G_EXCEPTION_ERROR;
1813: END IF;
1814:
1808:
1809: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1810: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1811: ELSIF l_return_status = G_RET_STS_ERROR THEN
1812: RAISE OKL_API.G_EXCEPTION_ERROR;
1813: END IF;
1814:
1815: IF p_assoc_asset_tbl.COUNT > 0 THEN
1816:
1823: ,x_return_status => l_return_status
1824: );
1825:
1826: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1827: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1828: ELSIF l_return_status = G_RET_STS_ERROR THEN
1829: RAISE OKL_API.G_EXCEPTION_ERROR;
1830: END IF;
1831:
1825:
1826: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1827: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1828: ELSIF l_return_status = G_RET_STS_ERROR THEN
1829: RAISE OKL_API.G_EXCEPTION_ERROR;
1830: END IF;
1831:
1832: IF (l_derive_assoc_amt = 'Y') THEN
1833:
1842: ,x_msg_data => x_msg_data
1843: );
1844:
1845: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1846: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1847: ELSIF l_return_status = G_RET_STS_ERROR THEN
1848: RAISE OKL_API.G_EXCEPTION_ERROR;
1849: END IF;
1850:
1844:
1845: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1846: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1847: ELSIF l_return_status = G_RET_STS_ERROR THEN
1848: RAISE OKL_API.G_EXCEPTION_ERROR;
1849: END IF;
1850:
1851: END IF;
1852:
1859: ,x_msg_data => x_msg_data
1860: );
1861:
1862: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1863: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1864: ELSIF l_return_status = G_RET_STS_ERROR THEN
1865: RAISE OKL_API.G_EXCEPTION_ERROR;
1866: END IF;
1867:
1861:
1862: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1863: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1864: ELSIF l_return_status = G_RET_STS_ERROR THEN
1865: RAISE OKL_API.G_EXCEPTION_ERROR;
1866: END IF;
1867:
1868: IF l_line_relation_tbl.COUNT > 0 THEN
1869:
1875: ,x_msg_data => x_msg_data
1876: );
1877:
1878: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1879: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1880: ELSIF l_return_status = G_RET_STS_ERROR THEN
1881: RAISE OKL_API.G_EXCEPTION_ERROR;
1882: END IF;
1883:
1877:
1878: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1879: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1880: ELSIF l_return_status = G_RET_STS_ERROR THEN
1881: RAISE OKL_API.G_EXCEPTION_ERROR;
1882: END IF;
1883:
1884: END IF;
1885:
1883:
1884: END IF;
1885:
1886: IF (p_payment_level_tbl.COUNT > 0 AND p_payment_header_rec.stream_type_id IS NULL) THEN
1887: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1888: p_msg_name => 'OKL_SALES_NO_PAYMENTHEAD');
1889: RAISE OKL_API.G_EXCEPTION_ERROR;
1890: ELSIF (p_payment_header_rec.stream_type_id IS NOT NULL AND p_payment_level_tbl.COUNT = 0 ) THEN
1891: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1885:
1886: IF (p_payment_level_tbl.COUNT > 0 AND p_payment_header_rec.stream_type_id IS NULL) THEN
1887: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1888: p_msg_name => 'OKL_SALES_NO_PAYMENTHEAD');
1889: RAISE OKL_API.G_EXCEPTION_ERROR;
1890: ELSIF (p_payment_header_rec.stream_type_id IS NOT NULL AND p_payment_level_tbl.COUNT = 0 ) THEN
1891: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1892: p_msg_name => 'OKL_SALES_NO_PAYMENTLINES');
1893: RAISE OKL_API.G_EXCEPTION_ERROR;
1887: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1888: p_msg_name => 'OKL_SALES_NO_PAYMENTHEAD');
1889: RAISE OKL_API.G_EXCEPTION_ERROR;
1890: ELSIF (p_payment_header_rec.stream_type_id IS NOT NULL AND p_payment_level_tbl.COUNT = 0 ) THEN
1891: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1892: p_msg_name => 'OKL_SALES_NO_PAYMENTLINES');
1893: RAISE OKL_API.G_EXCEPTION_ERROR;
1894: END IF;
1895:
1889: RAISE OKL_API.G_EXCEPTION_ERROR;
1890: ELSIF (p_payment_header_rec.stream_type_id IS NOT NULL AND p_payment_level_tbl.COUNT = 0 ) THEN
1891: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1892: p_msg_name => 'OKL_SALES_NO_PAYMENTLINES');
1893: RAISE OKL_API.G_EXCEPTION_ERROR;
1894: END IF;
1895:
1896: IF p_payment_level_tbl.COUNT > 0 THEN
1897:
1904: ,x_msg_data => x_msg_data
1905: );
1906:
1907: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1908: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1909: ELSIF l_return_status = G_RET_STS_ERROR THEN
1910: RAISE OKL_API.G_EXCEPTION_ERROR;
1911: END IF;
1912:
1906:
1907: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1908: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1909: ELSIF l_return_status = G_RET_STS_ERROR THEN
1910: RAISE OKL_API.G_EXCEPTION_ERROR;
1911: END IF;
1912:
1913: END IF;
1914:
1921: ,x_msg_data => x_msg_data
1922: );
1923:
1924: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1925: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1926: ELSIF l_return_status = G_RET_STS_ERROR THEN
1927: RAISE OKL_API.G_EXCEPTION_ERROR;
1928: END IF;
1929:
1923:
1924: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
1925: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1926: ELSIF l_return_status = G_RET_STS_ERROR THEN
1927: RAISE OKL_API.G_EXCEPTION_ERROR;
1928: END IF;
1929:
1930: x_return_status := G_RET_STS_SUCCESS;
1931:
1930: x_return_status := G_RET_STS_SUCCESS;
1931:
1932: EXCEPTION
1933:
1934: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1935:
1936: IF p_transaction_control = G_TRUE THEN
1937: ROLLBACK TO l_program_name;
1938: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
1939: END IF;
1940:
1941: x_return_status := G_RET_STS_ERROR;
1942:
1943: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1944:
1945: IF p_transaction_control = G_TRUE THEN
1946: ROLLBACK TO l_program_name;
1947: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
1950: x_return_status := G_RET_STS_UNEXP_ERROR;
1951:
1952: WHEN OTHERS THEN
1953:
1954: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
1955: p_msg_name => G_DB_ERROR,
1956: p_token1 => G_PROG_NAME_TOKEN,
1957: p_token1_value => l_api_name,
1958: p_token2 => G_SQLCODE_TOKEN,
2019: ,x_msg_data => x_msg_data
2020: );
2021:
2022: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2023: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2024: ELSIF x_return_status = G_RET_STS_ERROR THEN
2025: RAISE OKL_API.G_EXCEPTION_ERROR;
2026: END IF;
2027:
2021:
2022: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2023: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2024: ELSIF x_return_status = G_RET_STS_ERROR THEN
2025: RAISE OKL_API.G_EXCEPTION_ERROR;
2026: END IF;
2027:
2028: x_return_status := G_RET_STS_SUCCESS;
2029:
2028: x_return_status := G_RET_STS_SUCCESS;
2029:
2030: EXCEPTION
2031:
2032: WHEN OKL_API.G_EXCEPTION_ERROR THEN
2033:
2034: IF p_transaction_control = G_TRUE THEN
2035: ROLLBACK TO l_program_name;
2036: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2037: END IF;
2038:
2039: x_return_status := G_RET_STS_ERROR;
2040:
2041: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2042:
2043: IF p_transaction_control = G_TRUE THEN
2044: ROLLBACK TO l_program_name;
2045: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2048: x_return_status := G_RET_STS_UNEXP_ERROR;
2049:
2050: WHEN OTHERS THEN
2051:
2052: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
2053: p_msg_name => G_DB_ERROR,
2054: p_token1 => G_PROG_NAME_TOKEN,
2055: p_token1_value => l_api_name,
2056: p_token2 => G_SQLCODE_TOKEN,
2113: ,x_service_rec => l_service_rec
2114: ,x_return_status => x_return_status);
2115:
2116: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2117: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2118: ELSIF x_return_status = G_RET_STS_ERROR THEN
2119: RAISE OKL_API.G_EXCEPTION_ERROR;
2120: END IF;
2121:
2115:
2116: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2117: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2118: ELSIF x_return_status = G_RET_STS_ERROR THEN
2119: RAISE OKL_API.G_EXCEPTION_ERROR;
2120: END IF;
2121:
2122: l_service_rec.parent_object_id := p_target_quote_id;
2123:
2129: ,x_msg_data => x_msg_data
2130: );
2131:
2132: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2133: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2134: ELSIF x_return_status = G_RET_STS_ERROR THEN
2135: RAISE OKL_API.G_EXCEPTION_ERROR;
2136: END IF;
2137:
2131:
2132: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2133: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2134: ELSIF x_return_status = G_RET_STS_ERROR THEN
2135: RAISE OKL_API.G_EXCEPTION_ERROR;
2136: END IF;
2137:
2138: -- Validation to check if the product and expected start date for source
2139: -- and target contracts are equal, if not cash flows are not copied.
2173: x_return_status => x_return_status,
2174: x_msg_count => x_msg_count,
2175: x_msg_data => x_msg_data );
2176: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2177: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2178: ELSIF x_return_status = G_RET_STS_ERROR THEN
2179: RAISE OKL_API.G_EXCEPTION_ERROR;
2180: END IF;
2181: END IF;
2175: x_msg_data => x_msg_data );
2176: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2177: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2178: ELSIF x_return_status = G_RET_STS_ERROR THEN
2179: RAISE OKL_API.G_EXCEPTION_ERROR;
2180: END IF;
2181: END IF;
2182:
2183: IF (lb_copy_cashflow) THEN
2193: ,x_msg_count => x_msg_count
2194: ,x_msg_data => x_msg_data );
2195:
2196: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2197: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2198: ELSIF x_return_status = G_RET_STS_ERROR THEN
2199: RAISE OKL_API.G_EXCEPTION_ERROR;
2200: END IF;
2201: END IF;
2195:
2196: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2197: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2198: ELSIF x_return_status = G_RET_STS_ERROR THEN
2199: RAISE OKL_API.G_EXCEPTION_ERROR;
2200: END IF;
2201: END IF;
2202:
2203: x_return_status := G_RET_STS_SUCCESS;
2203: x_return_status := G_RET_STS_SUCCESS;
2204:
2205: EXCEPTION
2206:
2207: WHEN OKL_API.G_EXCEPTION_ERROR THEN
2208:
2209: IF p_transaction_control = G_TRUE THEN
2210: ROLLBACK TO l_program_name;
2211: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2212: END IF;
2213:
2214: x_return_status := G_RET_STS_ERROR;
2215:
2216: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2217:
2218: IF p_transaction_control = G_TRUE THEN
2219: ROLLBACK TO l_program_name;
2220: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2223: x_return_status := G_RET_STS_UNEXP_ERROR;
2224:
2225: WHEN OTHERS THEN
2226:
2227: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
2228: p_msg_name => G_DB_ERROR,
2229: p_token1 => G_PROG_NAME_TOKEN,
2230: p_token1_value => l_api_name,
2231: p_token2 => G_SQLCODE_TOKEN,
2296: ,p_lrev_tbl => l_lrev_tbl
2297: );
2298:
2299: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2300: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2301: ELSIF x_return_status = G_RET_STS_ERROR THEN
2302: RAISE OKL_API.G_EXCEPTION_ERROR;
2303: END IF;
2304:
2298:
2299: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2300: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2301: ELSIF x_return_status = G_RET_STS_ERROR THEN
2302: RAISE OKL_API.G_EXCEPTION_ERROR;
2303: END IF;
2304:
2305: END IF;
2306:
2315: ,x_msg_data => x_msg_data
2316: );
2317:
2318: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2319: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2320: ELSIF x_return_status = G_RET_STS_ERROR THEN
2321: RAISE OKL_API.G_EXCEPTION_ERROR;
2322: END IF;
2323:
2317:
2318: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2319: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2320: ELSIF x_return_status = G_RET_STS_ERROR THEN
2321: RAISE OKL_API.G_EXCEPTION_ERROR;
2322: END IF;
2323:
2324: l_svcv_rec.id := p_service_id;
2325:
2332: ,p_svcv_rec => l_svcv_rec
2333: );
2334:
2335: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2336: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2337: ELSIF x_return_status = G_RET_STS_ERROR THEN
2338: RAISE OKL_API.G_EXCEPTION_ERROR;
2339: END IF;
2340:
2334:
2335: IF x_return_status = G_RET_STS_UNEXP_ERROR THEN
2336: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2337: ELSIF x_return_status = G_RET_STS_ERROR THEN
2338: RAISE OKL_API.G_EXCEPTION_ERROR;
2339: END IF;
2340:
2341: x_return_status := G_RET_STS_SUCCESS;
2342:
2341: x_return_status := G_RET_STS_SUCCESS;
2342:
2343: EXCEPTION
2344:
2345: WHEN OKL_API.G_EXCEPTION_ERROR THEN
2346:
2347: IF p_transaction_control = G_TRUE THEN
2348: ROLLBACK TO l_program_name;
2349: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2350: END IF;
2351:
2352: x_return_status := G_RET_STS_ERROR;
2353:
2354: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2355:
2356: IF p_transaction_control = G_TRUE THEN
2357: ROLLBACK TO l_program_name;
2358: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2361: x_return_status := G_RET_STS_UNEXP_ERROR;
2362:
2363: WHEN OTHERS THEN
2364:
2365: OKL_API.SET_MESSAGE (p_app_name => G_APP_NAME,
2366: p_msg_name => G_DB_ERROR,
2367: p_token1 => G_PROG_NAME_TOKEN,
2368: p_token1_value => l_api_name,
2369: p_token2 => G_SQLCODE_TOKEN,