52: -- NOTES
53: ---------------------------------------------------------------------
54: PROCEDURE Update_User_Action(
55: p_api_version IN NUMBER
56: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
57: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
58:
59: ,x_return_status OUT NOCOPY VARCHAR2
60: ,x_msg_data OUT NOCOPY VARCHAR2
53: ---------------------------------------------------------------------
54: PROCEDURE Update_User_Action(
55: p_api_version IN NUMBER
56: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
57: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
58:
59: ,x_return_status OUT NOCOPY VARCHAR2
60: ,x_msg_data OUT NOCOPY VARCHAR2
61: ,x_msg_count OUT NOCOPY NUMBER
120:
121: -- Standard begin of API savepoint Update_User_Action_PVT
122: SAVEPOINT Update_User_Action_PVT;
123: -- Standard call to check for call compatibility.
124: IF NOT FND_API.Compatible_API_Call (
125: l_api_version,
126: p_api_version,
127: l_api_name,
128: G_PKG_NAME)
126: p_api_version,
127: l_api_name,
128: G_PKG_NAME)
129: THEN
130: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
131: END IF;
132: -- Debug Message
133: IF G_DEBUG THEN
134: dpp_utility_pvt.debug_message( l_api_name||': Start');
133: IF G_DEBUG THEN
134: dpp_utility_pvt.debug_message( l_api_name||': Start');
135: END IF;
136: --Initialize message list if p_init_msg_list is TRUE.
137: IF FND_API.To_Boolean (p_init_msg_list) THEN
138: FND_MSG_PUB.initialize;
139: END IF;
140: -- Initialize API return status to sucess
141: x_return_status := FND_API.G_RET_STS_SUCCESS;
137: IF FND_API.To_Boolean (p_init_msg_list) THEN
138: FND_MSG_PUB.initialize;
139: END IF;
140: -- Initialize API return status to sucess
141: x_return_status := FND_API.G_RET_STS_SUCCESS;
142:
143: -- Get Current Approvers and update their access
144: OPEN csr_curr_approvers(p_approval_rec.object_type, p_approval_rec.object_id);
145: LOOP
189:
190: -- Add_Access - List Approvers sent from Get_Approvers api
191: Add_Access(
192: p_api_version => p_api_version
193: ,p_init_msg_list => FND_API.G_FALSE
194: ,p_commit => FND_API.G_FALSE
195: ,p_validation_level => p_validation_level
196: ,x_return_status => x_return_status
197: ,x_msg_data => x_msg_data
190: -- Add_Access - List Approvers sent from Get_Approvers api
191: Add_Access(
192: p_api_version => p_api_version
193: ,p_init_msg_list => FND_API.G_FALSE
194: ,p_commit => FND_API.G_FALSE
195: ,p_validation_level => p_validation_level
196: ,x_return_status => x_return_status
197: ,x_msg_data => x_msg_data
198: ,x_msg_count => x_msg_count
198: ,x_msg_count => x_msg_count
199: ,p_approval_rec => p_approval_rec
200: ,p_approvers => l_approvers_tbl );
201:
202: IF x_return_status = FND_API.g_ret_sts_error THEN
203: RAISE FND_API.g_exc_error;
204: ELSIF x_return_status = FND_API.g_ret_sts_unexp_error THEN
205: RAISE FND_API.g_exc_unexpected_error;
206: END IF;
199: ,p_approval_rec => p_approval_rec
200: ,p_approvers => l_approvers_tbl );
201:
202: IF x_return_status = FND_API.g_ret_sts_error THEN
203: RAISE FND_API.g_exc_error;
204: ELSIF x_return_status = FND_API.g_ret_sts_unexp_error THEN
205: RAISE FND_API.g_exc_unexpected_error;
206: END IF;
207:
200: ,p_approvers => l_approvers_tbl );
201:
202: IF x_return_status = FND_API.g_ret_sts_error THEN
203: RAISE FND_API.g_exc_error;
204: ELSIF x_return_status = FND_API.g_ret_sts_unexp_error THEN
205: RAISE FND_API.g_exc_unexpected_error;
206: END IF;
207:
208: -- Update approval access table to revoke access
201:
202: IF x_return_status = FND_API.g_ret_sts_error THEN
203: RAISE FND_API.g_exc_error;
204: ELSIF x_return_status = FND_API.g_ret_sts_unexp_error THEN
205: RAISE FND_API.g_exc_unexpected_error;
206: END IF;
207:
208: -- Update approval access table to revoke access
209: UPDATE DPP_APPROVAL_ACCESS
278: END IF;
279: -- Revoke_Access - Revoke acces to previous appprovers in the chain
280: Revoke_Access(
281: p_api_version => p_api_version
282: ,p_init_msg_list => FND_API.G_FALSE
283: ,p_validation_level => p_validation_level
284: ,x_return_status => x_return_status
285: ,x_msg_data => x_msg_data
286: ,x_msg_count => x_msg_count
286: ,x_msg_count => x_msg_count
287: ,p_object_type => p_approval_rec.object_type
288: ,p_object_id => p_approval_rec.object_id);
289:
290: IF x_return_status = FND_API.g_ret_sts_error THEN
291: RAISE FND_API.g_exc_error;
292: ELSIF x_return_status = FND_API.g_ret_sts_unexp_error THEN
293: RAISE FND_API.g_exc_unexpected_error;
294: END IF;
287: ,p_object_type => p_approval_rec.object_type
288: ,p_object_id => p_approval_rec.object_id);
289:
290: IF x_return_status = FND_API.g_ret_sts_error THEN
291: RAISE FND_API.g_exc_error;
292: ELSIF x_return_status = FND_API.g_ret_sts_unexp_error THEN
293: RAISE FND_API.g_exc_unexpected_error;
294: END IF;
295:
288: ,p_object_id => p_approval_rec.object_id);
289:
290: IF x_return_status = FND_API.g_ret_sts_error THEN
291: RAISE FND_API.g_exc_error;
292: ELSIF x_return_status = FND_API.g_ret_sts_unexp_error THEN
293: RAISE FND_API.g_exc_unexpected_error;
294: END IF;
295:
296: IF l_min_reassign_level <> 0 THEN
289:
290: IF x_return_status = FND_API.g_ret_sts_error THEN
291: RAISE FND_API.g_exc_error;
292: ELSIF x_return_status = FND_API.g_ret_sts_unexp_error THEN
293: RAISE FND_API.g_exc_unexpected_error;
294: END IF;
295:
296: IF l_min_reassign_level <> 0 THEN
297: IF p_approval_rec.action_code = 'REJECT' THEN
307: dpp_utility_pvt.debug_message( l_api_name||': End');
308: END IF;
309: --Standard call to get message count and if count=1, get the message
310: FND_MSG_PUB.Count_And_Get (
311: p_encoded => FND_API.G_FALSE,
312: p_count => x_msg_count,
313: p_data => x_msg_data
314: );
315: EXCEPTION
312: p_count => x_msg_count,
313: p_data => x_msg_data
314: );
315: EXCEPTION
316: WHEN FND_API.G_EXC_ERROR THEN
317: ROLLBACK TO Update_User_Action_PVT;
318: x_return_status := FND_API.G_RET_STS_ERROR;
319: -- Standard call to get message count and if count=1, get the message
320: FND_MSG_PUB.Count_And_Get (
314: );
315: EXCEPTION
316: WHEN FND_API.G_EXC_ERROR THEN
317: ROLLBACK TO Update_User_Action_PVT;
318: x_return_status := FND_API.G_RET_STS_ERROR;
319: -- Standard call to get message count and if count=1, get the message
320: FND_MSG_PUB.Count_And_Get (
321: p_encoded => FND_API.G_FALSE,
322: p_count => x_msg_count,
317: ROLLBACK TO Update_User_Action_PVT;
318: x_return_status := FND_API.G_RET_STS_ERROR;
319: -- Standard call to get message count and if count=1, get the message
320: FND_MSG_PUB.Count_And_Get (
321: p_encoded => FND_API.G_FALSE,
322: p_count => x_msg_count,
323: p_data => x_msg_data
324: );
325: IF x_msg_count > 1 THEN
326: FOR I IN 1..x_msg_count LOOP
327: x_msg_data := SUBSTR((x_msg_data||' '|| FND_MSG_PUB.GET(P_MSG_INDEX => I, P_ENCODED => 'F')), 1, 4000);
328: END LOOP;
329: END IF;
330: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
331: ROLLBACK TO Update_User_Action_PVT;
332: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
333: -- Standard call to get message count and if count=1, get the message
334: FND_MSG_PUB.Count_And_Get (
328: END LOOP;
329: END IF;
330: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
331: ROLLBACK TO Update_User_Action_PVT;
332: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
333: -- Standard call to get message count and if count=1, get the message
334: FND_MSG_PUB.Count_And_Get (
335: p_encoded => FND_API.G_FALSE,
336: p_count => x_msg_count,
331: ROLLBACK TO Update_User_Action_PVT;
332: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
333: -- Standard call to get message count and if count=1, get the message
334: FND_MSG_PUB.Count_And_Get (
335: p_encoded => FND_API.G_FALSE,
336: p_count => x_msg_count,
337: p_data => x_msg_data
338: );
339: IF x_msg_count > 1 THEN
342: END LOOP;
343: END IF;
344: WHEN OTHERS THEN
345: ROLLBACK TO Update_User_Action_PVT;
346: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
347: IF DPP_UNEXP_ERROR_ON
348: THEN
349: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
350: END IF;
349: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
350: END IF;
351: -- Standard call to get message count and if count=1, get the message
352: FND_MSG_PUB.Count_And_Get (
353: p_encoded => FND_API.G_FALSE,
354: p_count => x_msg_count,
355: p_data => x_msg_data
356: );
357: IF x_msg_count > 1 THEN
370: -- NOTES
371: ---------------------------------------------------------------------
372: PROCEDURE Get_Approvers(
373: p_api_version IN NUMBER
374: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
375: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
376:
377: ,x_return_status OUT NOCOPY VARCHAR2
378: ,x_msg_data OUT NOCOPY VARCHAR2
371: ---------------------------------------------------------------------
372: PROCEDURE Get_Approvers(
373: p_api_version IN NUMBER
374: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
375: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
376:
377: ,x_return_status OUT NOCOPY VARCHAR2
378: ,x_msg_data OUT NOCOPY VARCHAR2
379: ,x_msg_count OUT NOCOPY NUMBER
404:
405: -- Standard begin of API savepoint
406: SAVEPOINT Get_Approvers_PVT;
407: -- Standard call to check for call compatibility.
408: IF NOT FND_API.Compatible_API_Call (
409: l_api_version,
410: p_api_version,
411: l_api_name,
412: G_PKG_NAME)
410: p_api_version,
411: l_api_name,
412: G_PKG_NAME)
413: THEN
414: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
415: END IF;
416: -- Debug Message
417: IF G_DEBUG THEN
418: dpp_utility_pvt.debug_message( l_api_name||': Start');
417: IF G_DEBUG THEN
418: dpp_utility_pvt.debug_message( l_api_name||': Start');
419: END IF;
420: --Initialize message list if p_init_msg_list is TRUE.
421: IF FND_API.To_Boolean (p_init_msg_list) THEN
422: FND_MSG_PUB.initialize;
423: END IF;
424: -- Initialize API return status to sucess
425: x_return_status := FND_API.G_RET_STS_SUCCESS;
421: IF FND_API.To_Boolean (p_init_msg_list) THEN
422: FND_MSG_PUB.initialize;
423: END IF;
424: -- Initialize API return status to sucess
425: x_return_status := FND_API.G_RET_STS_SUCCESS;
426:
427: OPEN csr_approver_level (l_object_type, l_object_id);
428: FETCH csr_approver_level INTO l_approver_level;
429: CLOSE csr_approver_level;
495: END IF;
496:
497: --Standard call to get message count and if count=1, get the message
498: FND_MSG_PUB.Count_And_Get (
499: p_encoded => FND_API.G_FALSE,
500: p_count => x_msg_count,
501: p_data => x_msg_data
502: );
503: EXCEPTION
500: p_count => x_msg_count,
501: p_data => x_msg_data
502: );
503: EXCEPTION
504: WHEN FND_API.G_EXC_ERROR THEN
505: ROLLBACK TO Get_Approvers_PVT;
506: x_return_status := FND_API.G_RET_STS_ERROR;
507: -- Standard call to get message count and if count=1, get the message
508: FND_MSG_PUB.Count_And_Get (
502: );
503: EXCEPTION
504: WHEN FND_API.G_EXC_ERROR THEN
505: ROLLBACK TO Get_Approvers_PVT;
506: x_return_status := FND_API.G_RET_STS_ERROR;
507: -- Standard call to get message count and if count=1, get the message
508: FND_MSG_PUB.Count_And_Get (
509: p_encoded => FND_API.G_FALSE,
510: p_count => x_msg_count,
505: ROLLBACK TO Get_Approvers_PVT;
506: x_return_status := FND_API.G_RET_STS_ERROR;
507: -- Standard call to get message count and if count=1, get the message
508: FND_MSG_PUB.Count_And_Get (
509: p_encoded => FND_API.G_FALSE,
510: p_count => x_msg_count,
511: p_data => x_msg_data
512: );
513: IF x_msg_count > 1 THEN
514: FOR I IN 1..x_msg_count LOOP
515: x_msg_data := SUBSTR((x_msg_data||' '|| FND_MSG_PUB.GET(P_MSG_INDEX => I, P_ENCODED => 'F')), 1, 4000);
516: END LOOP;
517: END IF;
518: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
519: ROLLBACK TO Get_Approvers_PVT;
520: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
521: -- Standard call to get message count and if count=1, get the message
522: FND_MSG_PUB.Count_And_Get (
516: END LOOP;
517: END IF;
518: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
519: ROLLBACK TO Get_Approvers_PVT;
520: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
521: -- Standard call to get message count and if count=1, get the message
522: FND_MSG_PUB.Count_And_Get (
523: p_encoded => FND_API.G_FALSE,
524: p_count => x_msg_count,
519: ROLLBACK TO Get_Approvers_PVT;
520: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
521: -- Standard call to get message count and if count=1, get the message
522: FND_MSG_PUB.Count_And_Get (
523: p_encoded => FND_API.G_FALSE,
524: p_count => x_msg_count,
525: p_data => x_msg_data
526: );
527: IF x_msg_count > 1 THEN
530: END LOOP;
531: END IF;
532: WHEN OTHERS THEN
533: ROLLBACK TO Get_Approvers_PVT;
534: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
535: IF DPP_UNEXP_ERROR_ON
536: THEN
537: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
538: END IF;
537: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
538: END IF;
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: IF x_msg_count > 1 THEN
558: -- NOTES
559: ---------------------------------------------------------------------
560: PROCEDURE Get_AllApprovers(
561: p_api_version IN NUMBER
562: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
563: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
564:
565: ,x_return_status OUT NOCOPY VARCHAR2
566: ,x_msg_data OUT NOCOPY VARCHAR2
559: ---------------------------------------------------------------------
560: PROCEDURE Get_AllApprovers(
561: p_api_version IN NUMBER
562: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
563: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
564:
565: ,x_return_status OUT NOCOPY VARCHAR2
566: ,x_msg_data OUT NOCOPY VARCHAR2
567: ,x_msg_count OUT NOCOPY NUMBER
584: BEGIN
585: -- Standard begin of API savepoint
586: SAVEPOINT Get_AllApprovers_PVT;
587: -- Standard call to check for call compatibility.
588: IF NOT FND_API.Compatible_API_Call (
589: l_api_version,
590: p_api_version,
591: l_api_name,
592: G_PKG_NAME)
590: p_api_version,
591: l_api_name,
592: G_PKG_NAME)
593: THEN
594: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
595: END IF;
596: -- Debug Message
597: IF G_DEBUG THEN
598: dpp_utility_pvt.debug_message( l_api_name||': Start');
597: IF G_DEBUG THEN
598: dpp_utility_pvt.debug_message( l_api_name||': Start');
599: END IF;
600: --Initialize message list if p_init_msg_list is TRUE.
601: IF FND_API.To_Boolean (p_init_msg_list) THEN
602: FND_MSG_PUB.initialize;
603: END IF;
604: --Initialize API return status to sucess
605: x_return_status := FND_API.G_RET_STS_SUCCESS;
601: IF FND_API.To_Boolean (p_init_msg_list) THEN
602: FND_MSG_PUB.initialize;
603: END IF;
604: --Initialize API return status to sucess
605: x_return_status := FND_API.G_RET_STS_SUCCESS;
606:
607: IF G_DEBUG THEN
608: dpp_utility_pvt.debug_message( 'l_application_id:'|| l_application_id);
609: dpp_utility_pvt.debug_message( 'p_approval_rec.object_id:'|| p_approval_rec.object_id);
635: EXCEPTION
636: WHEN NO_DATA_FOUND THEN
637: FND_MESSAGE.set_name('DPP', 'DPP_AME_NO_APP');
638: FND_MSG_PUB.add;
639: RAISE FND_API.G_EXC_ERROR;
640: WHEN OTHERS THEN
641: fnd_message.set_name('FND', 'SQL_PLSQL_ERROR');
642: fnd_message.set_token('ROUTINE', 'DPP_APPROVAL_PVT');
643: fnd_message.set_token('ERRNO', sqlcode);
642: fnd_message.set_token('ROUTINE', 'DPP_APPROVAL_PVT');
643: fnd_message.set_token('ERRNO', sqlcode);
644: fnd_message.set_token('REASON', sqlerrm);
645: FND_MSG_PUB.add;
646: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
647: END;
648: p_approversOut(1).first_name := l_first_name;
649: p_approversOut(1).last_name := l_last_name;
650: ELSE
675: WHEN NO_DATA_FOUND THEN
676: l_approver_email := NULL;
677: FND_MESSAGE.set_name('DPP', 'DPP_NO_APP_DETAIL');
678: FND_MSG_PUB.add;
679: RAISE FND_API.G_EXC_ERROR;
680: WHEN OTHERS THEN
681: fnd_message.set_name('FND', 'SQL_PLSQL_ERROR');
682: fnd_message.set_token('ROUTINE', 'DPP_APPROVAL_PVT');
683: fnd_message.set_token('ERRNO', sqlcode);
682: fnd_message.set_token('ROUTINE', 'DPP_APPROVAL_PVT');
683: fnd_message.set_token('ERRNO', sqlcode);
684: fnd_message.set_token('REASON', sqlerrm);
685: FND_MSG_PUB.add;
686: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
687: END;
688: ELSIF l_approversOut(i).user_id IS NOT NULL THEN -- If person id is null then retrieve the user id
689: BEGIN
690: SELECT email_address
694: EXCEPTION
695: WHEN NO_DATA_FOUND THEN
696: FND_MESSAGE.set_name('DPP', 'DPP_NO_APP_DETAIL');
697: FND_MSG_PUB.add;
698: RAISE FND_API.G_EXC_ERROR;
699: WHEN OTHERS THEN
700: fnd_message.set_name('FND', 'SQL_PLSQL_ERROR');
701: fnd_message.set_token('ROUTINE', 'DPP_APPROVAL_PVT');
702: fnd_message.set_token('ERRNO', sqlcode);
701: fnd_message.set_token('ROUTINE', 'DPP_APPROVAL_PVT');
702: fnd_message.set_token('ERRNO', sqlcode);
703: fnd_message.set_token('REASON', sqlerrm);
704: FND_MSG_PUB.add;
705: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
706: END;
707: ELSE -- Both the person id and the user id are null
708: IF G_DEBUG THEN
709: dpp_utility_pvt.debug_message( 'No details retrieved for the Approver ');
721: EXCEPTION
722: WHEN NO_DATA_FOUND THEN
723: FND_MESSAGE.set_name('DPP', 'DPP_NO_APP_GRP_DETAIL');
724: FND_MSG_PUB.add;
725: RAISE FND_API.G_EXC_ERROR;
726: WHEN OTHERS THEN
727: fnd_message.set_name('FND', 'SQL_PLSQL_ERROR');
728: fnd_message.set_token('ROUTINE', 'DPP_APPROVAL_PVT');
729: fnd_message.set_token('ERRNO', sqlcode);
728: fnd_message.set_token('ROUTINE', 'DPP_APPROVAL_PVT');
729: fnd_message.set_token('ERRNO', sqlcode);
730: fnd_message.set_token('REASON', sqlerrm);
731: FND_MSG_PUB.add;
732: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
733: END;
734: --Retrieve the order number
735: BEGIN
736: SELECT order_number
741: EXCEPTION
742: WHEN NO_DATA_FOUND THEN
743: FND_MESSAGE.set_name('DPP', 'DPP_NO_APP_SEQ');
744: FND_MSG_PUB.add;
745: RAISE FND_API.G_EXC_ERROR;
746: WHEN OTHERS THEN
747: fnd_message.set_name('FND', 'SQL_PLSQL_ERROR');
748: fnd_message.set_token('ROUTINE', 'DPP_APPROVAL_PVT');
749: fnd_message.set_token('ERRNO', sqlcode);
748: fnd_message.set_token('ROUTINE', 'DPP_APPROVAL_PVT');
749: fnd_message.set_token('ERRNO', sqlcode);
750: fnd_message.set_token('REASON', sqlerrm);
751: FND_MSG_PUB.add;
752: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
753: END;
754: --Assign the approver details to the out variable
755: p_approversOut(i).user_id := l_approversOut(i).user_id;
756: p_approversOut(i).person_id := l_approversOut(i).person_id;
773: dpp_utility_pvt.debug_message( l_api_name||': End');
774: END IF;
775: --Standard call to get message count and if count=1, get the message
776: FND_MSG_PUB.Count_And_Get (
777: p_encoded => FND_API.G_FALSE,
778: p_count => x_msg_count,
779: p_data => x_msg_data
780: );
781: EXCEPTION
778: p_count => x_msg_count,
779: p_data => x_msg_data
780: );
781: EXCEPTION
782: WHEN FND_API.G_EXC_ERROR THEN
783: ROLLBACK TO Get_AllApprovers_PVT;
784: x_return_status := FND_API.G_RET_STS_ERROR;
785: -- Standard call to get message count and if count=1, get the message
786: FND_MSG_PUB.Count_And_Get (
780: );
781: EXCEPTION
782: WHEN FND_API.G_EXC_ERROR THEN
783: ROLLBACK TO Get_AllApprovers_PVT;
784: x_return_status := FND_API.G_RET_STS_ERROR;
785: -- Standard call to get message count and if count=1, get the message
786: FND_MSG_PUB.Count_And_Get (
787: p_encoded => FND_API.G_FALSE,
788: p_count => x_msg_count,
783: ROLLBACK TO Get_AllApprovers_PVT;
784: x_return_status := FND_API.G_RET_STS_ERROR;
785: -- Standard call to get message count and if count=1, get the message
786: FND_MSG_PUB.Count_And_Get (
787: p_encoded => FND_API.G_FALSE,
788: p_count => x_msg_count,
789: p_data => x_msg_data
790: );
791: IF x_msg_count > 1 THEN
792: FOR I IN 1..x_msg_count LOOP
793: x_msg_data := SUBSTR((x_msg_data||' '|| FND_MSG_PUB.GET(P_MSG_INDEX => I, P_ENCODED => 'F')), 1, 4000);
794: END LOOP;
795: END IF;
796: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
797: ROLLBACK TO Get_AllApprovers_PVT;
798: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
799: -- Standard call to get message count and if count=1, get the message
800: FND_MSG_PUB.Count_And_Get (
794: END LOOP;
795: END IF;
796: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
797: ROLLBACK TO Get_AllApprovers_PVT;
798: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
799: -- Standard call to get message count and if count=1, get the message
800: FND_MSG_PUB.Count_And_Get (
801: p_encoded => FND_API.G_FALSE,
802: p_count => x_msg_count,
797: ROLLBACK TO Get_AllApprovers_PVT;
798: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
799: -- Standard call to get message count and if count=1, get the message
800: FND_MSG_PUB.Count_And_Get (
801: p_encoded => FND_API.G_FALSE,
802: p_count => x_msg_count,
803: p_data => x_msg_data
804: );
805: IF x_msg_count > 1 THEN
808: END LOOP;
809: END IF;
810: WHEN OTHERS THEN
811: ROLLBACK TO Get_AllApprovers_PVT;
812: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
813: IF DPP_UNEXP_ERROR_ON
814: THEN
815: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
816: END IF;
815: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
816: END IF;
817: -- Standard call to get message count and if count=1, get the message
818: FND_MSG_PUB.Count_And_Get (
819: p_encoded => FND_API.G_FALSE,
820: p_count => x_msg_count,
821: p_data => x_msg_data
822: );
823: IF x_msg_count > 1 THEN
838: -- NOTES
839: ---------------------------------------------------------------------
840: PROCEDURE Add_Access(
841: p_api_version IN NUMBER
842: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
843: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
844: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
845:
846: ,x_msg_data OUT NOCOPY VARCHAR2
839: ---------------------------------------------------------------------
840: PROCEDURE Add_Access(
841: p_api_version IN NUMBER
842: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
843: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
844: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
845:
846: ,x_msg_data OUT NOCOPY VARCHAR2
847: ,x_msg_count OUT NOCOPY NUMBER
840: PROCEDURE Add_Access(
841: p_api_version IN NUMBER
842: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
843: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
844: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
845:
846: ,x_msg_data OUT NOCOPY VARCHAR2
847: ,x_msg_count OUT NOCOPY NUMBER
848: ,x_return_status OUT NOCOPY VARCHAR2
863: BEGIN
864: -- Standard begin of API savepoint
865: SAVEPOINT Add_Access_PVT;
866: -- Standard call to check for call compatibility.
867: IF NOT FND_API.Compatible_API_Call (
868: l_api_version,
869: p_api_version,
870: l_api_name,
871: G_PKG_NAME)
869: p_api_version,
870: l_api_name,
871: G_PKG_NAME)
872: THEN
873: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
874: END IF;
875: -- Debug Message
876: IF G_DEBUG THEN
877: dpp_utility_pvt.debug_message( l_api_name||': Start');
876: IF G_DEBUG THEN
877: dpp_utility_pvt.debug_message( l_api_name||': Start');
878: END IF;
879: --Initialize message list if p_init_msg_list is TRUE.
880: IF FND_API.To_Boolean (p_init_msg_list) THEN
881: FND_MSG_PUB.initialize;
882: END IF;
883: -- Initialize API return status to sucess
884: x_return_status := FND_API.G_RET_STS_SUCCESS;
880: IF FND_API.To_Boolean (p_init_msg_list) THEN
881: FND_MSG_PUB.initialize;
882: END IF;
883: -- Initialize API return status to sucess
884: x_return_status := FND_API.G_RET_STS_SUCCESS;
885:
886: -- Get Primary Key
887: OPEN c_id;
888: FETCH c_id INTO l_approval_access_id;
890:
891: IF p_approval_rec.object_type IS NULL THEN
892: IF DPP_ERROR_ON THEN
893: dpp_utility_pvt.error_message('OZF_OBJECT_TYPE_NOT_FOUND');
894: x_return_status := FND_API.g_ret_sts_error;
895: RAISE FND_API.G_EXC_ERROR;
896: END IF;
897: END IF;
898:
891: IF p_approval_rec.object_type IS NULL THEN
892: IF DPP_ERROR_ON THEN
893: dpp_utility_pvt.error_message('OZF_OBJECT_TYPE_NOT_FOUND');
894: x_return_status := FND_API.g_ret_sts_error;
895: RAISE FND_API.G_EXC_ERROR;
896: END IF;
897: END IF;
898:
899: IF p_approval_rec.object_id IS NULL THEN
898:
899: IF p_approval_rec.object_id IS NULL THEN
900: IF DPP_ERROR_ON THEN
901: dpp_utility_pvt.error_message('OZF_OBJECT_ID_NOT_FOUND');
902: x_return_status := FND_API.g_ret_sts_error;
903: RAISE FND_API.G_EXC_ERROR;
904: END IF;
905: END IF;
906:
899: IF p_approval_rec.object_id IS NULL THEN
900: IF DPP_ERROR_ON THEN
901: dpp_utility_pvt.error_message('OZF_OBJECT_ID_NOT_FOUND');
902: x_return_status := FND_API.g_ret_sts_error;
903: RAISE FND_API.G_EXC_ERROR;
904: END IF;
905: END IF;
906:
907: -- Validate if the approvers record is valid
908: FOR i in 1..p_approvers.count LOOP
909: IF p_approvers(i).approver_type <> 'USER' and p_approvers(i).approver_type <> 'PERSON' THEN
910: IF DPP_ERROR_ON THEN
911: dpp_utility_pvt.error_message('OZF_APPROVER_NOT_USER');
912: x_return_status := FND_API.g_ret_sts_error;
913: RAISE FND_API.G_EXC_ERROR;
914: END IF;
915: END IF;
916:
909: IF p_approvers(i).approver_type <> 'USER' and p_approvers(i).approver_type <> 'PERSON' THEN
910: IF DPP_ERROR_ON THEN
911: dpp_utility_pvt.error_message('OZF_APPROVER_NOT_USER');
912: x_return_status := FND_API.g_ret_sts_error;
913: RAISE FND_API.G_EXC_ERROR;
914: END IF;
915: END IF;
916:
917: IF p_approvers(i).approver_level IS NULL THEN
916:
917: IF p_approvers(i).approver_level IS NULL THEN
918: IF DPP_ERROR_ON THEN
919: dpp_utility_pvt.error_message('OZF_APPROVAL_LEVEL_NOT_FOUND');
920: x_return_status := FND_API.g_ret_sts_error;
921: RAISE FND_API.G_EXC_ERROR;
922: END IF;
923: END IF;
924: END LOOP;
917: IF p_approvers(i).approver_level IS NULL THEN
918: IF DPP_ERROR_ON THEN
919: dpp_utility_pvt.error_message('OZF_APPROVAL_LEVEL_NOT_FOUND');
920: x_return_status := FND_API.g_ret_sts_error;
921: RAISE FND_API.G_EXC_ERROR;
922: END IF;
923: END IF;
924: END LOOP;
925:
964: EXCEPTION
965: WHEN OTHERS THEN
966: IF DPP_ERROR_ON THEN
967: dpp_utility_pvt.error_message('DPP_APPROVAL_ACCESS_INSERT_ERR');
968: x_return_status := FND_API.g_ret_sts_error;
969: RAISE FND_API.G_EXC_ERROR;
970: END IF;
971: END;
972: END LOOP;
965: WHEN OTHERS THEN
966: IF DPP_ERROR_ON THEN
967: dpp_utility_pvt.error_message('DPP_APPROVAL_ACCESS_INSERT_ERR');
968: x_return_status := FND_API.g_ret_sts_error;
969: RAISE FND_API.G_EXC_ERROR;
970: END IF;
971: END;
972: END LOOP;
973:
971: END;
972: END LOOP;
973:
974: --Standard check of commit
975: IF FND_API.To_Boolean ( p_commit ) THEN
976: COMMIT WORK;
977: END IF;
978: -- Debug Message
979: IF G_DEBUG THEN
980: dpp_utility_pvt.debug_message( l_api_name||': End');
981: END IF;
982: --Standard call to get message count and if count=1, get the message
983: FND_MSG_PUB.Count_And_Get (
984: p_encoded => FND_API.G_FALSE,
985: p_count => x_msg_count,
986: p_data => x_msg_data
987: );
988: EXCEPTION
985: p_count => x_msg_count,
986: p_data => x_msg_data
987: );
988: EXCEPTION
989: WHEN FND_API.G_EXC_ERROR THEN
990: ROLLBACK TO Add_Access_PVT;
991: x_return_status := FND_API.G_RET_STS_ERROR;
992: -- Standard call to get message count and if count=1, get the message
993: FND_MSG_PUB.Count_And_Get (
987: );
988: EXCEPTION
989: WHEN FND_API.G_EXC_ERROR THEN
990: ROLLBACK TO Add_Access_PVT;
991: x_return_status := FND_API.G_RET_STS_ERROR;
992: -- Standard call to get message count and if count=1, get the message
993: FND_MSG_PUB.Count_And_Get (
994: p_encoded => FND_API.G_FALSE,
995: p_count => x_msg_count,
990: ROLLBACK TO Add_Access_PVT;
991: x_return_status := FND_API.G_RET_STS_ERROR;
992: -- Standard call to get message count and if count=1, get the message
993: FND_MSG_PUB.Count_And_Get (
994: p_encoded => FND_API.G_FALSE,
995: p_count => x_msg_count,
996: p_data => x_msg_data
997: );
998: IF x_msg_count > 1 THEN
999: FOR I IN 1..x_msg_count LOOP
1000: x_msg_data := SUBSTR((x_msg_data||' '|| FND_MSG_PUB.GET(P_MSG_INDEX => I, P_ENCODED => 'F')), 1, 4000);
1001: END LOOP;
1002: END IF;
1003: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1004: ROLLBACK TO Add_Access_PVT;
1005: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1006: -- Standard call to get message count and if count=1, get the message
1007: FND_MSG_PUB.Count_And_Get (
1001: END LOOP;
1002: END IF;
1003: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1004: ROLLBACK TO Add_Access_PVT;
1005: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1006: -- Standard call to get message count and if count=1, get the message
1007: FND_MSG_PUB.Count_And_Get (
1008: p_encoded => FND_API.G_FALSE,
1009: p_count => x_msg_count,
1004: ROLLBACK TO Add_Access_PVT;
1005: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1006: -- Standard call to get message count and if count=1, get the message
1007: FND_MSG_PUB.Count_And_Get (
1008: p_encoded => FND_API.G_FALSE,
1009: p_count => x_msg_count,
1010: p_data => x_msg_data
1011: );
1012: IF x_msg_count > 1 THEN
1015: END LOOP;
1016: END IF;
1017: WHEN OTHERS THEN
1018: ROLLBACK TO Add_Access_PVT;
1019: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1020: IF DPP_UNEXP_ERROR_ON
1021: THEN
1022: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1023: END IF;
1022: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1023: END IF;
1024: -- Standard call to get message count and if count=1, get the message
1025: FND_MSG_PUB.Count_And_Get (
1026: p_encoded => FND_API.G_FALSE,
1027: p_count => x_msg_count,
1028: p_data => x_msg_data
1029: );
1030: IF x_msg_count > 1 THEN
1046: -- NOTES
1047: ---------------------------------------------------------------------
1048: PROCEDURE Revoke_Access (
1049: p_api_version IN NUMBER
1050: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
1051: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
1052: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
1053:
1054: ,x_return_status OUT NOCOPY VARCHAR2
1047: ---------------------------------------------------------------------
1048: PROCEDURE Revoke_Access (
1049: p_api_version IN NUMBER
1050: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
1051: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
1052: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
1053:
1054: ,x_return_status OUT NOCOPY VARCHAR2
1055: ,x_msg_data OUT NOCOPY VARCHAR2
1048: PROCEDURE Revoke_Access (
1049: p_api_version IN NUMBER
1050: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
1051: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
1052: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
1053:
1054: ,x_return_status OUT NOCOPY VARCHAR2
1055: ,x_msg_data OUT NOCOPY VARCHAR2
1056: ,x_msg_count OUT NOCOPY NUMBER
1073: BEGIN
1074: -- Standard begin of API savepoint
1075: SAVEPOINT Revoke_Access_PVT;
1076: -- Standard call to check for call compatibility.
1077: IF NOT FND_API.Compatible_API_Call (
1078: l_api_version,
1079: p_api_version,
1080: l_api_name,
1081: G_PKG_NAME)
1079: p_api_version,
1080: l_api_name,
1081: G_PKG_NAME)
1082: THEN
1083: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1084: END IF;
1085: -- Debug Message
1086: IF G_DEBUG THEN
1087: FND_MESSAGE.Set_Name('OZF','OZF_API_DEBUG_MESSAGE');
1088: FND_MESSAGE.Set_Token('TEXT',l_api_name||': Start');
1089: FND_MSG_PUB.Add;
1090: END IF;
1091: --Initialize message list if p_init_msg_list is TRUE.
1092: IF FND_API.To_Boolean (p_init_msg_list) THEN
1093: FND_MSG_PUB.initialize;
1094: END IF;
1095: -- Initialize API return status to sucess
1096: x_return_status := FND_API.G_RET_STS_SUCCESS;
1092: IF FND_API.To_Boolean (p_init_msg_list) THEN
1093: FND_MSG_PUB.initialize;
1094: END IF;
1095: -- Initialize API return status to sucess
1096: x_return_status := FND_API.G_RET_STS_SUCCESS;
1097:
1098: -- Update records in DPP_APPROVAL_ACCESS_all to revoke access
1099: OPEN csr_curr_approvers(p_object_type, p_object_id);
1100: LOOP
1111: END LOOP;
1112: CLOSE csr_curr_approvers;
1113:
1114: --Standard check of commit
1115: IF FND_API.To_Boolean ( p_commit ) THEN
1116: COMMIT WORK;
1117: END IF;
1118: -- Debug Message
1119: IF G_DEBUG THEN
1120: dpp_utility_pvt.debug_message( l_api_name||': End');
1121: END IF;
1122: --Standard call to get message count and if count=1, get the message
1123: FND_MSG_PUB.Count_And_Get (
1124: p_encoded => FND_API.G_FALSE,
1125: p_count => x_msg_count,
1126: p_data => x_msg_data
1127: );
1128: EXCEPTION
1125: p_count => x_msg_count,
1126: p_data => x_msg_data
1127: );
1128: EXCEPTION
1129: WHEN FND_API.G_EXC_ERROR THEN
1130: ROLLBACK TO Revoke_Access_PVT;
1131: x_return_status := FND_API.G_RET_STS_ERROR;
1132: -- Standard call to get message count and if count=1, get the message
1133: FND_MSG_PUB.Count_And_Get (
1127: );
1128: EXCEPTION
1129: WHEN FND_API.G_EXC_ERROR THEN
1130: ROLLBACK TO Revoke_Access_PVT;
1131: x_return_status := FND_API.G_RET_STS_ERROR;
1132: -- Standard call to get message count and if count=1, get the message
1133: FND_MSG_PUB.Count_And_Get (
1134: p_encoded => FND_API.G_FALSE,
1135: p_count => x_msg_count,
1130: ROLLBACK TO Revoke_Access_PVT;
1131: x_return_status := FND_API.G_RET_STS_ERROR;
1132: -- Standard call to get message count and if count=1, get the message
1133: FND_MSG_PUB.Count_And_Get (
1134: p_encoded => FND_API.G_FALSE,
1135: p_count => x_msg_count,
1136: p_data => x_msg_data
1137: );
1138: IF x_msg_count > 1 THEN
1139: FOR I IN 1..x_msg_count LOOP
1140: x_msg_data := SUBSTR((x_msg_data||' '|| FND_MSG_PUB.GET(P_MSG_INDEX => I, P_ENCODED => 'F')), 1, 4000);
1141: END LOOP;
1142: END IF;
1143: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1144: ROLLBACK TO Revoke_Access_PVT;
1145: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1146: -- Standard call to get message count and if count=1, get the message
1147: FND_MSG_PUB.Count_And_Get (
1141: END LOOP;
1142: END IF;
1143: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1144: ROLLBACK TO Revoke_Access_PVT;
1145: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1146: -- Standard call to get message count and if count=1, get the message
1147: FND_MSG_PUB.Count_And_Get (
1148: p_encoded => FND_API.G_FALSE,
1149: p_count => x_msg_count,
1144: ROLLBACK TO Revoke_Access_PVT;
1145: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1146: -- Standard call to get message count and if count=1, get the message
1147: FND_MSG_PUB.Count_And_Get (
1148: p_encoded => FND_API.G_FALSE,
1149: p_count => x_msg_count,
1150: p_data => x_msg_data
1151: );
1152: IF x_msg_count > 1 THEN
1155: END LOOP;
1156: END IF;
1157: WHEN OTHERS THEN
1158: ROLLBACK TO Revoke_Access_PVT;
1159: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1160: IF DPP_UNEXP_ERROR_ON
1161: THEN
1162: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1163: END IF;
1162: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1163: END IF;
1164: -- Standard call to get message count and if count=1, get the message
1165: FND_MSG_PUB.Count_And_Get (
1166: p_encoded => FND_API.G_FALSE,
1167: p_count => x_msg_count,
1168: p_data => x_msg_data
1169: );
1170: IF x_msg_count > 1 THEN
1324: IF l_event = 'NOTFOUND' THEN
1325: IF DPP_ERROR_ON THEN
1326: dpp_utility_pvt.error_message('OZF_WF_EVENT_NAME_NULL', 'NAME', p_event_name);
1327: END IF;
1328: x_return_status := FND_API.g_ret_sts_error;
1329: RAISE FND_API.G_EXC_ERROR;
1330: END IF;
1331:
1332: l_parameter_t.setName('OBJECT_TYPE');
1325: IF DPP_ERROR_ON THEN
1326: dpp_utility_pvt.error_message('OZF_WF_EVENT_NAME_NULL', 'NAME', p_event_name);
1327: END IF;
1328: x_return_status := FND_API.g_ret_sts_error;
1329: RAISE FND_API.G_EXC_ERROR;
1330: END IF;
1331:
1332: l_parameter_t.setName('OBJECT_TYPE');
1333: l_parameter_t.setValue(p_approval_rec.object_type);
1358: IF G_DEBUG THEN
1359: dpp_utility_pvt.debug_message( 'event raised....');
1360: END IF;
1361: EXCEPTION
1362: WHEN FND_API.G_EXC_ERROR THEN
1363: ROLLBACK TO Raise_Event_PVT;
1364: x_return_status := FND_API.G_RET_STS_ERROR;
1365: -- Standard call to get message count and if count=1, get the message
1366: FND_MSG_PUB.Count_And_Get (
1360: END IF;
1361: EXCEPTION
1362: WHEN FND_API.G_EXC_ERROR THEN
1363: ROLLBACK TO Raise_Event_PVT;
1364: x_return_status := FND_API.G_RET_STS_ERROR;
1365: -- Standard call to get message count and if count=1, get the message
1366: FND_MSG_PUB.Count_And_Get (
1367: p_encoded => FND_API.G_FALSE,
1368: p_count => x_msg_count,
1363: ROLLBACK TO Raise_Event_PVT;
1364: x_return_status := FND_API.G_RET_STS_ERROR;
1365: -- Standard call to get message count and if count=1, get the message
1366: FND_MSG_PUB.Count_And_Get (
1367: p_encoded => FND_API.G_FALSE,
1368: p_count => x_msg_count,
1369: p_data => x_msg_data
1370: );
1371: IF x_msg_count > 1 THEN
1372: FOR I IN 1..x_msg_count LOOP
1373: x_msg_data := SUBSTR((x_msg_data||' '|| FND_MSG_PUB.GET(P_MSG_INDEX => I, P_ENCODED => 'F')), 1, 4000);
1374: END LOOP;
1375: END IF;
1376: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1377: ROLLBACK TO Raise_Event_PVT;
1378: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1379: -- Standard call to get message count and if count=1, get the message
1380: FND_MSG_PUB.Count_And_Get (
1374: END LOOP;
1375: END IF;
1376: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1377: ROLLBACK TO Raise_Event_PVT;
1378: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1379: -- Standard call to get message count and if count=1, get the message
1380: FND_MSG_PUB.Count_And_Get (
1381: p_encoded => FND_API.G_FALSE,
1382: p_count => x_msg_count,
1377: ROLLBACK TO Raise_Event_PVT;
1378: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1379: -- Standard call to get message count and if count=1, get the message
1380: FND_MSG_PUB.Count_And_Get (
1381: p_encoded => FND_API.G_FALSE,
1382: p_count => x_msg_count,
1383: p_data => x_msg_data
1384: );
1385: IF x_msg_count > 1 THEN
1388: END LOOP;
1389: END IF;
1390: WHEN OTHERS THEN
1391: ROLLBACK TO Raise_Event_PVT;
1392: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1393: IF DPP_UNEXP_ERROR_ON
1394: THEN
1395: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1396: END IF;
1395: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1396: END IF;
1397: -- Standard call to get message count and if count=1, get the message
1398: FND_MSG_PUB.Count_And_Get (
1399: p_encoded => FND_API.G_FALSE,
1400: p_count => x_msg_count,
1401: p_data => x_msg_data
1402: );
1403: IF x_msg_count > 1 THEN
1419: -- NOTES
1420: ---------------------------------------------------------------------
1421: PROCEDURE Send_Notification (
1422: p_api_version IN NUMBER
1423: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
1424: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
1425: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
1426:
1427: ,x_return_status OUT NOCOPY VARCHAR2
1420: ---------------------------------------------------------------------
1421: PROCEDURE Send_Notification (
1422: p_api_version IN NUMBER
1423: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
1424: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
1425: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
1426:
1427: ,x_return_status OUT NOCOPY VARCHAR2
1428: ,x_msg_data OUT NOCOPY VARCHAR2
1421: PROCEDURE Send_Notification (
1422: p_api_version IN NUMBER
1423: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
1424: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
1425: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
1426:
1427: ,x_return_status OUT NOCOPY VARCHAR2
1428: ,x_msg_data OUT NOCOPY VARCHAR2
1429: ,x_msg_count OUT NOCOPY NUMBER
1484: BEGIN
1485: -- Standard begin of API savepoint
1486: SAVEPOINT Send_Notification_PVT;
1487: -- Standard call to check for call compatibility.
1488: IF NOT FND_API.Compatible_API_Call (
1489: l_api_version,
1490: p_api_version,
1491: l_api_name,
1492: G_PKG_NAME)
1490: p_api_version,
1491: l_api_name,
1492: G_PKG_NAME)
1493: THEN
1494: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1495: END IF;
1496: -- Debug Message
1497: IF G_DEBUG THEN
1498: dpp_utility_pvt.debug_message( l_api_name||': Start');
1497: IF G_DEBUG THEN
1498: dpp_utility_pvt.debug_message( l_api_name||': Start');
1499: END IF;
1500: --Initialize message list if p_init_msg_list is TRUE.
1501: IF FND_API.To_Boolean (p_init_msg_list) THEN
1502: FND_MSG_PUB.initialize;
1503: END IF;
1504: -- Initialize API return status to sucess
1505: x_return_status := FND_API.G_RET_STS_SUCCESS;
1501: IF FND_API.To_Boolean (p_init_msg_list) THEN
1502: FND_MSG_PUB.initialize;
1503: END IF;
1504: -- Initialize API return status to sucess
1505: x_return_status := FND_API.G_RET_STS_SUCCESS;
1506:
1507: IF l_user_role is null THEN
1508: l_user_role := '%';
1509: ELSE
1620: from DPP_APPROVAL_ACCESS
1621: where object_type = l_object_type
1622: and object_id = l_object_id);
1623: --Standard check of commit
1624: IF FND_API.To_Boolean ( p_commit ) THEN
1625: COMMIT WORK;
1626: END IF;
1627:
1628: -- Debug Message
1630: dpp_utility_pvt.debug_message( l_api_name||': End');
1631: END IF;
1632: --Standard call to get message count and if count=1, get the message
1633: FND_MSG_PUB.Count_And_Get (
1634: p_encoded => FND_API.G_FALSE,
1635: p_count => x_msg_count,
1636: p_data => x_msg_data
1637: );
1638: EXCEPTION
1635: p_count => x_msg_count,
1636: p_data => x_msg_data
1637: );
1638: EXCEPTION
1639: WHEN FND_API.G_EXC_ERROR THEN
1640: ROLLBACK TO Send_Notification_PVT;
1641: x_return_status := FND_API.G_RET_STS_ERROR;
1642: -- Standard call to get message count and if count=1, get the message
1643: FND_MSG_PUB.Count_And_Get (
1637: );
1638: EXCEPTION
1639: WHEN FND_API.G_EXC_ERROR THEN
1640: ROLLBACK TO Send_Notification_PVT;
1641: x_return_status := FND_API.G_RET_STS_ERROR;
1642: -- Standard call to get message count and if count=1, get the message
1643: FND_MSG_PUB.Count_And_Get (
1644: p_encoded => FND_API.G_FALSE,
1645: p_count => x_msg_count,
1640: ROLLBACK TO Send_Notification_PVT;
1641: x_return_status := FND_API.G_RET_STS_ERROR;
1642: -- Standard call to get message count and if count=1, get the message
1643: FND_MSG_PUB.Count_And_Get (
1644: p_encoded => FND_API.G_FALSE,
1645: p_count => x_msg_count,
1646: p_data => x_msg_data
1647: );
1648: IF x_msg_count > 1 THEN
1649: FOR I IN 1..x_msg_count LOOP
1650: x_msg_data := SUBSTR((x_msg_data||' '|| FND_MSG_PUB.GET(P_MSG_INDEX => I, P_ENCODED => 'F')), 1, 4000);
1651: END LOOP;
1652: END IF;
1653: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1654: ROLLBACK TO Send_Notification_PVT;
1655: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1656: -- Standard call to get message count and if count=1, get the message
1657: FND_MSG_PUB.Count_And_Get (
1651: END LOOP;
1652: END IF;
1653: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1654: ROLLBACK TO Send_Notification_PVT;
1655: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1656: -- Standard call to get message count and if count=1, get the message
1657: FND_MSG_PUB.Count_And_Get (
1658: p_encoded => FND_API.G_FALSE,
1659: p_count => x_msg_count,
1654: ROLLBACK TO Send_Notification_PVT;
1655: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1656: -- Standard call to get message count and if count=1, get the message
1657: FND_MSG_PUB.Count_And_Get (
1658: p_encoded => FND_API.G_FALSE,
1659: p_count => x_msg_count,
1660: p_data => x_msg_data
1661: );
1662: IF x_msg_count > 1 THEN
1665: END LOOP;
1666: END IF;
1667: WHEN OTHERS THEN
1668: ROLLBACK TO Send_Notification_PVT;
1669: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1670: IF DPP_UNEXP_ERROR_ON
1671: THEN
1672: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1673: END IF;
1672: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1673: END IF;
1674: -- Standard call to get message count and if count=1, get the message
1675: FND_MSG_PUB.Count_And_Get (
1676: p_encoded => FND_API.G_FALSE,
1677: p_count => x_msg_count,
1678: p_data => x_msg_data
1679: );
1680: IF x_msg_count > 1 THEN
1698: -- 1. object_version_number will be set to 1.
1699: ---------------------------------------------------------------------
1700: PROCEDURE Process_User_Action (
1701: p_api_version IN NUMBER
1702: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
1703: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
1704: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
1705:
1706: ,x_return_status OUT NOCOPY VARCHAR2
1699: ---------------------------------------------------------------------
1700: PROCEDURE Process_User_Action (
1701: p_api_version IN NUMBER
1702: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
1703: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
1704: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
1705:
1706: ,x_return_status OUT NOCOPY VARCHAR2
1707: ,x_msg_data OUT NOCOPY VARCHAR2
1700: PROCEDURE Process_User_Action (
1701: p_api_version IN NUMBER
1702: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
1703: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
1704: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
1705:
1706: ,x_return_status OUT NOCOPY VARCHAR2
1707: ,x_msg_data OUT NOCOPY VARCHAR2
1708: ,x_msg_count OUT NOCOPY NUMBER
1713: )
1714: IS
1715: l_api_name CONSTANT VARCHAR2(80) := 'Process_User_Action';
1716: l_api_version CONSTANT NUMBER := 1.0;
1717: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
1718:
1719: l_approvers_tbl approvers_tbl_type;
1720: l_event_name VARCHAR2(240) ;
1721: l_event_key VARCHAR2(240);
1733: BEGIN
1734: -- Standard begin of API savepoint
1735: SAVEPOINT Process_User_Action_PVT;
1736: -- Standard call to check for call compatibility.
1737: IF NOT FND_API.Compatible_API_Call (
1738: l_api_version,
1739: p_api_version,
1740: l_api_name,
1741: G_PKG_NAME)
1739: p_api_version,
1740: l_api_name,
1741: G_PKG_NAME)
1742: THEN
1743: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1744: END IF;
1745: -- Debug Message
1746: IF G_DEBUG THEN
1747: dpp_utility_pvt.debug_message( l_api_name||': Start');
1746: IF G_DEBUG THEN
1747: dpp_utility_pvt.debug_message( l_api_name||': Start');
1748: END IF;
1749: --Initialize message list if p_init_msg_list is TRUE.
1750: IF FND_API.To_Boolean (p_init_msg_list) THEN
1751: FND_MSG_PUB.initialize;
1752: END IF;
1753: x_return_status := FND_API.G_RET_STS_SUCCESS;
1754:
1749: --Initialize message list if p_init_msg_list is TRUE.
1750: IF FND_API.To_Boolean (p_init_msg_list) THEN
1751: FND_MSG_PUB.initialize;
1752: END IF;
1753: x_return_status := FND_API.G_RET_STS_SUCCESS;
1754:
1755: --Retrieve the details of the transaction
1756: BEGIN
1757: SELECT transaction_number,
1768: fnd_message.set_token('ROUTINE', 'DPP_APPROVAL_PVT');
1769: fnd_message.set_token('ERRNO', sqlcode);
1770: fnd_message.set_token('REASON', 'Invalid Transaction Header ID');
1771: FND_MSG_PUB.add;
1772: RAISE FND_API.G_EXC_ERROR;
1773: WHEN OTHERS THEN
1774: fnd_message.set_name('FND', 'SQL_PLSQL_ERROR');
1775: fnd_message.set_token('ROUTINE', 'DPP_APPROVAL_PVT');
1776: fnd_message.set_token('ERRNO', sqlcode);
1775: fnd_message.set_token('ROUTINE', 'DPP_APPROVAL_PVT');
1776: fnd_message.set_token('ERRNO', sqlcode);
1777: fnd_message.set_token('REASON', sqlerrm);
1778: FND_MSG_PUB.add;
1779: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1780: END;
1781: -- Update AME/approval tbl of users action and revoke access to existing approvers
1782: IF p_approval_rec.action_code = 'APPROVE' OR
1783: p_approval_rec.action_code = 'REJECT' THEN
1787:
1788: -- Update_User_Action - Update the user action in approval table
1789: Update_User_Action(
1790: p_api_version => p_api_version
1791: ,p_init_msg_list => FND_API.G_FALSE
1792: ,p_validation_level => p_validation_level
1793: ,x_return_status => l_return_status
1794: ,x_msg_data => x_msg_data
1795: ,x_msg_count => x_msg_count
1794: ,x_msg_data => x_msg_data
1795: ,x_msg_count => x_msg_count
1796: ,p_approval_rec => p_approval_rec);
1797:
1798: IF l_return_status = FND_API.g_ret_sts_error THEN
1799: RAISE FND_API.g_exc_error;
1800: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1801: RAISE FND_API.g_exc_unexpected_error;
1802: END IF;
1795: ,x_msg_count => x_msg_count
1796: ,p_approval_rec => p_approval_rec);
1797:
1798: IF l_return_status = FND_API.g_ret_sts_error THEN
1799: RAISE FND_API.g_exc_error;
1800: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1801: RAISE FND_API.g_exc_unexpected_error;
1802: END IF;
1803:
1796: ,p_approval_rec => p_approval_rec);
1797:
1798: IF l_return_status = FND_API.g_ret_sts_error THEN
1799: RAISE FND_API.g_exc_error;
1800: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1801: RAISE FND_API.g_exc_unexpected_error;
1802: END IF;
1803:
1804: IF p_approval_rec.action_code = 'REJECT' THEN
1797:
1798: IF l_return_status = FND_API.g_ret_sts_error THEN
1799: RAISE FND_API.g_exc_error;
1800: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1801: RAISE FND_API.g_exc_unexpected_error;
1802: END IF;
1803:
1804: IF p_approval_rec.action_code = 'REJECT' THEN
1805: l_final_approval_flag := 'Y';
1815: END IF;
1816: -- Get_Approvers - List of Approvers or Default Approver
1817: Get_Approvers(
1818: p_api_version => p_api_version
1819: ,p_init_msg_list => FND_API.G_FALSE
1820: ,p_validation_level => p_validation_level
1821: ,x_return_status => l_return_status
1822: ,x_msg_data => x_msg_data
1823: ,x_msg_count => x_msg_count
1824: ,p_approval_rec => p_approval_rec
1825: ,x_approvers => l_approvers_tbl
1826: ,x_final_approval_flag => l_final_approval_flag);
1827:
1828: IF l_return_status = FND_API.g_ret_sts_error THEN
1829: RAISE FND_API.g_exc_error;
1830: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1831: RAISE FND_API.g_exc_unexpected_error;
1832: END IF;
1825: ,x_approvers => l_approvers_tbl
1826: ,x_final_approval_flag => l_final_approval_flag);
1827:
1828: IF l_return_status = FND_API.g_ret_sts_error THEN
1829: RAISE FND_API.g_exc_error;
1830: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1831: RAISE FND_API.g_exc_unexpected_error;
1832: END IF;
1833: END IF;
1826: ,x_final_approval_flag => l_final_approval_flag);
1827:
1828: IF l_return_status = FND_API.g_ret_sts_error THEN
1829: RAISE FND_API.g_exc_error;
1830: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1831: RAISE FND_API.g_exc_unexpected_error;
1832: END IF;
1833: END IF;
1834:
1827:
1828: IF l_return_status = FND_API.g_ret_sts_error THEN
1829: RAISE FND_API.g_exc_error;
1830: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1831: RAISE FND_API.g_exc_unexpected_error;
1832: END IF;
1833: END IF;
1834:
1835: -- Add access to users who have approval privileges
1844: if l_approvers_tbl(1).approver_id is not null then
1845: -- Add_Access - List Approvers sent from Get_Approvers api
1846: Add_Access(
1847: p_api_version => p_api_version
1848: ,p_init_msg_list => FND_API.G_FALSE
1849: ,p_commit => FND_API.G_FALSE
1850: ,p_validation_level => p_validation_level
1851: ,x_return_status => l_return_status
1852: ,x_msg_data => x_msg_data
1845: -- Add_Access - List Approvers sent from Get_Approvers api
1846: Add_Access(
1847: p_api_version => p_api_version
1848: ,p_init_msg_list => FND_API.G_FALSE
1849: ,p_commit => FND_API.G_FALSE
1850: ,p_validation_level => p_validation_level
1851: ,x_return_status => l_return_status
1852: ,x_msg_data => x_msg_data
1853: ,x_msg_count => x_msg_count
1853: ,x_msg_count => x_msg_count
1854: ,p_approval_rec => p_approval_rec
1855: ,p_approvers => l_approvers_tbl );
1856:
1857: IF l_return_status = FND_API.g_ret_sts_error THEN
1858: RAISE FND_API.g_exc_error;
1859: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1860: RAISE FND_API.g_exc_unexpected_error;
1861: END IF;
1854: ,p_approval_rec => p_approval_rec
1855: ,p_approvers => l_approvers_tbl );
1856:
1857: IF l_return_status = FND_API.g_ret_sts_error THEN
1858: RAISE FND_API.g_exc_error;
1859: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1860: RAISE FND_API.g_exc_unexpected_error;
1861: END IF;
1862: END IF; --End if some Approver is found
1855: ,p_approvers => l_approvers_tbl );
1856:
1857: IF l_return_status = FND_API.g_ret_sts_error THEN
1858: RAISE FND_API.g_exc_error;
1859: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1860: RAISE FND_API.g_exc_unexpected_error;
1861: END IF;
1862: END IF; --End if some Approver is found
1863:
1856:
1857: IF l_return_status = FND_API.g_ret_sts_error THEN
1858: RAISE FND_API.g_exc_error;
1859: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1860: RAISE FND_API.g_exc_unexpected_error;
1861: END IF;
1862: END IF; --End if some Approver is found
1863:
1864: END IF;
1914: last_update_login = l_login_id
1915: WHERE transaction_header_id = p_approval_rec.object_id;
1916:
1917: IF SQL%ROWCOUNT = 0 THEN
1918: x_return_status := FND_API.G_RET_STS_ERROR;
1919: DPP_UTILITY_PVT.debug_message('Unable to Update the column transaction_status in dpp_transaction_headers_all Table');
1920: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1921: END IF;
1922: EXCEPTION
1916:
1917: IF SQL%ROWCOUNT = 0 THEN
1918: x_return_status := FND_API.G_RET_STS_ERROR;
1919: DPP_UTILITY_PVT.debug_message('Unable to Update the column transaction_status in dpp_transaction_headers_all Table');
1920: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1921: END IF;
1922: EXCEPTION
1923: WHEN OTHERS THEN
1924: ROLLBACK;
1926: fnd_message.set_token('ROUTINE', 'DPP_APPROVAL_PVT');
1927: fnd_message.set_token('ERRNO', sqlcode);
1928: fnd_message.set_token('REASON', sqlerrm);
1929: FND_MSG_PUB.add;
1930: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1931: END;
1932: --Call the Initiate execution process program to make the transaction Active
1933: DPP_EXECUTIONPROCESS_PUB.Initiate_ExecutionProcess(errbuff,
1934: retcode,
1954: END IF;
1955: END IF; --l_effective_date <= sysdate
1956: END IF; --x_final_approval_flag := 'Y'
1957: --Standard check of commit
1958: IF FND_API.To_Boolean ( p_commit ) THEN
1959: COMMIT WORK;
1960: END IF;
1961: -- Debug Message
1962: IF G_DEBUG THEN
1963: dpp_utility_pvt.debug_message( l_api_name||': End');
1964: END IF;
1965: --Standard call to get message count and if count=1, get the message
1966: FND_MSG_PUB.Count_And_Get (
1967: p_encoded => FND_API.G_FALSE,
1968: p_count => x_msg_count,
1969: p_data => x_msg_data
1970: );
1971:
1969: p_data => x_msg_data
1970: );
1971:
1972: EXCEPTION
1973: WHEN FND_API.G_EXC_ERROR THEN
1974: ROLLBACK TO Process_User_Action_PVT;
1975: x_return_status := FND_API.G_RET_STS_ERROR;
1976: -- Standard call to get message count and if count=1, get the message
1977: FND_MSG_PUB.Count_And_Get (
1971:
1972: EXCEPTION
1973: WHEN FND_API.G_EXC_ERROR THEN
1974: ROLLBACK TO Process_User_Action_PVT;
1975: x_return_status := FND_API.G_RET_STS_ERROR;
1976: -- Standard call to get message count and if count=1, get the message
1977: FND_MSG_PUB.Count_And_Get (
1978: p_encoded => FND_API.G_FALSE,
1979: p_count => x_msg_count,
1974: ROLLBACK TO Process_User_Action_PVT;
1975: x_return_status := FND_API.G_RET_STS_ERROR;
1976: -- Standard call to get message count and if count=1, get the message
1977: FND_MSG_PUB.Count_And_Get (
1978: p_encoded => FND_API.G_FALSE,
1979: p_count => x_msg_count,
1980: p_data => x_msg_data
1981: );
1982: IF x_msg_count > 1 THEN
1983: FOR I IN 1..x_msg_count LOOP
1984: x_msg_data := SUBSTR((x_msg_data||' '|| FND_MSG_PUB.GET(P_MSG_INDEX => I, P_ENCODED => 'F')), 1, 4000);
1985: END LOOP;
1986: END IF;
1987: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1988: ROLLBACK TO Process_User_Action_PVT;
1989: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1990: -- Standard call to get message count and if count=1, get the message
1991: FND_MSG_PUB.Count_And_Get (
1985: END LOOP;
1986: END IF;
1987: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1988: ROLLBACK TO Process_User_Action_PVT;
1989: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1990: -- Standard call to get message count and if count=1, get the message
1991: FND_MSG_PUB.Count_And_Get (
1992: p_encoded => FND_API.G_FALSE,
1993: p_count => x_msg_count,
1988: ROLLBACK TO Process_User_Action_PVT;
1989: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1990: -- Standard call to get message count and if count=1, get the message
1991: FND_MSG_PUB.Count_And_Get (
1992: p_encoded => FND_API.G_FALSE,
1993: p_count => x_msg_count,
1994: p_data => x_msg_data
1995: );
1996: IF x_msg_count > 1 THEN
1999: END LOOP;
2000: END IF;
2001: WHEN OTHERS THEN
2002: ROLLBACK TO Process_User_Action_PVT;
2003: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2004: IF DPP_UNEXP_ERROR_ON
2005: THEN
2006: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2007: END IF;
2006: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2007: END IF;
2008: -- Standard call to get message count and if count=1, get the message
2009: FND_MSG_PUB.Count_And_Get (
2010: p_encoded => FND_API.G_FALSE,
2011: p_count => x_msg_count,
2012: p_data => x_msg_data
2013: );
2014: IF x_msg_count > 1 THEN