70: BEGIN
71: IF p_id IS NULL
72: THEN
73: fnd_message.set_name ('FND', 'MO_OU_REQUIRED');
74: fnd_msg_pub.ADD;
75: RAISE fnd_api.g_exc_error;
76: END IF;
77: END;
78:
129:
130: -- Initialize message list if p_init_msg_list is set to TRUE.
131: IF fnd_api.to_boolean (p_init_msg_list)
132: THEN
133: fnd_msg_pub.initialize;
134: END IF;
135:
136: -- Initialize API return status to success
137: x_return_status := fnd_api.g_ret_sts_success;
147: OR (p_comp_plan.NAME = fnd_api.g_miss_char)
148: OR (p_comp_plan.start_date IS NULL)
149: OR (p_comp_plan.start_date = fnd_api.g_miss_date)
150: THEN
151: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
152: THEN
153: fnd_message.set_name ('CN', 'CN_REQ_PAR_MISSING');
154: fnd_msg_pub.ADD;
155: END IF;
150: THEN
151: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
152: THEN
153: fnd_message.set_name ('CN', 'CN_REQ_PAR_MISSING');
154: fnd_msg_pub.ADD;
155: END IF;
156:
157: RAISE fnd_api.g_exc_error;
158: END IF;
164: WHERE NAME = p_comp_plan.NAME AND org_id = p_comp_plan.org_id AND ROWNUM = 1;
165:
166: IF l_temp_count <> 0
167: THEN
168: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
169: THEN
170: fnd_message.set_name ('CN', 'CN_INPUT_MUST_UNIQUE');
171: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('NAME', 'INPUT_TOKEN'));
172: fnd_msg_pub.ADD;
168: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
169: THEN
170: fnd_message.set_name ('CN', 'CN_INPUT_MUST_UNIQUE');
171: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('NAME', 'INPUT_TOKEN'));
172: fnd_msg_pub.ADD;
173: END IF;
174:
175: RAISE fnd_api.g_exc_error;
176: END IF;
177:
178: -- start date > end date
179: IF (p_comp_plan.end_date IS NOT NULL) AND (p_comp_plan.start_date > p_comp_plan.end_date)
180: THEN
181: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
182: THEN
183: fnd_message.set_name ('CN', 'CN_DATE_RANGE_ERROR');
184: fnd_msg_pub.ADD;
185: END IF;
180: THEN
181: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
182: THEN
183: fnd_message.set_name ('CN', 'CN_DATE_RANGE_ERROR');
184: fnd_msg_pub.ADD;
185: END IF;
186:
187: RAISE fnd_api.g_exc_error;
188: END IF;
301: COMMIT WORK;
302: END IF;
303:
304: -- Standard call to get message count and if count is 1, get message info.
305: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
306: EXCEPTION
307: WHEN fnd_api.g_exc_error
308: THEN
309: ROLLBACK TO create_comp_plan;
307: WHEN fnd_api.g_exc_error
308: THEN
309: ROLLBACK TO create_comp_plan;
310: x_return_status := fnd_api.g_ret_sts_error;
311: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
312: WHEN fnd_api.g_exc_unexpected_error
313: THEN
314: ROLLBACK TO create_comp_plan;
315: x_return_status := fnd_api.g_ret_sts_unexp_error;
312: WHEN fnd_api.g_exc_unexpected_error
313: THEN
314: ROLLBACK TO create_comp_plan;
315: x_return_status := fnd_api.g_ret_sts_unexp_error;
316: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
317: WHEN OTHERS
318: THEN
319: ROLLBACK TO create_comp_plan;
320: x_return_status := fnd_api.g_ret_sts_unexp_error;
318: THEN
319: ROLLBACK TO create_comp_plan;
320: x_return_status := fnd_api.g_ret_sts_unexp_error;
321:
322: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
323: THEN
324: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
325: END IF;
326:
320: x_return_status := fnd_api.g_ret_sts_unexp_error;
321:
322: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
323: THEN
324: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
325: END IF;
326:
327: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
328: END create_comp_plan;
323: THEN
324: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
325: END IF;
326:
327: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
328: END create_comp_plan;
329:
330: -- Start of comments
331: -- API name : Update_Comp_Plan
417:
418: -- Initialize message list if p_init_msg_list is set to TRUE.
419: IF fnd_api.to_boolean (p_init_msg_list)
420: THEN
421: fnd_msg_pub.initialize;
422: END IF;
423:
424: -- Initialize API return status to success
425: x_return_status := fnd_api.g_ret_sts_success;
429:
430: -- 1. name can not be null
431: IF (p_comp_plan.NAME IS NULL) OR (p_comp_plan.start_date IS NULL)
432: THEN
433: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
434: THEN
435: fnd_message.set_name ('CN', 'CN_REQ_PAR_MISSING');
436: fnd_msg_pub.ADD;
437: END IF;
432: THEN
433: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
434: THEN
435: fnd_message.set_name ('CN', 'CN_REQ_PAR_MISSING');
436: fnd_msg_pub.ADD;
437: END IF;
438:
439: RAISE fnd_api.g_exc_error;
440: END IF;
446: WHERE NAME = p_comp_plan.NAME AND comp_plan_id <> p_comp_plan.comp_plan_id AND org_id = p_comp_plan.org_id AND ROWNUM = 1;
447:
448: IF l_temp_count <> 0
449: THEN
450: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
451: THEN
452: fnd_message.set_name ('CN', 'CN_INPUT_MUST_UNIQUE');
453: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('NAME', 'INPUT_TOKEN'));
454: fnd_msg_pub.ADD;
450: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
451: THEN
452: fnd_message.set_name ('CN', 'CN_INPUT_MUST_UNIQUE');
453: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('NAME', 'INPUT_TOKEN'));
454: fnd_msg_pub.ADD;
455: END IF;
456:
457: RAISE fnd_api.g_exc_error;
458: END IF;
488:
489: -- start date > end date
490: IF (l_end_date IS NOT NULL) AND (l_start_date > l_end_date)
491: THEN
492: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
493: THEN
494: fnd_message.set_name ('CN', 'CN_DATE_RANGE_ERROR');
495: fnd_msg_pub.ADD;
496: END IF;
491: THEN
492: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
493: THEN
494: fnd_message.set_name ('CN', 'CN_DATE_RANGE_ERROR');
495: fnd_msg_pub.ADD;
496: END IF;
497:
498: RAISE fnd_api.g_exc_error;
499: END IF;
547: -- 3. check object version number
548: IF l_old_comp_plan.object_version_number <> p_comp_plan.object_version_number
549: THEN
550: fnd_message.set_name ('CN', 'CN_RECORD_CHANGED');
551: fnd_msg_pub.ADD;
552: RAISE fnd_api.g_exc_error;
553: END IF;
554:
555: -- 4. check for consistency in date range assignment
566: -- if end date null then cond doesn't pass, but that's okay
567: IF l_temp_count > 0
568: THEN
569: fnd_message.set_name ('CN', 'CN_PLAN_ELT_DISJOINT');
570: fnd_msg_pub.ADD;
571: RAISE fnd_api.g_exc_error;
572: END IF;
573:
574: SELECT COUNT (1)
578:
579: IF l_temp_count > 0
580: THEN
581: fnd_message.set_name ('CN', 'CN_ROLE_NOT_WITHIN_PLAN');
582: fnd_msg_pub.ADD;
583: RAISE fnd_api.g_exc_error;
584: END IF;
585:
586: -- since srp assignments always within role assignments, then we
797: COMMIT WORK;
798: END IF;
799:
800: -- Standard call to get message count and if count is 1, get message info.
801: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
802: EXCEPTION
803: WHEN fnd_api.g_exc_error
804: THEN
805: ROLLBACK TO update_comp_plan;
803: WHEN fnd_api.g_exc_error
804: THEN
805: ROLLBACK TO update_comp_plan;
806: x_return_status := fnd_api.g_ret_sts_error;
807: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
808: WHEN fnd_api.g_exc_unexpected_error
809: THEN
810: ROLLBACK TO update_comp_plan;
811: x_return_status := fnd_api.g_ret_sts_unexp_error;
808: WHEN fnd_api.g_exc_unexpected_error
809: THEN
810: ROLLBACK TO update_comp_plan;
811: x_return_status := fnd_api.g_ret_sts_unexp_error;
812: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
813: WHEN OTHERS
814: THEN
815: ROLLBACK TO update_comp_plan;
816: x_return_status := fnd_api.g_ret_sts_unexp_error;
814: THEN
815: ROLLBACK TO update_comp_plan;
816: x_return_status := fnd_api.g_ret_sts_unexp_error;
817:
818: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
819: THEN
820: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
821: END IF;
822:
816: x_return_status := fnd_api.g_ret_sts_unexp_error;
817:
818: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
819: THEN
820: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
821: END IF;
822:
823: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
824: END update_comp_plan;
819: THEN
820: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
821: END IF;
822:
823: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
824: END update_comp_plan;
825:
826: -- Start of comments
827: -- API name : Delete_Comp_Plan
876:
877: -- Initialize message list if p_init_msg_list is set to TRUE.
878: IF fnd_api.to_boolean (p_init_msg_list)
879: THEN
880: fnd_msg_pub.initialize;
881: END IF;
882:
883: -- Initialize API return status to success
884: x_return_status := fnd_api.g_ret_sts_success;
971: COMMIT WORK;
972: END IF;
973:
974: -- Standard call to get message count and if count is 1, get message info.
975: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
976: EXCEPTION
977: WHEN fnd_api.g_exc_error
978: THEN
979: ROLLBACK TO delete_comp_plan;
977: WHEN fnd_api.g_exc_error
978: THEN
979: ROLLBACK TO delete_comp_plan;
980: x_return_status := fnd_api.g_ret_sts_error;
981: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
982: WHEN fnd_api.g_exc_unexpected_error
983: THEN
984: ROLLBACK TO delete_comp_plan;
985: x_return_status := fnd_api.g_ret_sts_unexp_error;
982: WHEN fnd_api.g_exc_unexpected_error
983: THEN
984: ROLLBACK TO delete_comp_plan;
985: x_return_status := fnd_api.g_ret_sts_unexp_error;
986: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
987: WHEN OTHERS
988: THEN
989: ROLLBACK TO delete_comp_plan;
990: x_return_status := fnd_api.g_ret_sts_unexp_error;
988: THEN
989: ROLLBACK TO delete_comp_plan;
990: x_return_status := fnd_api.g_ret_sts_unexp_error;
991:
992: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
993: THEN
994: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
995: END IF;
996:
990: x_return_status := fnd_api.g_ret_sts_unexp_error;
991:
992: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
993: THEN
994: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
995: END IF;
996:
997: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
998: END delete_comp_plan;
993: THEN
994: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
995: END IF;
996:
997: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
998: END delete_comp_plan;
999:
1000: -- Start of comments
1001: -- API name : Get_Comp_Plan_Sum
1070:
1071: -- Initialize message list if p_init_msg_list is set to TRUE.
1072: IF fnd_api.to_boolean (p_init_msg_list)
1073: THEN
1074: fnd_msg_pub.initialize;
1075: END IF;
1076:
1077: -- Initialize API return status to success
1078: x_return_status := fnd_api.g_ret_sts_success;
1108: COMMIT WORK;
1109: END IF;
1110:
1111: -- Standard call to get message count and if count is 1, get message info.
1112: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1113: EXCEPTION
1114: WHEN fnd_api.g_exc_error
1115: THEN
1116: ROLLBACK TO get_comp_plan_sum;
1114: WHEN fnd_api.g_exc_error
1115: THEN
1116: ROLLBACK TO get_comp_plan_sum;
1117: x_return_status := fnd_api.g_ret_sts_error;
1118: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1119: WHEN fnd_api.g_exc_unexpected_error
1120: THEN
1121: ROLLBACK TO get_comp_plan_sum;
1122: x_return_status := fnd_api.g_ret_sts_unexp_error;
1119: WHEN fnd_api.g_exc_unexpected_error
1120: THEN
1121: ROLLBACK TO get_comp_plan_sum;
1122: x_return_status := fnd_api.g_ret_sts_unexp_error;
1123: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1124: WHEN OTHERS
1125: THEN
1126: ROLLBACK TO get_comp_plan_sum;
1127: x_return_status := fnd_api.g_ret_sts_unexp_error;
1125: THEN
1126: ROLLBACK TO get_comp_plan_sum;
1127: x_return_status := fnd_api.g_ret_sts_unexp_error;
1128:
1129: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1130: THEN
1131: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1132: END IF;
1133:
1127: x_return_status := fnd_api.g_ret_sts_unexp_error;
1128:
1129: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1130: THEN
1131: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1132: END IF;
1133:
1134: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1135: END get_comp_plan_sum;
1130: THEN
1131: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1132: END IF;
1133:
1134: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1135: END get_comp_plan_sum;
1136:
1137: -- Start of comments
1138: -- API name : Get_Comp_Plan_Dtl
1190:
1191: -- Initialize message list if p_init_msg_list is set to TRUE.
1192: IF fnd_api.to_boolean (p_init_msg_list)
1193: THEN
1194: fnd_msg_pub.initialize;
1195: END IF;
1196:
1197: -- Initialize API return status to success
1198: x_return_status := fnd_api.g_ret_sts_success;
1246: COMMIT WORK;
1247: END IF;
1248:
1249: -- Standard call to get message count and if count is 1, get message info.
1250: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1251: EXCEPTION
1252: WHEN fnd_api.g_exc_error
1253: THEN
1254: ROLLBACK TO get_comp_plan_dtl;
1252: WHEN fnd_api.g_exc_error
1253: THEN
1254: ROLLBACK TO get_comp_plan_dtl;
1255: x_return_status := fnd_api.g_ret_sts_error;
1256: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1257: WHEN fnd_api.g_exc_unexpected_error
1258: THEN
1259: ROLLBACK TO get_comp_plan_dtl;
1260: x_return_status := fnd_api.g_ret_sts_unexp_error;
1257: WHEN fnd_api.g_exc_unexpected_error
1258: THEN
1259: ROLLBACK TO get_comp_plan_dtl;
1260: x_return_status := fnd_api.g_ret_sts_unexp_error;
1261: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1262: WHEN OTHERS
1263: THEN
1264: ROLLBACK TO get_comp_plan_dtl;
1265: x_return_status := fnd_api.g_ret_sts_unexp_error;
1263: THEN
1264: ROLLBACK TO get_comp_plan_dtl;
1265: x_return_status := fnd_api.g_ret_sts_unexp_error;
1266:
1267: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1268: THEN
1269: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1270: END IF;
1271:
1265: x_return_status := fnd_api.g_ret_sts_unexp_error;
1266:
1267: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1268: THEN
1269: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1270: END IF;
1271:
1272: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1273: END get_comp_plan_dtl;
1268: THEN
1269: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1270: END IF;
1271:
1272: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1273: END get_comp_plan_dtl;
1274:
1275: -- Start of comments
1276: -- API name : Get_Sales_Role
1335:
1336: -- Initialize message list if p_init_msg_list is set to TRUE.
1337: IF fnd_api.to_boolean (p_init_msg_list)
1338: THEN
1339: fnd_msg_pub.initialize;
1340: END IF;
1341:
1342: -- Initialize API return status to success
1343: x_return_status := fnd_api.g_ret_sts_success;
1363: COMMIT WORK;
1364: END IF;
1365:
1366: -- Standard call to get message count and if count is 1, get message info.
1367: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1368: EXCEPTION
1369: WHEN fnd_api.g_exc_error
1370: THEN
1371: ROLLBACK TO get_sales_role;
1369: WHEN fnd_api.g_exc_error
1370: THEN
1371: ROLLBACK TO get_sales_role;
1372: x_return_status := fnd_api.g_ret_sts_error;
1373: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1374: WHEN fnd_api.g_exc_unexpected_error
1375: THEN
1376: ROLLBACK TO get_sales_role;
1377: x_return_status := fnd_api.g_ret_sts_unexp_error;
1374: WHEN fnd_api.g_exc_unexpected_error
1375: THEN
1376: ROLLBACK TO get_sales_role;
1377: x_return_status := fnd_api.g_ret_sts_unexp_error;
1378: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1379: WHEN OTHERS
1380: THEN
1381: ROLLBACK TO get_sales_role;
1382: x_return_status := fnd_api.g_ret_sts_unexp_error;
1380: THEN
1381: ROLLBACK TO get_sales_role;
1382: x_return_status := fnd_api.g_ret_sts_unexp_error;
1383:
1384: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1385: THEN
1386: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1387: END IF;
1388:
1382: x_return_status := fnd_api.g_ret_sts_unexp_error;
1383:
1384: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1385: THEN
1386: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1387: END IF;
1388:
1389: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1390: END get_sales_role;
1385: THEN
1386: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1387: END IF;
1388:
1389: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1390: END get_sales_role;
1391:
1392: -- Start of comments
1393: -- API name : Validate_Comp_Plan
1461:
1462: -- Initialize message list if p_init_msg_list is set to TRUE.
1463: IF fnd_api.to_boolean (p_init_msg_list)
1464: THEN
1465: fnd_msg_pub.initialize;
1466: END IF;
1467:
1468: -- Initialize API return status to success
1469: x_return_status := fnd_api.g_ret_sts_success;
1479: WHERE comp_plan_id = p_comp_plan.comp_plan_id AND ROWNUM = 1;
1480:
1481: IF l_temp_count = 0
1482: THEN
1483: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1484: THEN
1485: fnd_message.set_name ('CN', 'CN_NO_PE_ASSIGNED');
1486: fnd_msg_pub.ADD;
1487: END IF;
1482: THEN
1483: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1484: THEN
1485: fnd_message.set_name ('CN', 'CN_NO_PE_ASSIGNED');
1486: fnd_msg_pub.ADD;
1487: END IF;
1488:
1489: RAISE fnd_api.g_exc_error;
1490: END IF;
1501: END LOOP;
1502:
1503: IF l_incomp_forms IS NOT NULL
1504: THEN
1505: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1506: THEN
1507: fnd_message.set_name ('CN', 'CN_INCOMP_FORMULA');
1508: fnd_message.set_token ('FORMULA_NAME', l_incomp_forms);
1509: fnd_msg_pub.ADD;
1505: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1506: THEN
1507: fnd_message.set_name ('CN', 'CN_INCOMP_FORMULA');
1508: fnd_message.set_token ('FORMULA_NAME', l_incomp_forms);
1509: fnd_msg_pub.ADD;
1510: END IF;
1511:
1512: RAISE fnd_api.g_exc_error;
1513: END IF;
1560: COMMIT WORK;
1561: END IF;
1562:
1563: -- Standard call to get message count and if count is 1, get message info.
1564: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1565: EXCEPTION
1566: WHEN fnd_api.g_exc_error
1567: THEN
1568: ROLLBACK TO validate_comp_plan;
1566: WHEN fnd_api.g_exc_error
1567: THEN
1568: ROLLBACK TO validate_comp_plan;
1569: x_return_status := fnd_api.g_ret_sts_error;
1570: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1571: WHEN fnd_api.g_exc_unexpected_error
1572: THEN
1573: ROLLBACK TO validate_comp_plan;
1574: x_return_status := fnd_api.g_ret_sts_unexp_error;
1571: WHEN fnd_api.g_exc_unexpected_error
1572: THEN
1573: ROLLBACK TO validate_comp_plan;
1574: x_return_status := fnd_api.g_ret_sts_unexp_error;
1575: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1576: WHEN OTHERS
1577: THEN
1578: ROLLBACK TO validate_comp_plan;
1579: x_return_status := fnd_api.g_ret_sts_unexp_error;
1577: THEN
1578: ROLLBACK TO validate_comp_plan;
1579: x_return_status := fnd_api.g_ret_sts_unexp_error;
1580:
1581: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1582: THEN
1583: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1584: END IF;
1585:
1579: x_return_status := fnd_api.g_ret_sts_unexp_error;
1580:
1581: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1582: THEN
1583: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1584: END IF;
1585:
1586: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1587: END validate_comp_plan;
1582: THEN
1583: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1584: END IF;
1585:
1586: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1587: END validate_comp_plan;
1588:
1589: --| -----------------------------------------------------------------------=
1590: --| Procedure Name : check_revenue_class_overlap
1680: WHERE comp_plan_id = p_comp_plan_id;
1681: EXCEPTION
1682: WHEN NO_DATA_FOUND
1683: THEN
1684: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1685: THEN
1686: fnd_message.set_name ('CN', 'CN_CP_NOT_EXIST');
1687: fnd_msg_pub.ADD;
1688: END IF;
1683: THEN
1684: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1685: THEN
1686: fnd_message.set_name ('CN', 'CN_CP_NOT_EXIST');
1687: fnd_msg_pub.ADD;
1688: END IF;
1689:
1690: x_loading_status := 'CN_CP_NOT_EXIST';
1691: x_return_status := fnd_api.g_ret_sts_error;
1707:
1708: IF (result = false)
1709: THEN
1710:
1711: /* IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1712: THEN
1713: fnd_message.set_name ('CN', 'PLN_PLAN_DUP_REV_CLASS');
1714: fnd_message.set_token ('PLAN_NAME', l_comp_plan_name);
1715: fnd_msg_pub.ADD;
1711: /* IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1712: THEN
1713: fnd_message.set_name ('CN', 'PLN_PLAN_DUP_REV_CLASS');
1714: fnd_message.set_token ('PLAN_NAME', l_comp_plan_name);
1715: fnd_msg_pub.ADD;
1716: END IF; */
1717:
1718: x_loading_status := 'PLN_PLAN_DUP_REV_CLASS';
1719: x_return_status := fnd_api.g_ret_sts_error;
1831: -- Initialize message list if p_init_msg_list is set to TRUE.
1832:
1833: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1834:
1835: FND_MSG_PUB.initialize;
1836:
1837: END IF;
1838:
1839: -- Initialize API return status to success
1950: END IF;
1951:
1952: -- Standard call to get message count and if count is 1, get message info.
1953:
1954: FND_MSG_PUB.Count_And_Get
1955: (p_count => x_msg_count ,
1956: p_data => x_msg_data ,
1957: p_encoded => FND_API.G_FALSE );
1958:
1960:
1961: WHEN FND_API.G_EXC_ERROR THEN
1962: ROLLBACK TO duplicate_comp_plan;
1963: x_return_status := FND_API.G_RET_STS_ERROR ;
1964: FND_MSG_PUB.count_and_get
1965: (p_count => x_msg_count ,
1966: p_data => x_msg_data ,
1967: p_encoded => FND_API.G_FALSE );
1968:
1968:
1969: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1970: ROLLBACK TO duplicate_comp_plan;
1971: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1972: FND_MSG_PUB.count_and_get
1973: (p_count => x_msg_count ,
1974: p_data => x_msg_data ,
1975: p_encoded => FND_API.G_FALSE );
1976:
1976:
1977: WHEN OTHERS THEN
1978: ROLLBACK TO duplicate_comp_plan;
1979: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1980: IF FND_MSG_PUB.check_msg_level
1981: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1982: THEN
1983: FND_MSG_PUB.add_exc_msg
1984: (G_PKG_NAME ,
1977: WHEN OTHERS THEN
1978: ROLLBACK TO duplicate_comp_plan;
1979: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1980: IF FND_MSG_PUB.check_msg_level
1981: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1982: THEN
1983: FND_MSG_PUB.add_exc_msg
1984: (G_PKG_NAME ,
1985: l_api_name );
1979: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1980: IF FND_MSG_PUB.check_msg_level
1981: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1982: THEN
1983: FND_MSG_PUB.add_exc_msg
1984: (G_PKG_NAME ,
1985: l_api_name );
1986: END IF;
1987:
1984: (G_PKG_NAME ,
1985: l_api_name );
1986: END IF;
1987:
1988: FND_MSG_PUB.count_and_get
1989: (p_count => x_msg_count ,
1990: p_data => x_msg_data ,
1991: p_encoded => FND_API.G_FALSE );
1992: