4: G_PKG_NAME CONSTANT VARCHAR2(30):='CN_PRD_QUOTA_PUB';
5:
6: PROCEDURE distribute_target (
7: p_api_version IN NUMBER,
8: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
9: p_commit IN VARCHAR2 := fnd_api.g_false,
10: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
11: p_quota_id IN NUMBER,
12: x_return_status OUT NOCOPY VARCHAR2,
5:
6: PROCEDURE distribute_target (
7: p_api_version IN NUMBER,
8: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
9: p_commit IN VARCHAR2 := fnd_api.g_false,
10: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
11: p_quota_id IN NUMBER,
12: x_return_status OUT NOCOPY VARCHAR2,
13: x_msg_count OUT NOCOPY NUMBER,
6: PROCEDURE distribute_target (
7: p_api_version IN NUMBER,
8: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
9: p_commit IN VARCHAR2 := fnd_api.g_false,
10: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
11: p_quota_id IN NUMBER,
12: x_return_status OUT NOCOPY VARCHAR2,
13: x_msg_count OUT NOCOPY NUMBER,
14: x_msg_data OUT NOCOPY VARCHAR2
81: -- Standard Start of API savepoint
82: SAVEPOINT get_prd_quota_year;
83:
84: -- Standard call to check for call compatibility.
85: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
86: THEN
87: RAISE fnd_api.g_exc_unexpected_error;
88: END IF;
89:
83:
84: -- Standard call to check for call compatibility.
85: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
86: THEN
87: RAISE fnd_api.g_exc_unexpected_error;
88: END IF;
89:
90: -- Initialize message list if p_init_msg_list is set to TRUE.
91: IF fnd_api.to_boolean (p_init_msg_list)
87: RAISE fnd_api.g_exc_unexpected_error;
88: END IF;
89:
90: -- Initialize message list if p_init_msg_list is set to TRUE.
91: IF fnd_api.to_boolean (p_init_msg_list)
92: THEN
93: fnd_msg_pub.initialize;
94: END IF;
95:
93: fnd_msg_pub.initialize;
94: END IF;
95:
96: -- Initialize API return status to success
97: x_return_status := fnd_api.g_ret_sts_success;
98:
99: -- API body
100: SELECT NVL (q.target, 0),
101: NVL (q.payment_amount, 0),
170: END LOOP;
171:
172: -- End of API body.
173: -- Standard check of p_commit.
174: IF fnd_api.to_boolean (p_commit)
175: THEN
176: COMMIT WORK;
177: END IF;
178:
176: COMMIT WORK;
177: END IF;
178:
179: -- Standard call to get message count and if count is 1, get message info.
180: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
181: EXCEPTION
182: WHEN fnd_api.g_exc_error
183: THEN
184: ROLLBACK TO get_prd_quota_year;
178:
179: -- Standard call to get message count and if count is 1, get message info.
180: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
181: EXCEPTION
182: WHEN fnd_api.g_exc_error
183: THEN
184: ROLLBACK TO get_prd_quota_year;
185: x_return_status := fnd_api.g_ret_sts_error;
186: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
181: EXCEPTION
182: WHEN fnd_api.g_exc_error
183: THEN
184: ROLLBACK TO get_prd_quota_year;
185: x_return_status := fnd_api.g_ret_sts_error;
186: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
187: WHEN fnd_api.g_exc_unexpected_error
188: THEN
189: ROLLBACK TO get_prd_quota_year;
182: WHEN fnd_api.g_exc_error
183: THEN
184: ROLLBACK TO get_prd_quota_year;
185: x_return_status := fnd_api.g_ret_sts_error;
186: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
187: WHEN fnd_api.g_exc_unexpected_error
188: THEN
189: ROLLBACK TO get_prd_quota_year;
190: x_return_status := fnd_api.g_ret_sts_unexp_error;
183: THEN
184: ROLLBACK TO get_prd_quota_year;
185: x_return_status := fnd_api.g_ret_sts_error;
186: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
187: WHEN fnd_api.g_exc_unexpected_error
188: THEN
189: ROLLBACK TO get_prd_quota_year;
190: x_return_status := fnd_api.g_ret_sts_unexp_error;
191: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
186: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
187: WHEN fnd_api.g_exc_unexpected_error
188: THEN
189: ROLLBACK TO get_prd_quota_year;
190: x_return_status := fnd_api.g_ret_sts_unexp_error;
191: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
192: WHEN OTHERS
193: THEN
194: ROLLBACK TO get_prd_quota_year;
187: WHEN fnd_api.g_exc_unexpected_error
188: THEN
189: ROLLBACK TO get_prd_quota_year;
190: x_return_status := fnd_api.g_ret_sts_unexp_error;
191: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
192: WHEN OTHERS
193: THEN
194: ROLLBACK TO get_prd_quota_year;
195: x_return_status := fnd_api.g_ret_sts_unexp_error;
191: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
192: WHEN OTHERS
193: THEN
194: ROLLBACK TO get_prd_quota_year;
195: x_return_status := fnd_api.g_ret_sts_unexp_error;
196:
197: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
198: THEN
199: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
198: THEN
199: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
200: END IF;
201:
202: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
203: END distribute_target;
204:
205:
206: PROCEDURE Distribute_Prd_Quota
290: BEGIN
291: -- Standard Start of API savepoint
292: SAVEPOINT Distribute_Prd_Quota;
293: -- Standard call to check for call compatibility.
294: IF NOT FND_API.Compatible_API_Call
295: (l_api_version ,
296: p_api_version ,
297: l_api_name ,
298: G_PKG_NAME )
296: p_api_version ,
297: l_api_name ,
298: G_PKG_NAME )
299: THEN
300: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
301: END IF;
302: -- Initialize message list if p_init_msg_list is set to TRUE.
303: IF FND_API.to_Boolean( p_init_msg_list ) THEN
304: FND_MSG_PUB.initialize;
299: THEN
300: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
301: END IF;
302: -- Initialize message list if p_init_msg_list is set to TRUE.
303: IF FND_API.to_Boolean( p_init_msg_list ) THEN
304: FND_MSG_PUB.initialize;
305: END IF;
306: -- Initialize API return status to success
307: x_return_status := FND_API.G_RET_STS_SUCCESS;
303: IF FND_API.to_Boolean( p_init_msg_list ) THEN
304: FND_MSG_PUB.initialize;
305: END IF;
306: -- Initialize API return status to success
307: x_return_status := FND_API.G_RET_STS_SUCCESS;
308: -- API body
309:
310: -- 1. IF the PE concerned exists.
311:
315: FND_MESSAGE.SET_NAME ('CN' , 'CN_INPUT_CANT_NULL');
316: FND_MESSAGE.SET_TOKEN('INPUT_NAME', cn_api.get_lkup_meaning('PE_NAME', 'INPUT_TOKEN'));
317: FND_MSG_PUB.Add;
318: END IF;
319: RAISE FND_API.G_EXC_ERROR ;
320: END IF;
321:
322:
323: -- Validate and default org id
344: FND_MESSAGE.SET_NAME ('CN' , 'CN_PLN_NOT_EXIST');
345: FND_MESSAGE.SET_TOKEN ('PE_NAME' , p_pe_name);
346: FND_MSG_PUB.Add;
347: END IF;
348: RAISE FND_API.G_EXC_ERROR ;
349: END IF;
350:
351: CLOSE l_quota_id_cr;
352:
659: FND_MESSAGE.SET_NAME ('CN' , 'CN_INPUT_CANT_NULL');
660: FND_MESSAGE.SET_TOKEN('INPUT_NAME', cn_api.get_lkup_meaning('PERIOD_NAME', 'INPUT_TOKEN'));
661: FND_MSG_PUB.Add;
662: END IF;
663: RAISE FND_API.G_EXC_ERROR ;
664: END IF;
665:
666: OPEN l_period_id_cr(p_prd_quota_tbl(i).period_name);
667: FETCH l_period_id_cr into f_period_id_rec;
670: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
671: FND_MESSAGE.SET_NAME ('CN' , 'CN_PERIOD_NOT_FOUND');
672: FND_MSG_PUB.Add;
673: END IF;
674: RAISE FND_API.G_EXC_ERROR ;
675: END IF;
676:
677: CLOSE l_period_id_cr;
678:
687: FND_MESSAGE.SET_TOKEN ('PERIOD_NAME' , p_prd_quota_tbl(i).period_name);
688: FND_MESSAGE.SET_TOKEN ('PLAN_NAME' , p_pe_name);
689: FND_MSG_PUB.Add;
690: END IF;
691: RAISE FND_API.G_EXC_ERROR ;
692: END IF;
693:
694: CLOSE tbl_period_quota_info_cr;
695:
733:
734:
735: -- End of API body.
736: -- Standard check of p_commit.
737: IF FND_API.To_Boolean( p_commit ) THEN
738: COMMIT WORK;
739: END IF;
740: -- Standard call to get message count and if count is 1, get message info.
741: FND_MSG_PUB.Count_And_Get
740: -- Standard call to get message count and if count is 1, get message info.
741: FND_MSG_PUB.Count_And_Get
742: (p_count => x_msg_count ,
743: p_data => x_msg_data ,
744: p_encoded => FND_API.G_FALSE );
745: EXCEPTION
746: WHEN FND_API.G_EXC_ERROR THEN
747: ROLLBACK TO Distribute_Prd_Quota;
748: x_return_status := FND_API.G_RET_STS_ERROR ;
742: (p_count => x_msg_count ,
743: p_data => x_msg_data ,
744: p_encoded => FND_API.G_FALSE );
745: EXCEPTION
746: WHEN FND_API.G_EXC_ERROR THEN
747: ROLLBACK TO Distribute_Prd_Quota;
748: x_return_status := FND_API.G_RET_STS_ERROR ;
749: FND_MSG_PUB.Count_And_Get
750: (p_count => x_msg_count ,
744: p_encoded => FND_API.G_FALSE );
745: EXCEPTION
746: WHEN FND_API.G_EXC_ERROR THEN
747: ROLLBACK TO Distribute_Prd_Quota;
748: x_return_status := FND_API.G_RET_STS_ERROR ;
749: FND_MSG_PUB.Count_And_Get
750: (p_count => x_msg_count ,
751: p_data => x_msg_data ,
752: p_encoded => FND_API.G_FALSE );
748: x_return_status := FND_API.G_RET_STS_ERROR ;
749: FND_MSG_PUB.Count_And_Get
750: (p_count => x_msg_count ,
751: p_data => x_msg_data ,
752: p_encoded => FND_API.G_FALSE );
753: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
754: ROLLBACK TO Distribute_Prd_Quota;
755: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
756: FND_MSG_PUB.Count_And_Get
749: FND_MSG_PUB.Count_And_Get
750: (p_count => x_msg_count ,
751: p_data => x_msg_data ,
752: p_encoded => FND_API.G_FALSE );
753: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
754: ROLLBACK TO Distribute_Prd_Quota;
755: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
756: FND_MSG_PUB.Count_And_Get
757: (p_count => x_msg_count ,
751: p_data => x_msg_data ,
752: p_encoded => FND_API.G_FALSE );
753: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
754: ROLLBACK TO Distribute_Prd_Quota;
755: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
756: FND_MSG_PUB.Count_And_Get
757: (p_count => x_msg_count ,
758: p_data => x_msg_data ,
759: p_encoded => FND_API.G_FALSE );
755: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
756: FND_MSG_PUB.Count_And_Get
757: (p_count => x_msg_count ,
758: p_data => x_msg_data ,
759: p_encoded => FND_API.G_FALSE );
760: WHEN OTHERS THEN
761: ROLLBACK TO Distribute_Prd_Quota;
762: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
763: IF FND_MSG_PUB.Check_Msg_Level
758: p_data => x_msg_data ,
759: p_encoded => FND_API.G_FALSE );
760: WHEN OTHERS THEN
761: ROLLBACK TO Distribute_Prd_Quota;
762: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
763: IF FND_MSG_PUB.Check_Msg_Level
764: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
765: THEN
766: FND_MSG_PUB.Add_Exc_Msg
769: END IF;
770: FND_MSG_PUB.Count_And_Get
771: (p_count => x_msg_count ,
772: p_data => x_msg_data ,
773: p_encoded => FND_API.G_FALSE );
774: END Distribute_Prd_Quota;
775:
776:
777: END CN_PRD_QUOTA_PUB;