14: -- Rosetta, where g_miss indicates NULL and
15: -- NULL indicates missing value. Rosetta Version 1.55
16: -- End of Comments
17: -- ===============================================================
18: AMS_DEBUG_HIGH_ON boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_HIGH);
19: AMS_DEBUG_LOW_ON boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW);
20: AMS_DEBUG_MEDIUM_ON boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_MEDIUM);
21:
22: G_PKG_NAME CONSTANT VARCHAR2(30):= 'AMS_Cal_Crt_PVT';
15: -- NULL indicates missing value. Rosetta Version 1.55
16: -- End of Comments
17: -- ===============================================================
18: AMS_DEBUG_HIGH_ON boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_HIGH);
19: AMS_DEBUG_LOW_ON boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW);
20: AMS_DEBUG_MEDIUM_ON boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_MEDIUM);
21:
22: G_PKG_NAME CONSTANT VARCHAR2(30):= 'AMS_Cal_Crt_PVT';
23: G_FILE_NAME CONSTANT VARCHAR2(12) := 'amsvcctb.pls';
16: -- End of Comments
17: -- ===============================================================
18: AMS_DEBUG_HIGH_ON boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_HIGH);
19: AMS_DEBUG_LOW_ON boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW);
20: AMS_DEBUG_MEDIUM_ON boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_MEDIUM);
21:
22: G_PKG_NAME CONSTANT VARCHAR2(30):= 'AMS_Cal_Crt_PVT';
23: G_FILE_NAME CONSTANT VARCHAR2(12) := 'amsvcctb.pls';
24: -- G_USER_ID NUMBER := FND_GLOBAL.USER_ID;
103:
104: -- Initialize message list if p_init_msg_list is set to TRUE.
105: IF FND_API.to_Boolean( p_init_msg_list )
106: THEN
107: FND_MSG_PUB.initialize;
108: END IF;
109: -- Debug Message
110: IF (AMS_DEBUG_HIGH_ON) THEN
111:
211: IF (AMS_DEBUG_HIGH_ON) THEN
212: AMS_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'end');
213: END IF;
214: -- Standard call to get message count and if count is 1, get message info.
215: FND_MSG_PUB.Count_And_Get
216: (p_count => x_msg_count,
217: p_data => x_msg_data
218: );
219: EXCEPTION
223: WHEN FND_API.G_EXC_ERROR THEN
224: ROLLBACK TO CREATE_Cal_Crt_PVT;
225: x_return_status := FND_API.G_RET_STS_ERROR;
226: -- Standard call to get message count and if count=1, get the message
227: FND_MSG_PUB.Count_And_Get (
228: p_encoded => FND_API.G_FALSE,
229: p_count => x_msg_count,
230: p_data => x_msg_data
231: );
232: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
233: ROLLBACK TO CREATE_Cal_Crt_PVT;
234: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
235: -- Standard call to get message count and if count=1, get the message
236: FND_MSG_PUB.Count_And_Get (
237: p_encoded => FND_API.G_FALSE,
238: p_count => x_msg_count,
239: p_data => x_msg_data
240: );
241:
242: WHEN OTHERS THEN
243: ROLLBACK TO CREATE_Cal_Crt_PVT;
244: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
245: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
246: THEN
247: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
248: END IF;
249: -- Standard call to get message count and if count=1, get the message
243: ROLLBACK TO CREATE_Cal_Crt_PVT;
244: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
245: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
246: THEN
247: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
248: END IF;
249: -- Standard call to get message count and if count=1, get the message
250: FND_MSG_PUB.Count_And_Get (
251: p_encoded => FND_API.G_FALSE,
246: THEN
247: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
248: END IF;
249: -- Standard call to get message count and if count=1, get the message
250: FND_MSG_PUB.Count_And_Get (
251: p_encoded => FND_API.G_FALSE,
252: p_count => x_msg_count,
253: p_data => x_msg_data
254: );
325:
326: -- Initialize message list if p_init_msg_list is set to TRUE.
327: IF FND_API.to_Boolean( p_init_msg_list )
328: THEN
329: FND_MSG_PUB.initialize;
330: END IF;
331:
332: -- Debug Message
333: IF (AMS_DEBUG_HIGH_ON) THEN
353: END IF;
354: IF ( (l_tar_cal_crt_rec_rec.criteria_deleted = 'Y') AND (l_tar_cal_crt_rec_rec.criteria_enabled = 'Y') ) THEN
355: x_return_status := FND_API.g_ret_sts_error;
356: -- AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CAL_CRT_ENABLED_DELETE');
357: IF FND_MSG_PUB.check_msg_level (FND_MSG_PUB.g_msg_lvl_error) THEN
358: FND_MESSAGE.set_name ('AMS', 'AMS_CAL_CRT_ENABLED_DELETE');
359: FND_MSG_PUB.add;
360: RAISE FND_API.G_EXC_ERROR;
361: END IF;
355: x_return_status := FND_API.g_ret_sts_error;
356: -- AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CAL_CRT_ENABLED_DELETE');
357: IF FND_MSG_PUB.check_msg_level (FND_MSG_PUB.g_msg_lvl_error) THEN
358: FND_MESSAGE.set_name ('AMS', 'AMS_CAL_CRT_ENABLED_DELETE');
359: FND_MSG_PUB.add;
360: RAISE FND_API.G_EXC_ERROR;
361: END IF;
362: ELSE
363: OPEN c_get_Cal_Crt( l_tar_cal_crt_rec_rec.criteria_id);
451: IF (AMS_DEBUG_HIGH_ON) THEN
452: AMS_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'end');
453: END IF;
454: -- Standard call to get message count and if count is 1, get message info.
455: FND_MSG_PUB.Count_And_Get
456: (p_count => x_msg_count,
457: p_data => x_msg_data
458: );
459:
466: WHEN FND_API.G_EXC_ERROR THEN
467: ROLLBACK TO UPDATE_Cal_Crt_PVT;
468: x_return_status := FND_API.G_RET_STS_ERROR;
469: -- Standard call to get message count and if count=1, get the message
470: FND_MSG_PUB.Count_And_Get (
471: p_encoded => FND_API.G_FALSE,
472: p_count => x_msg_count,
473: p_data => x_msg_data
474: );
476: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
477: ROLLBACK TO UPDATE_Cal_Crt_PVT;
478: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
479: -- Standard call to get message count and if count=1, get the message
480: FND_MSG_PUB.Count_And_Get (
481: p_encoded => FND_API.G_FALSE,
482: p_count => x_msg_count,
483: p_data => x_msg_data
484: );
484: );
485: WHEN OTHERS THEN
486: ROLLBACK TO UPDATE_Cal_Crt_PVT;
487: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
488: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
489: THEN
490: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
491: END IF;
492: -- Standard call to get message count and if count=1, get the message
486: ROLLBACK TO UPDATE_Cal_Crt_PVT;
487: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
488: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
489: THEN
490: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
491: END IF;
492: -- Standard call to get message count and if count=1, get the message
493: FND_MSG_PUB.Count_And_Get (
494: p_encoded => FND_API.G_FALSE,
489: THEN
490: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
491: END IF;
492: -- Standard call to get message count and if count=1, get the message
493: FND_MSG_PUB.Count_And_Get (
494: p_encoded => FND_API.G_FALSE,
495: p_count => x_msg_count,
496: p_data => x_msg_data
497: );
559: END IF;
560: -- Initialize message list if p_init_msg_list is set to TRUE.
561: IF FND_API.to_Boolean( p_init_msg_list )
562: THEN
563: FND_MSG_PUB.initialize;
564: END IF;
565: -- Debug Message
566: IF (AMS_DEBUG_HIGH_ON) THEN
567:
595: AMS_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'end');
596: END IF;
597:
598: -- Standard call to get message count and if count is 1, get message info.
599: FND_MSG_PUB.Count_And_Get
600: (p_count => x_msg_count,
601: p_data => x_msg_data
602: );
603: EXCEPTION
607: WHEN FND_API.G_EXC_ERROR THEN
608: ROLLBACK TO DELETE_Cal_Crt_PVT;
609: x_return_status := FND_API.G_RET_STS_ERROR;
610: -- Standard call to get message count and if count=1, get the message
611: FND_MSG_PUB.Count_And_Get (
612: p_encoded => FND_API.G_FALSE,
613: p_count => x_msg_count,
614: p_data => x_msg_data
615: );
616: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
617: ROLLBACK TO DELETE_Cal_Crt_PVT;
618: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
619: -- Standard call to get message count and if count=1, get the message
620: FND_MSG_PUB.Count_And_Get (
621: p_encoded => FND_API.G_FALSE,
622: p_count => x_msg_count,
623: p_data => x_msg_data
624: );
625:
626: WHEN OTHERS THEN
627: ROLLBACK TO DELETE_Cal_Crt_PVT;
628: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
629: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
630: THEN
631: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
632: END IF;
633: -- Standard call to get message count and if count=1, get the message
627: ROLLBACK TO DELETE_Cal_Crt_PVT;
628: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
629: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
630: THEN
631: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
632: END IF;
633: -- Standard call to get message count and if count=1, get the message
634: FND_MSG_PUB.Count_And_Get (
635: p_encoded => FND_API.G_FALSE,
630: THEN
631: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
632: END IF;
633: -- Standard call to get message count and if count=1, get the message
634: FND_MSG_PUB.Count_And_Get (
635: p_encoded => FND_API.G_FALSE,
636: p_count => x_msg_count,
637: p_data => x_msg_data
638: );
702:
703: -- Initialize message list if p_init_msg_list is set to TRUE.
704: IF FND_API.to_Boolean( p_init_msg_list )
705: THEN
706: FND_MSG_PUB.initialize;
707:
708: END IF;
709: -- Standard call to check for call compatibility.
710: IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
721:
722: ------------------------ lock -------------------------
723: Ams_Cal_Crt_Pkg.Lock_Row(l_criteria_id,p_object_version);
724: -------------------- finish --------------------------
725: FND_MSG_PUB.count_and_get(
726: p_encoded => FND_API.g_false,
727: p_count => x_msg_count,
728: p_data => x_msg_data);
729: IF (AMS_DEBUG_HIGH_ON) THEN
738: WHEN FND_API.G_EXC_ERROR THEN
739: ROLLBACK TO LOCK_Cal_Crt_PVT;
740: x_return_status := FND_API.G_RET_STS_ERROR;
741: -- Standard call to get message count and if count=1, get the message
742: FND_MSG_PUB.Count_And_Get (
743: p_encoded => FND_API.G_FALSE,
744: p_count => x_msg_count,
745: p_data => x_msg_data
746: );
748: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
749: ROLLBACK TO LOCK_Cal_Crt_PVT;
750: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
751: -- Standard call to get message count and if count=1, get the message
752: FND_MSG_PUB.Count_And_Get (
753: p_encoded => FND_API.G_FALSE,
754: p_count => x_msg_count,
755: p_data => x_msg_data
756: );
757:
758: WHEN OTHERS THEN
759: ROLLBACK TO LOCK_Cal_Crt_PVT;
760: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
761: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
762: THEN
763: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
764: END IF;
765: -- Standard call to get message count and if count=1, get the message
759: ROLLBACK TO LOCK_Cal_Crt_PVT;
760: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
761: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
762: THEN
763: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
764: END IF;
765: -- Standard call to get message count and if count=1, get the message
766: FND_MSG_PUB.Count_And_Get (
767: p_encoded => FND_API.G_FALSE,
762: THEN
763: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
764: END IF;
765: -- Standard call to get message count and if count=1, get the message
766: FND_MSG_PUB.Count_And_Get (
767: p_encoded => FND_API.G_FALSE,
768: p_count => x_msg_count,
769: p_data => x_msg_data
770: );
815: x_return_status := FND_API.g_ret_sts_success;
816: ELSE
817: x_return_status := FND_API.g_ret_sts_error;
818: -- AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CAL_CRT_DUPLICATE');
819: IF FND_MSG_PUB.check_msg_level (FND_MSG_PUB.g_msg_lvl_error) THEN
820: FND_MESSAGE.set_name ('AMS', 'AMS_CAL_CRT_DUPLICATE');
821: FND_MSG_PUB.add;
822: RAISE FND_API.G_EXC_ERROR;
823: END IF;
817: x_return_status := FND_API.g_ret_sts_error;
818: -- AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CAL_CRT_DUPLICATE');
819: IF FND_MSG_PUB.check_msg_level (FND_MSG_PUB.g_msg_lvl_error) THEN
820: FND_MESSAGE.set_name ('AMS', 'AMS_CAL_CRT_DUPLICATE');
821: FND_MSG_PUB.add;
822: RAISE FND_API.G_EXC_ERROR;
823: END IF;
824: END IF;
825:
927: -- Charu: Check if the current criteria endDate > startDate
928: IF ((p_cal_crt_rec_rec.criteria_start_date IS NOT NULL) AND (p_cal_crt_rec_rec.criteria_end_date IS NOT NULL)
929: AND (p_cal_crt_rec_rec.criteria_end_date < p_cal_crt_rec_rec.criteria_start_date)) THEN
930: -- AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CAL_CRT_INVALID_DATES');
931: IF FND_MSG_PUB.check_msg_level (FND_MSG_PUB.g_msg_lvl_error) THEN
932: FND_MESSAGE.set_name ('AMS', 'AMS_CAL_CRT_INVALID_DATES');
933: FND_MSG_PUB.add;
934: RAISE FND_API.G_EXC_ERROR;
935: END IF;
929: AND (p_cal_crt_rec_rec.criteria_end_date < p_cal_crt_rec_rec.criteria_start_date)) THEN
930: -- AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CAL_CRT_INVALID_DATES');
931: IF FND_MSG_PUB.check_msg_level (FND_MSG_PUB.g_msg_lvl_error) THEN
932: FND_MESSAGE.set_name ('AMS', 'AMS_CAL_CRT_INVALID_DATES');
933: FND_MSG_PUB.add;
934: RAISE FND_API.G_EXC_ERROR;
935: END IF;
936: l_return_status := FND_API.g_ret_sts_error;
937: END IF;
1126: END IF;
1127: -- Initialize message list if p_init_msg_list is set to TRUE.
1128: IF FND_API.to_Boolean( p_init_msg_list )
1129: THEN
1130: FND_MSG_PUB.initialize;
1131: END IF;
1132: IF p_validation_level >= JTF_PLSQL_API.g_valid_level_item THEN
1133: Check_cal_crt_rec_Items(
1134: p_cal_crt_rec_rec => p_cal_crt_rec_rec,
1195: IF (AMS_DEBUG_HIGH_ON) THEN
1196: AMS_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'end');
1197: END IF;
1198: -- Standard call to get message count and if count is 1, get message info.
1199: FND_MSG_PUB.Count_And_Get
1200: (p_count => x_msg_count,
1201: p_data => x_msg_data
1202: );
1203: IF (AMS_DEBUG_HIGH_ON) THEN
1210: WHEN FND_API.G_EXC_ERROR THEN
1211: ROLLBACK TO VALIDATE_Cal_Crt_;
1212: x_return_status := FND_API.G_RET_STS_ERROR;
1213: -- Standard call to get message count and if count=1, get the message
1214: FND_MSG_PUB.Count_And_Get (
1215: p_encoded => FND_API.G_FALSE,
1216: p_count => x_msg_count,
1217: p_data => x_msg_data
1218: );
1219: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1220: ROLLBACK TO VALIDATE_Cal_Crt_;
1221: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1222: -- Standard call to get message count and if count=1, get the message
1223: FND_MSG_PUB.Count_And_Get (
1224: p_encoded => FND_API.G_FALSE,
1225: p_count => x_msg_count,
1226: p_data => x_msg_data
1227: );
1227: );
1228: WHEN OTHERS THEN
1229: ROLLBACK TO VALIDATE_Cal_Crt_;
1230: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1231: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1232: THEN
1233: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1234: END IF;
1235: -- Standard call to get message count and if count=1, get the message
1229: ROLLBACK TO VALIDATE_Cal_Crt_;
1230: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1231: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1232: THEN
1233: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1234: END IF;
1235: -- Standard call to get message count and if count=1, get the message
1236: FND_MSG_PUB.Count_And_Get (
1237: p_encoded => FND_API.G_FALSE,
1232: THEN
1233: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1234: END IF;
1235: -- Standard call to get message count and if count=1, get the message
1236: FND_MSG_PUB.Count_And_Get (
1237: p_encoded => FND_API.G_FALSE,
1238: p_count => x_msg_count,
1239: p_data => x_msg_data
1240: );
1252: BEGIN
1253: -- Initialize message list if p_init_msg_list is set to TRUE.
1254: IF FND_API.to_Boolean( p_init_msg_list )
1255: THEN
1256: FND_MSG_PUB.initialize;
1257: END IF;
1258:
1259: -- Initialize API return status to SUCCESS
1260: x_return_status := FND_API.G_RET_STS_SUCCESS;
1267: IF (AMS_DEBUG_HIGH_ON) THEN
1268: AMS_UTILITY_PVT.debug_message('Private API: Validate_dm_model_rec');
1269: END IF;
1270: -- Standard call to get message count and if count is 1, get message info.
1271: FND_MSG_PUB.Count_And_Get
1272: (p_count => x_msg_count,
1273: p_data => x_msg_data
1274: );
1275: END Validate_cal_crt_rec_Rec;