32: AMS_DEBUG_MEDIUM_ON boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_MEDIUM);
33:
34: PROCEDURE Create_Performance(
35: p_api_version_number IN NUMBER,
36: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
37: p_commit IN VARCHAR2 := FND_API.G_FALSE,
38: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
39:
40: x_return_status OUT NOCOPY VARCHAR2,
33:
34: PROCEDURE Create_Performance(
35: p_api_version_number IN NUMBER,
36: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
37: p_commit IN VARCHAR2 := FND_API.G_FALSE,
38: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
39:
40: x_return_status OUT NOCOPY VARCHAR2,
41: x_msg_count OUT NOCOPY NUMBER,
34: PROCEDURE Create_Performance(
35: p_api_version_number IN NUMBER,
36: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
37: p_commit IN VARCHAR2 := FND_API.G_FALSE,
38: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
39:
40: x_return_status OUT NOCOPY VARCHAR2,
41: x_msg_count OUT NOCOPY NUMBER,
42: x_msg_data OUT NOCOPY VARCHAR2,
48: L_API_NAME CONSTANT VARCHAR2(30) := 'Create_Performance';
49: L_API_VERSION_NUMBER CONSTANT NUMBER := 1.0;
50: l_return_status_full VARCHAR2(1);
51: l_object_version_number NUMBER := 1;
52: l_org_id NUMBER := FND_API.G_MISS_NUM;
53: l_PERFORMANCE_ID NUMBER;
54: l_dummy NUMBER;
55:
56: CURSOR c_id IS
66: -- Standard Start of API savepoint
67: SAVEPOINT Create_Performance_PVT;
68:
69: -- Standard call to check for call compatibility.
70: IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
71: p_api_version_number,
72: l_api_name,
73: G_PKG_NAME)
74: THEN
71: p_api_version_number,
72: l_api_name,
73: G_PKG_NAME)
74: THEN
75: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
76: END IF;
77:
78: -- Initialize message list if p_init_msg_list is set to TRUE.
79: IF FND_API.to_Boolean( p_init_msg_list )
75: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
76: END IF;
77:
78: -- Initialize message list if p_init_msg_list is set to TRUE.
79: IF FND_API.to_Boolean( p_init_msg_list )
80: THEN
81: FND_MSG_PUB.initialize;
82: END IF;
83:
88: END IF;
89:
90:
91: -- Initialize API return status to SUCCESS
92: x_return_status := FND_API.G_RET_STS_SUCCESS;
93:
94: -- Local variable initialization
95:
96: IF p_performance_rec.PERFORMANCE_ID IS NULL OR p_performance_rec.PERFORMANCE_ID = FND_API.g_miss_num THEN
92: x_return_status := FND_API.G_RET_STS_SUCCESS;
93:
94: -- Local variable initialization
95:
96: IF p_performance_rec.PERFORMANCE_ID IS NULL OR p_performance_rec.PERFORMANCE_ID = FND_API.g_miss_num THEN
97: LOOP
98: l_dummy := NULL;
99: OPEN c_id;
100: FETCH c_id INTO l_PERFORMANCE_ID;
110: -- =========================================================================
111: -- Validate
112: -- =========================================================================
113:
114: IF ( P_validation_level >= FND_API.G_VALID_LEVEL_FULL)
115: THEN
116: -- Debug message
117: IF (AMS_DEBUG_HIGH_ON) THEN
118:
121:
122: -- Invoke validation procedures
123: Validate_Performance(
124: p_api_version_number => 1.0,
125: p_init_msg_list => FND_API.G_FALSE,
126: p_validation_level => p_validation_level,
127: p_validation_mode => JTF_PLSQL_API.g_create,
128: p_performance_rec => p_performance_rec,
129: x_return_status => x_return_status,
130: x_msg_count => x_msg_count,
131: x_msg_data => x_msg_data);
132: END IF;
133:
134: IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
135: RAISE FND_API.G_EXC_ERROR;
136: END IF;
137:
138:
131: x_msg_data => x_msg_data);
132: END IF;
133:
134: IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
135: RAISE FND_API.G_EXC_ERROR;
136: END IF;
137:
138:
139: -- Debug Message
155: p_actual_value => p_performance_rec.actual_value,
156: p_evaluated_records => p_performance_rec.evaluated_records,
157: p_total_records_predicted => p_performance_rec.total_records_predicted,
158: p_model_id => p_performance_rec.model_id);
159: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
160: RAISE FND_API.G_EXC_ERROR;
161: END IF;
162:
163: x_performance_id := l_performance_id;
156: p_evaluated_records => p_performance_rec.evaluated_records,
157: p_total_records_predicted => p_performance_rec.total_records_predicted,
158: p_model_id => p_performance_rec.model_id);
159: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
160: RAISE FND_API.G_EXC_ERROR;
161: END IF;
162:
163: x_performance_id := l_performance_id;
164: --
165: -- End of API body
166: --
167:
168: -- Standard check for p_commit
169: IF FND_API.to_Boolean( p_commit )
170: THEN
171: COMMIT WORK;
172: END IF;
173:
185: );
186: EXCEPTION
187:
188: WHEN AMS_Utility_PVT.resource_locked THEN
189: x_return_status := FND_API.g_ret_sts_error;
190: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
191: FND_MESSAGE.set_name('AMS', 'AMS_API_RESOURCE_LOCKED');
192: FND_MSG_PUB.add;
193: END IF;
191: FND_MESSAGE.set_name('AMS', 'AMS_API_RESOURCE_LOCKED');
192: FND_MSG_PUB.add;
193: END IF;
194:
195: WHEN FND_API.G_EXC_ERROR THEN
196: ROLLBACK TO Create_Performance_PVT;
197: x_return_status := FND_API.G_RET_STS_ERROR;
198: -- Standard call to get message count and if count=1, get the message
199: FND_MSG_PUB.Count_And_Get (
193: END IF;
194:
195: WHEN FND_API.G_EXC_ERROR THEN
196: ROLLBACK TO Create_Performance_PVT;
197: x_return_status := FND_API.G_RET_STS_ERROR;
198: -- Standard call to get message count and if count=1, get the message
199: FND_MSG_PUB.Count_And_Get (
200: p_encoded => FND_API.G_FALSE,
201: p_count => x_msg_count,
196: ROLLBACK TO Create_Performance_PVT;
197: x_return_status := FND_API.G_RET_STS_ERROR;
198: -- Standard call to get message count and if count=1, get the message
199: FND_MSG_PUB.Count_And_Get (
200: p_encoded => FND_API.G_FALSE,
201: p_count => x_msg_count,
202: p_data => x_msg_data
203: );
204:
201: p_count => x_msg_count,
202: p_data => x_msg_data
203: );
204:
205: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
206: ROLLBACK TO Create_Performance_PVT;
207: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
208: -- Standard call to get message count and if count=1, get the message
209: FND_MSG_PUB.Count_And_Get (
203: );
204:
205: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
206: ROLLBACK TO Create_Performance_PVT;
207: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
208: -- Standard call to get message count and if count=1, get the message
209: FND_MSG_PUB.Count_And_Get (
210: p_encoded => FND_API.G_FALSE,
211: p_count => x_msg_count,
206: ROLLBACK TO Create_Performance_PVT;
207: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
208: -- Standard call to get message count and if count=1, get the message
209: FND_MSG_PUB.Count_And_Get (
210: p_encoded => FND_API.G_FALSE,
211: p_count => x_msg_count,
212: p_data => x_msg_data
213: );
214:
213: );
214:
215: WHEN OTHERS THEN
216: ROLLBACK TO Create_Performance_PVT;
217: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
218: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
219: THEN
220: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
221: END IF;
220: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
221: END IF;
222: -- Standard call to get message count and if count=1, get the message
223: FND_MSG_PUB.Count_And_Get (
224: p_encoded => FND_API.G_FALSE,
225: p_count => x_msg_count,
226: p_data => x_msg_data
227: );
228: End Create_Performance;
229:
230:
231: PROCEDURE Update_Performance(
232: p_api_version_number IN NUMBER,
233: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
234: p_commit IN VARCHAR2 := FND_API.G_FALSE,
235: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
236:
237: x_return_status OUT NOCOPY VARCHAR2,
230:
231: PROCEDURE Update_Performance(
232: p_api_version_number IN NUMBER,
233: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
234: p_commit IN VARCHAR2 := FND_API.G_FALSE,
235: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
236:
237: x_return_status OUT NOCOPY VARCHAR2,
238: x_msg_count OUT NOCOPY NUMBER,
231: PROCEDURE Update_Performance(
232: p_api_version_number IN NUMBER,
233: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
234: p_commit IN VARCHAR2 := FND_API.G_FALSE,
235: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
236:
237: x_return_status OUT NOCOPY VARCHAR2,
238: x_msg_count OUT NOCOPY NUMBER,
239: x_msg_data OUT NOCOPY VARCHAR2,
259: -- Standard Start of API savepoint
260: SAVEPOINT Update_Performance_PVT;
261:
262: -- Standard call to check for call compatibility.
263: IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
264: p_api_version_number,
265: l_api_name,
266: G_PKG_NAME)
267: THEN
264: p_api_version_number,
265: l_api_name,
266: G_PKG_NAME)
267: THEN
268: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
269: END IF;
270:
271: -- Initialize message list if p_init_msg_list is set to TRUE.
272: IF FND_API.to_Boolean( p_init_msg_list )
268: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
269: END IF;
270:
271: -- Initialize message list if p_init_msg_list is set to TRUE.
272: IF FND_API.to_Boolean( p_init_msg_list )
273: THEN
274: FND_MSG_PUB.initialize;
275: END IF;
276:
281: END IF;
282:
283:
284: -- Initialize API return status to SUCCESS
285: x_return_status := FND_API.G_RET_STS_SUCCESS;
286:
287: -- Debug Message
288: IF (AMS_DEBUG_HIGH_ON) THEN
289:
300: FND_MESSAGE.Set_Name('AMS', 'API_MISSING_UPDATE_TARGET');
301: FND_MESSAGE.Set_Token ('INFO', 'Dmperformance', FALSE);
302: FND_MSG_PUB.Add;
303: END IF;
304: RAISE FND_API.G_EXC_ERROR;
305: END IF;
306: -- Debug Message
307: IF (AMS_DEBUG_HIGH_ON) THEN
308:
317: FND_MESSAGE.Set_Name('AMS', 'API_RECORD_CHANGED');
318: FND_MESSAGE.Set_Token('INFO', 'Dmperformance', FALSE);
319: FND_MSG_PUB.ADD;
320: END IF;
321: raise FND_API.G_EXC_ERROR;
322: End if;
323: IF ( P_validation_level >= FND_API.G_VALID_LEVEL_FULL)
324: THEN
325: -- Debug message
319: FND_MSG_PUB.ADD;
320: END IF;
321: raise FND_API.G_EXC_ERROR;
322: End if;
323: IF ( P_validation_level >= FND_API.G_VALID_LEVEL_FULL)
324: THEN
325: -- Debug message
326: IF (AMS_DEBUG_HIGH_ON) THEN
327:
330:
331: -- Invoke validation procedures
332: Validate_Performance(
333: p_api_version_number => 1.0,
334: p_init_msg_list => FND_API.G_FALSE,
335: p_validation_level => p_validation_level,
336: p_validation_mode => JTF_PLSQL_API.g_update,
337: p_performance_rec => p_performance_rec,
338: x_return_status => x_return_status,
339: x_msg_count => x_msg_count,
340: x_msg_data => x_msg_data);
341: END IF;
342:
343: IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
344: RAISE FND_API.G_EXC_ERROR;
345: END IF;
346:
347:
340: x_msg_data => x_msg_data);
341: END IF;
342:
343: IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
344: RAISE FND_API.G_EXC_ERROR;
345: END IF;
346:
347:
348: -- Debug Message
371: -- End of API body.
372: --
373:
374: -- Standard check for p_commit
375: IF FND_API.to_Boolean( p_commit )
376: THEN
377: COMMIT WORK;
378: END IF;
379:
391: );
392: EXCEPTION
393:
394: WHEN AMS_Utility_PVT.resource_locked THEN
395: x_return_status := FND_API.g_ret_sts_error;
396: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
397: FND_MESSAGE.set_name('AMS', 'AMS_API_RESOURCE_LOCKED');
398: FND_MSG_PUB.add;
399: END IF;
397: FND_MESSAGE.set_name('AMS', 'AMS_API_RESOURCE_LOCKED');
398: FND_MSG_PUB.add;
399: END IF;
400:
401: WHEN FND_API.G_EXC_ERROR THEN
402: ROLLBACK TO Update_Performance_PVT;
403: x_return_status := FND_API.G_RET_STS_ERROR;
404: -- Standard call to get message count and if count=1, get the message
405: FND_MSG_PUB.Count_And_Get (
399: END IF;
400:
401: WHEN FND_API.G_EXC_ERROR THEN
402: ROLLBACK TO Update_Performance_PVT;
403: x_return_status := FND_API.G_RET_STS_ERROR;
404: -- Standard call to get message count and if count=1, get the message
405: FND_MSG_PUB.Count_And_Get (
406: p_encoded => FND_API.G_FALSE,
407: p_count => x_msg_count,
402: ROLLBACK TO Update_Performance_PVT;
403: x_return_status := FND_API.G_RET_STS_ERROR;
404: -- Standard call to get message count and if count=1, get the message
405: FND_MSG_PUB.Count_And_Get (
406: p_encoded => FND_API.G_FALSE,
407: p_count => x_msg_count,
408: p_data => x_msg_data
409: );
410:
407: p_count => x_msg_count,
408: p_data => x_msg_data
409: );
410:
411: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
412: ROLLBACK TO Update_Performance_PVT;
413: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
414: -- Standard call to get message count and if count=1, get the message
415: FND_MSG_PUB.Count_And_Get (
409: );
410:
411: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
412: ROLLBACK TO Update_Performance_PVT;
413: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
414: -- Standard call to get message count and if count=1, get the message
415: FND_MSG_PUB.Count_And_Get (
416: p_encoded => FND_API.G_FALSE,
417: p_count => x_msg_count,
412: ROLLBACK TO Update_Performance_PVT;
413: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
414: -- Standard call to get message count and if count=1, get the message
415: FND_MSG_PUB.Count_And_Get (
416: p_encoded => FND_API.G_FALSE,
417: p_count => x_msg_count,
418: p_data => x_msg_data
419: );
420:
419: );
420:
421: WHEN OTHERS THEN
422: ROLLBACK TO Update_Performance_PVT;
423: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
424: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
425: THEN
426: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
427: END IF;
426: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
427: END IF;
428: -- Standard call to get message count and if count=1, get the message
429: FND_MSG_PUB.Count_And_Get (
430: p_encoded => FND_API.G_FALSE,
431: p_count => x_msg_count,
432: p_data => x_msg_data
433: );
434: End Update_Performance;
435:
436:
437: PROCEDURE Delete_Performance(
438: p_api_version_number IN NUMBER,
439: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
440: p_commit IN VARCHAR2 := FND_API.G_FALSE,
441: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
442: x_return_status OUT NOCOPY VARCHAR2,
443: x_msg_count OUT NOCOPY NUMBER,
436:
437: PROCEDURE Delete_Performance(
438: p_api_version_number IN NUMBER,
439: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
440: p_commit IN VARCHAR2 := FND_API.G_FALSE,
441: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
442: x_return_status OUT NOCOPY VARCHAR2,
443: x_msg_count OUT NOCOPY NUMBER,
444: x_msg_data OUT NOCOPY VARCHAR2,
437: PROCEDURE Delete_Performance(
438: p_api_version_number IN NUMBER,
439: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
440: p_commit IN VARCHAR2 := FND_API.G_FALSE,
441: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
442: x_return_status OUT NOCOPY VARCHAR2,
443: x_msg_count OUT NOCOPY NUMBER,
444: x_msg_data OUT NOCOPY VARCHAR2,
445: p_performance_id IN NUMBER,
455: -- Standard Start of API savepoint
456: SAVEPOINT Delete_Performance_PVT;
457:
458: -- Standard call to check for call compatibility.
459: IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
460: p_api_version_number,
461: l_api_name,
462: G_PKG_NAME)
463: THEN
460: p_api_version_number,
461: l_api_name,
462: G_PKG_NAME)
463: THEN
464: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
465: END IF;
466:
467: -- Initialize message list if p_init_msg_list is set to TRUE.
468: IF FND_API.to_Boolean( p_init_msg_list )
464: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
465: END IF;
466:
467: -- Initialize message list if p_init_msg_list is set to TRUE.
468: IF FND_API.to_Boolean( p_init_msg_list )
469: THEN
470: FND_MSG_PUB.initialize;
471: END IF;
472:
477: END IF;
478:
479:
480: -- Initialize API return status to SUCCESS
481: x_return_status := FND_API.G_RET_STS_SUCCESS;
482:
483: --
484: -- Api body
485: --
496: -- End of API body
497: --
498:
499: -- Standard check for p_commit
500: IF FND_API.to_Boolean( p_commit )
501: THEN
502: COMMIT WORK;
503: END IF;
504:
516: );
517: EXCEPTION
518:
519: WHEN AMS_Utility_PVT.resource_locked THEN
520: x_return_status := FND_API.g_ret_sts_error;
521: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
522: FND_MESSAGE.set_name('AMS', 'AMS_API_RESOURCE_LOCKED');
523: FND_MSG_PUB.add;
524: END IF;
522: FND_MESSAGE.set_name('AMS', 'AMS_API_RESOURCE_LOCKED');
523: FND_MSG_PUB.add;
524: END IF;
525:
526: WHEN FND_API.G_EXC_ERROR THEN
527: ROLLBACK TO Delete_Performance_PVT;
528: x_return_status := FND_API.G_RET_STS_ERROR;
529: -- Standard call to get message count and if count=1, get the message
530: FND_MSG_PUB.Count_And_Get (
524: END IF;
525:
526: WHEN FND_API.G_EXC_ERROR THEN
527: ROLLBACK TO Delete_Performance_PVT;
528: x_return_status := FND_API.G_RET_STS_ERROR;
529: -- Standard call to get message count and if count=1, get the message
530: FND_MSG_PUB.Count_And_Get (
531: p_encoded => FND_API.G_FALSE,
532: p_count => x_msg_count,
527: ROLLBACK TO Delete_Performance_PVT;
528: x_return_status := FND_API.G_RET_STS_ERROR;
529: -- Standard call to get message count and if count=1, get the message
530: FND_MSG_PUB.Count_And_Get (
531: p_encoded => FND_API.G_FALSE,
532: p_count => x_msg_count,
533: p_data => x_msg_data
534: );
535:
532: p_count => x_msg_count,
533: p_data => x_msg_data
534: );
535:
536: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
537: ROLLBACK TO Delete_Performance_PVT;
538: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
539: -- Standard call to get message count and if count=1, get the message
540: FND_MSG_PUB.Count_And_Get (
534: );
535:
536: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
537: ROLLBACK TO Delete_Performance_PVT;
538: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
539: -- Standard call to get message count and if count=1, get the message
540: FND_MSG_PUB.Count_And_Get (
541: p_encoded => FND_API.G_FALSE,
542: p_count => x_msg_count,
537: ROLLBACK TO Delete_Performance_PVT;
538: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
539: -- Standard call to get message count and if count=1, get the message
540: FND_MSG_PUB.Count_And_Get (
541: p_encoded => FND_API.G_FALSE,
542: p_count => x_msg_count,
543: p_data => x_msg_data
544: );
545:
544: );
545:
546: WHEN OTHERS THEN
547: ROLLBACK TO Delete_Performance_PVT;
548: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
549: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
550: THEN
551: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
552: END IF;
551: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
552: END IF;
553: -- Standard call to get message count and if count=1, get the message
554: FND_MSG_PUB.Count_And_Get (
555: p_encoded => FND_API.G_FALSE,
556: p_count => x_msg_count,
557: p_data => x_msg_data
558: );
559: End Delete_Performance;
562:
563: -- Hint: Primary key needs to be returned.
564: PROCEDURE Lock_Performance(
565: p_api_version_number IN NUMBER,
566: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
567:
568: x_return_status OUT NOCOPY VARCHAR2,
569: x_msg_count OUT NOCOPY NUMBER,
570: x_msg_data OUT NOCOPY VARCHAR2,
594: AMS_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'start');
595: END IF;
596:
597: -- Initialize message list if p_init_msg_list is set to TRUE.
598: IF FND_API.to_Boolean( p_init_msg_list )
599: THEN
600: FND_MSG_PUB.initialize;
601: END IF;
602:
600: FND_MSG_PUB.initialize;
601: END IF;
602:
603: -- Standard call to check for call compatibility.
604: IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
605: p_api_version_number,
606: l_api_name,
607: G_PKG_NAME)
608: THEN
605: p_api_version_number,
606: l_api_name,
607: G_PKG_NAME)
608: THEN
609: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
610: END IF;
611:
612:
613: -- Initialize API return status to SUCCESS
610: END IF;
611:
612:
613: -- Initialize API return status to SUCCESS
614: x_return_status := FND_API.G_RET_STS_SUCCESS;
615:
616:
617: ------------------------ lock -------------------------
618:
632: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
633: FND_MESSAGE.set_name('AMS', 'AMS_API_RECORD_NOT_FOUND');
634: FND_MSG_PUB.add;
635: END IF;
636: RAISE FND_API.g_exc_error;
637: END IF;
638:
639: CLOSE c_Dmperformance;
640:
639: CLOSE c_Dmperformance;
640:
641: -------------------- finish --------------------------
642: FND_MSG_PUB.count_and_get(
643: p_encoded => FND_API.g_false,
644: p_count => x_msg_count,
645: p_data => x_msg_data);
646: IF (AMS_DEBUG_HIGH_ON) THEN
647:
649: END IF;
650: EXCEPTION
651:
652: WHEN AMS_Utility_PVT.resource_locked THEN
653: x_return_status := FND_API.g_ret_sts_error;
654: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
655: FND_MESSAGE.set_name('AMS', 'AMS_API_RESOURCE_LOCKED');
656: FND_MSG_PUB.add;
657: END IF;
655: FND_MESSAGE.set_name('AMS', 'AMS_API_RESOURCE_LOCKED');
656: FND_MSG_PUB.add;
657: END IF;
658:
659: WHEN FND_API.G_EXC_ERROR THEN
660: ROLLBACK TO Lock_Performance_PVT;
661: x_return_status := FND_API.G_RET_STS_ERROR;
662: -- Standard call to get message count and if count=1, get the message
663: FND_MSG_PUB.Count_And_Get (
657: END IF;
658:
659: WHEN FND_API.G_EXC_ERROR THEN
660: ROLLBACK TO Lock_Performance_PVT;
661: x_return_status := FND_API.G_RET_STS_ERROR;
662: -- Standard call to get message count and if count=1, get the message
663: FND_MSG_PUB.Count_And_Get (
664: p_encoded => FND_API.G_FALSE,
665: p_count => x_msg_count,
660: ROLLBACK TO Lock_Performance_PVT;
661: x_return_status := FND_API.G_RET_STS_ERROR;
662: -- Standard call to get message count and if count=1, get the message
663: FND_MSG_PUB.Count_And_Get (
664: p_encoded => FND_API.G_FALSE,
665: p_count => x_msg_count,
666: p_data => x_msg_data
667: );
668:
665: p_count => x_msg_count,
666: p_data => x_msg_data
667: );
668:
669: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
670: ROLLBACK TO Lock_Performance_PVT;
671: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
672: -- Standard call to get message count and if count=1, get the message
673: FND_MSG_PUB.Count_And_Get (
667: );
668:
669: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
670: ROLLBACK TO Lock_Performance_PVT;
671: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
672: -- Standard call to get message count and if count=1, get the message
673: FND_MSG_PUB.Count_And_Get (
674: p_encoded => FND_API.G_FALSE,
675: p_count => x_msg_count,
670: ROLLBACK TO Lock_Performance_PVT;
671: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
672: -- Standard call to get message count and if count=1, get the message
673: FND_MSG_PUB.Count_And_Get (
674: p_encoded => FND_API.G_FALSE,
675: p_count => x_msg_count,
676: p_data => x_msg_data
677: );
678:
677: );
678:
679: WHEN OTHERS THEN
680: ROLLBACK TO Lock_Performance_PVT;
681: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
682: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
683: THEN
684: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
685: END IF;
684: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
685: END IF;
686: -- Standard call to get message count and if count=1, get the message
687: FND_MSG_PUB.Count_And_Get (
688: p_encoded => FND_API.G_FALSE,
689: p_count => x_msg_count,
690: p_data => x_msg_data
691: );
692: End Lock_Performance;
699: IS
700: l_valid_flag VARCHAR2(1);
701:
702: BEGIN
703: x_return_status := FND_API.g_ret_sts_success;
704: IF p_validation_mode = JTF_PLSQL_API.g_create THEN
705: l_valid_flag := AMS_Utility_PVT.check_uniqueness(
706: 'AMS_DM_PERFORMANCE',
707: 'PERFORMANCE_ID = ''' || p_performance_rec.PERFORMANCE_ID ||''''
713: ''' AND PERFORMANCE_ID <> ' || p_performance_rec.PERFORMANCE_ID
714: );
715: END IF;
716:
717: IF l_valid_flag = FND_API.g_false THEN
718: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error)
719: THEN
720: FND_MESSAGE.set_name('AMS', 'AMS_PERFORMANCE_ID_DUPLICATE');
721: FND_MSG_PUB.add;
719: THEN
720: FND_MESSAGE.set_name('AMS', 'AMS_PERFORMANCE_ID_DUPLICATE');
721: FND_MSG_PUB.add;
722: END IF;
723: x_return_status := FND_API.g_ret_sts_error;
724: RETURN;
725: END IF;
726:
727: END check_performance_uk_items;
732: x_return_status OUT NOCOPY VARCHAR2
733: )
734: IS
735: BEGIN
736: x_return_status := FND_API.g_ret_sts_success;
737:
738: IF p_validation_mode = JTF_PLSQL_API.g_create THEN
739: IF p_performance_rec.MODEL_ID = FND_API.g_miss_num OR p_performance_rec.MODEL_ID IS NULL THEN
740: AMS_Utility_PVT.error_message ('AMS_PERF_NO_MODEL_ID');
735: BEGIN
736: x_return_status := FND_API.g_ret_sts_success;
737:
738: IF p_validation_mode = JTF_PLSQL_API.g_create THEN
739: IF p_performance_rec.MODEL_ID = FND_API.g_miss_num OR p_performance_rec.MODEL_ID IS NULL THEN
740: AMS_Utility_PVT.error_message ('AMS_PERF_NO_MODEL_ID');
741: x_return_status := FND_API.g_ret_sts_error;
742: END IF;
743:
737:
738: IF p_validation_mode = JTF_PLSQL_API.g_create THEN
739: IF p_performance_rec.MODEL_ID = FND_API.g_miss_num OR p_performance_rec.MODEL_ID IS NULL THEN
740: AMS_Utility_PVT.error_message ('AMS_PERF_NO_MODEL_ID');
741: x_return_status := FND_API.g_ret_sts_error;
742: END IF;
743:
744: -- predicated value
745: IF p_performance_rec.predicted_value = FND_API.g_miss_num OR p_performance_rec.predicted_value IS NULL THEN
741: x_return_status := FND_API.g_ret_sts_error;
742: END IF;
743:
744: -- predicated value
745: IF p_performance_rec.predicted_value = FND_API.g_miss_num OR p_performance_rec.predicted_value IS NULL THEN
746: AMS_Utility_PVT.error_message ('AMS_PERF_NO_PREDICTED_VALUE');
747: x_return_status := FND_API.g_ret_sts_error;
748: END IF;
749:
743:
744: -- predicated value
745: IF p_performance_rec.predicted_value = FND_API.g_miss_num OR p_performance_rec.predicted_value IS NULL THEN
746: AMS_Utility_PVT.error_message ('AMS_PERF_NO_PREDICTED_VALUE');
747: x_return_status := FND_API.g_ret_sts_error;
748: END IF;
749:
750: -- actual value
751: IF p_performance_rec.actual_value = FND_API.g_miss_num OR p_performance_rec.actual_value IS NULL THEN
747: x_return_status := FND_API.g_ret_sts_error;
748: END IF;
749:
750: -- actual value
751: IF p_performance_rec.actual_value = FND_API.g_miss_num OR p_performance_rec.actual_value IS NULL THEN
752: AMS_Utility_PVT.error_message ('AMS_PERF_NO_ACTUAL_VALUE');
753: x_return_status := FND_API.g_ret_sts_error;
754: END IF;
755:
749:
750: -- actual value
751: IF p_performance_rec.actual_value = FND_API.g_miss_num OR p_performance_rec.actual_value IS NULL THEN
752: AMS_Utility_PVT.error_message ('AMS_PERF_NO_ACTUAL_VALUE');
753: x_return_status := FND_API.g_ret_sts_error;
754: END IF;
755:
756: -- evaluated records
757: IF p_performance_rec.evaluated_records = FND_API.g_miss_num OR p_performance_rec.evaluated_records IS NULL THEN
753: x_return_status := FND_API.g_ret_sts_error;
754: END IF;
755:
756: -- evaluated records
757: IF p_performance_rec.evaluated_records = FND_API.g_miss_num OR p_performance_rec.evaluated_records IS NULL THEN
758: AMS_Utility_PVT.error_message ('AMS_PERF_NO_EVAL_RECORDS');
759: x_return_status := FND_API.g_ret_sts_error;
760: END IF;
761:
755:
756: -- evaluated records
757: IF p_performance_rec.evaluated_records = FND_API.g_miss_num OR p_performance_rec.evaluated_records IS NULL THEN
758: AMS_Utility_PVT.error_message ('AMS_PERF_NO_EVAL_RECORDS');
759: x_return_status := FND_API.g_ret_sts_error;
760: END IF;
761:
762: -- total records
763: IF p_performance_rec.total_records_predicted = FND_API.g_miss_num OR p_performance_rec.total_records_predicted IS NULL THEN
759: x_return_status := FND_API.g_ret_sts_error;
760: END IF;
761:
762: -- total records
763: IF p_performance_rec.total_records_predicted = FND_API.g_miss_num OR p_performance_rec.total_records_predicted IS NULL THEN
764: AMS_Utility_PVT.error_message ('AMS_PERF_NO_TOTAL_RECORDS');
765: x_return_status := FND_API.g_ret_sts_error;
766: END IF;
767: ELSE -- need ID when updating
761:
762: -- total records
763: IF p_performance_rec.total_records_predicted = FND_API.g_miss_num OR p_performance_rec.total_records_predicted IS NULL THEN
764: AMS_Utility_PVT.error_message ('AMS_PERF_NO_TOTAL_RECORDS');
765: x_return_status := FND_API.g_ret_sts_error;
766: END IF;
767: ELSE -- need ID when updating
768: IF p_performance_rec.performance_id = FND_API.g_miss_num OR p_performance_rec.performance_id IS NULL THEN
769: AMS_Utility_PVT.error_message ('AMS_PERF_NO_PERF_ID');
764: AMS_Utility_PVT.error_message ('AMS_PERF_NO_TOTAL_RECORDS');
765: x_return_status := FND_API.g_ret_sts_error;
766: END IF;
767: ELSE -- need ID when updating
768: IF p_performance_rec.performance_id = FND_API.g_miss_num OR p_performance_rec.performance_id IS NULL THEN
769: AMS_Utility_PVT.error_message ('AMS_PERF_NO_PERF_ID');
770: x_return_status := FND_API.g_ret_sts_error;
771: END IF;
772:
766: END IF;
767: ELSE -- need ID when updating
768: IF p_performance_rec.performance_id = FND_API.g_miss_num OR p_performance_rec.performance_id IS NULL THEN
769: AMS_Utility_PVT.error_message ('AMS_PERF_NO_PERF_ID');
770: x_return_status := FND_API.g_ret_sts_error;
771: END IF;
772:
773: IF p_performance_rec.MODEL_ID IS NULL THEN
774: AMS_Utility_PVT.error_message ('AMS_PERF_NO_MODEL_ID');
771: END IF;
772:
773: IF p_performance_rec.MODEL_ID IS NULL THEN
774: AMS_Utility_PVT.error_message ('AMS_PERF_NO_MODEL_ID');
775: x_return_status := FND_API.g_ret_sts_error;
776: END IF;
777:
778: -- predicated value
779: IF p_performance_rec.predicted_value IS NULL THEN
777:
778: -- predicated value
779: IF p_performance_rec.predicted_value IS NULL THEN
780: AMS_Utility_PVT.error_message ('AMS_PERF_NO_PREDICTED_VALUE');
781: x_return_status := FND_API.g_ret_sts_error;
782: END IF;
783:
784: -- actual value
785: IF p_performance_rec.actual_value IS NULL THEN
783:
784: -- actual value
785: IF p_performance_rec.actual_value IS NULL THEN
786: AMS_Utility_PVT.error_message ('AMS_PERF_NO_ACTUAL_VALUE');
787: x_return_status := FND_API.g_ret_sts_error;
788: END IF;
789:
790: -- evaluated records
791: IF p_performance_rec.evaluated_records IS NULL THEN
789:
790: -- evaluated records
791: IF p_performance_rec.evaluated_records IS NULL THEN
792: AMS_Utility_PVT.error_message ('AMS_PERF_NO_EVAL_RECORDS');
793: x_return_status := FND_API.g_ret_sts_error;
794: END IF;
795:
796: -- total records
797: IF p_performance_rec.total_records_predicted IS NULL THEN
795:
796: -- total records
797: IF p_performance_rec.total_records_predicted IS NULL THEN
798: AMS_Utility_PVT.error_message ('AMS_PERF_NO_TOTAL_RECORDS');
799: x_return_status := FND_API.g_ret_sts_error;
800: END IF;
801: END IF;
802:
803: END check_performance_req_items;
807: x_return_status OUT NOCOPY VARCHAR2
808: )
809: IS
810: BEGIN
811: x_return_status := FND_API.g_ret_sts_success;
812:
813: IF p_performance_rec.model_id <> FND_API.g_miss_num THEN
814: IF AMS_Utility_PVT.check_fk_exists (
815: 'AMS_DM_MODELS_ALL_B',
809: IS
810: BEGIN
811: x_return_status := FND_API.g_ret_sts_success;
812:
813: IF p_performance_rec.model_id <> FND_API.g_miss_num THEN
814: IF AMS_Utility_PVT.check_fk_exists (
815: 'AMS_DM_MODELS_ALL_B',
816: 'MODEL_ID',
817: p_performance_rec.model_id
814: IF AMS_Utility_PVT.check_fk_exists (
815: 'AMS_DM_MODELS_ALL_B',
816: 'MODEL_ID',
817: p_performance_rec.model_id
818: ) = FND_API.g_false THEN
819: AMS_Utility_PVT.error_message ('AMS_DM_PERF_BAD_MODEL_ID');
820: x_return_status := FND_API.g_ret_sts_error;
821: END IF;
822: END IF;
816: 'MODEL_ID',
817: p_performance_rec.model_id
818: ) = FND_API.g_false THEN
819: AMS_Utility_PVT.error_message ('AMS_DM_PERF_BAD_MODEL_ID');
820: x_return_status := FND_API.g_ret_sts_error;
821: END IF;
822: END IF;
823: END check_performance_FK_items;
824:
827: x_return_status OUT NOCOPY VARCHAR2
828: )
829: IS
830: BEGIN
831: x_return_status := FND_API.g_ret_sts_success;
832:
833: -- Enter custom code here
834:
835: END check_performance_Lookup_items;
847: check_performance_uk_items(
848: p_performance_rec => p_performance_rec,
849: p_validation_mode => p_validation_mode,
850: x_return_status => x_return_status);
851: IF x_return_status <> FND_API.g_ret_sts_success THEN
852: RETURN;
853: END IF;
854:
855: -- Check Items Required/NOT NULL API calls
857: check_performance_req_items(
858: p_performance_rec => p_performance_rec,
859: p_validation_mode => p_validation_mode,
860: x_return_status => x_return_status);
861: IF x_return_status <> FND_API.g_ret_sts_success THEN
862: RETURN;
863: END IF;
864: -- Check Items Foreign Keys API calls
865:
865:
866: check_performance_FK_items(
867: p_performance_rec => p_performance_rec,
868: x_return_status => x_return_status);
869: IF x_return_status <> FND_API.g_ret_sts_success THEN
870: RETURN;
871: END IF;
872: -- Check Items Lookups
873:
873:
874: check_performance_Lookup_items(
875: p_performance_rec => p_performance_rec,
876: x_return_status => x_return_status);
877: IF x_return_status <> FND_API.g_ret_sts_success THEN
878: RETURN;
879: END IF;
880:
881: END Check_performance_Items;
896: END Complete_performance_Rec;
897:
898: PROCEDURE Validate_Performance(
899: p_api_version_number IN NUMBER,
900: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
901: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
902: p_validation_mode IN VARCHAR2,
903: p_performance_rec IN performance_rec_type,
904: x_return_status OUT NOCOPY VARCHAR2,
897:
898: PROCEDURE Validate_Performance(
899: p_api_version_number IN NUMBER,
900: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
901: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
902: p_validation_mode IN VARCHAR2,
903: p_performance_rec IN performance_rec_type,
904: x_return_status OUT NOCOPY VARCHAR2,
905: x_msg_count OUT NOCOPY NUMBER,
914: -- Standard Start of API savepoint
915: SAVEPOINT Validate_Performance_;
916:
917: -- Standard call to check for call compatibility.
918: IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
919: p_api_version_number,
920: l_api_name,
921: G_PKG_NAME)
922: THEN
919: p_api_version_number,
920: l_api_name,
921: G_PKG_NAME)
922: THEN
923: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
924: END IF;
925:
926: -- Initialize message list if p_init_msg_list is set to TRUE.
927: IF FND_API.to_Boolean( p_init_msg_list )
923: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
924: END IF;
925:
926: -- Initialize message list if p_init_msg_list is set to TRUE.
927: IF FND_API.to_Boolean( p_init_msg_list )
928: THEN
929: FND_MSG_PUB.initialize;
930: END IF;
931: IF p_validation_level >= JTF_PLSQL_API.g_valid_level_item THEN
934: p_validation_mode => p_validation_mode,
935: x_return_status => x_return_status
936: );
937:
938: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
939: RAISE FND_API.G_EXC_ERROR;
940: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
941: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
942: END IF;
935: x_return_status => x_return_status
936: );
937:
938: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
939: RAISE FND_API.G_EXC_ERROR;
940: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
941: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
942: END IF;
943: END IF;
936: );
937:
938: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
939: RAISE FND_API.G_EXC_ERROR;
940: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
941: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
942: END IF;
943: END IF;
944:
937:
938: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
939: RAISE FND_API.G_EXC_ERROR;
940: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
941: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
942: END IF;
943: END IF;
944:
945: Complete_performance_Rec(
949:
950: IF p_validation_level >= JTF_PLSQL_API.g_valid_level_item THEN
951: Validate_performance_Rec(
952: p_api_version_number => 1.0,
953: p_init_msg_list => FND_API.G_FALSE,
954: x_return_status => x_return_status,
955: x_msg_count => x_msg_count,
956: x_msg_data => x_msg_data,
957: p_performance_rec => l_performance_rec);
955: x_msg_count => x_msg_count,
956: x_msg_data => x_msg_data,
957: p_performance_rec => l_performance_rec);
958:
959: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
960: RAISE FND_API.G_EXC_ERROR;
961: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
962: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
963: END IF;
956: x_msg_data => x_msg_data,
957: p_performance_rec => l_performance_rec);
958:
959: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
960: RAISE FND_API.G_EXC_ERROR;
961: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
962: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
963: END IF;
964: END IF;
957: p_performance_rec => l_performance_rec);
958:
959: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
960: RAISE FND_API.G_EXC_ERROR;
961: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
962: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
963: END IF;
964: END IF;
965:
958:
959: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
960: RAISE FND_API.G_EXC_ERROR;
961: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
962: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
963: END IF;
964: END IF;
965:
966:
971: END IF;
972:
973:
974: -- Initialize API return status to SUCCESS
975: x_return_status := FND_API.G_RET_STS_SUCCESS;
976:
977:
978: -- Debug Message
979: IF (AMS_DEBUG_HIGH_ON) THEN
988: );
989: EXCEPTION
990:
991: WHEN AMS_Utility_PVT.resource_locked THEN
992: x_return_status := FND_API.g_ret_sts_error;
993: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
994: FND_MESSAGE.set_name('AMS', 'AMS_API_RESOURCE_LOCKED');
995: FND_MSG_PUB.add;
996: END IF;
994: FND_MESSAGE.set_name('AMS', 'AMS_API_RESOURCE_LOCKED');
995: FND_MSG_PUB.add;
996: END IF;
997:
998: WHEN FND_API.G_EXC_ERROR THEN
999: ROLLBACK TO Validate_Performance_;
1000: x_return_status := FND_API.G_RET_STS_ERROR;
1001: -- Standard call to get message count and if count=1, get the message
1002: FND_MSG_PUB.Count_And_Get (
996: END IF;
997:
998: WHEN FND_API.G_EXC_ERROR THEN
999: ROLLBACK TO Validate_Performance_;
1000: x_return_status := FND_API.G_RET_STS_ERROR;
1001: -- Standard call to get message count and if count=1, get the message
1002: FND_MSG_PUB.Count_And_Get (
1003: p_encoded => FND_API.G_FALSE,
1004: p_count => x_msg_count,
999: ROLLBACK TO Validate_Performance_;
1000: x_return_status := FND_API.G_RET_STS_ERROR;
1001: -- Standard call to get message count and if count=1, get the message
1002: FND_MSG_PUB.Count_And_Get (
1003: p_encoded => FND_API.G_FALSE,
1004: p_count => x_msg_count,
1005: p_data => x_msg_data
1006: );
1007:
1004: p_count => x_msg_count,
1005: p_data => x_msg_data
1006: );
1007:
1008: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1009: ROLLBACK TO Validate_Performance_;
1010: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1011: -- Standard call to get message count and if count=1, get the message
1012: FND_MSG_PUB.Count_And_Get (
1006: );
1007:
1008: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1009: ROLLBACK TO Validate_Performance_;
1010: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1011: -- Standard call to get message count and if count=1, get the message
1012: FND_MSG_PUB.Count_And_Get (
1013: p_encoded => FND_API.G_FALSE,
1014: p_count => x_msg_count,
1009: ROLLBACK TO Validate_Performance_;
1010: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1011: -- Standard call to get message count and if count=1, get the message
1012: FND_MSG_PUB.Count_And_Get (
1013: p_encoded => FND_API.G_FALSE,
1014: p_count => x_msg_count,
1015: p_data => x_msg_data
1016: );
1017:
1016: );
1017:
1018: WHEN OTHERS THEN
1019: ROLLBACK TO Validate_Performance_;
1020: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1021: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1022: THEN
1023: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1024: END IF;
1023: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1024: END IF;
1025: -- Standard call to get message count and if count=1, get the message
1026: FND_MSG_PUB.Count_And_Get (
1027: p_encoded => FND_API.G_FALSE,
1028: p_count => x_msg_count,
1029: p_data => x_msg_data
1030: );
1031: End Validate_Performance;
1032:
1033:
1034: PROCEDURE Validate_performance_rec(
1035: p_api_version_number IN NUMBER,
1036: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1037: x_return_status OUT NOCOPY VARCHAR2,
1038: x_msg_count OUT NOCOPY NUMBER,
1039: x_msg_data OUT NOCOPY VARCHAR2,
1040: p_performance_rec IN performance_rec_type
1041: )
1042: IS
1043: BEGIN
1044: -- Initialize message list if p_init_msg_list is set to TRUE.
1045: IF FND_API.to_Boolean( p_init_msg_list )
1046: THEN
1047: FND_MSG_PUB.initialize;
1048: END IF;
1049:
1047: FND_MSG_PUB.initialize;
1048: END IF;
1049:
1050: -- Initialize API return status to SUCCESS
1051: x_return_status := FND_API.G_RET_STS_SUCCESS;
1052:
1053: -- Hint: Validate data
1054: -- If data not valid
1055: -- THEN
1052:
1053: -- Hint: Validate data
1054: -- If data not valid
1055: -- THEN
1056: -- x_return_status := FND_API.G_RET_STS_ERROR;
1057:
1058: -- Debug Message
1059: IF (AMS_DEBUG_HIGH_ON) THEN
1060: