1: PACKAGE BODY OZF_QUOTA_PUB AS
2: /* $Header: OZFPQUOB.pls 120.5 2006/06/01 15:23:09 mgudivak noship $ */
3:
4: g_pkg_name CONSTANT VARCHAR2(30) := 'OZF_QUOTA_PUB';
5: G_DEBUG BOOLEAN := FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_debug_high);
6:
7: PROCEDURE generate_product_spread(
8: p_api_version IN NUMBER
9: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
53:
54: IF p_period_type_id IS NULL OR p_period_type_id NOT IN (32,64)
55: THEN
56: --
57: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
58: THEN
59: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_PERIOD');
60: fnd_message.set_token('VALUE', p_period_type_id);
61: fnd_msg_pub.add;
57: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
58: THEN
59: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_PERIOD');
60: fnd_message.set_token('VALUE', p_period_type_id);
61: fnd_msg_pub.add;
62: END IF;
63: x_return_status := fnd_api.g_ret_sts_error;
64: ELSE
65:
75: END IF;
76:
77: IF l_time_id IS NULL
78: THEN
79: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
80: THEN
81: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_TIMEID');
82: fnd_message.set_token('VALUE', p_time_id);
83: fnd_msg_pub.add;
79: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
80: THEN
81: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_TIMEID');
82: fnd_message.set_token('VALUE', p_time_id);
83: fnd_msg_pub.add;
84: END IF;
85: x_return_status := fnd_api.g_ret_sts_error;
86: END IF;
87:
234: OR
235: p_quota_rec.short_name IS NULL
236: THEN
237: --
238: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
239: THEN
240: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
241: fnd_message.set_token('COL_NAME','SHORT_NAME');
242: fnd_msg_pub.add;
238: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
239: THEN
240: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
241: fnd_message.set_token('COL_NAME','SHORT_NAME');
242: fnd_msg_pub.add;
243: END IF;
244: x_return_status := fnd_api.g_ret_sts_error;
245: END IF;
246:
249: OR
250: p_quota_rec.custom_setup_id IS NULL
251: THEN
252: --
253: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
254: THEN
255: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
256: fnd_message.set_token('COL_NAME','CUSTOM_SETUP_ID');
257: fnd_msg_pub.add;
253: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
254: THEN
255: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
256: fnd_message.set_token('COL_NAME','CUSTOM_SETUP_ID');
257: fnd_msg_pub.add;
258: END IF;
259: x_return_status := fnd_api.g_ret_sts_error;
260: END IF;
261:
264: OR
265: p_quota_rec.user_status_id IS NULL
266: THEN
267: --
268: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
269: THEN
270: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
271: fnd_message.set_token('COL_NAME','USER_STATUS_ID');
272: fnd_msg_pub.add;
268: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
269: THEN
270: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
271: fnd_message.set_token('COL_NAME','USER_STATUS_ID');
272: fnd_msg_pub.add;
273: END IF;
274: x_return_status := fnd_api.g_ret_sts_error;
275: END IF;
276:
279: OR
280: p_quota_rec.start_period_name IS NULL
281: THEN
282: --
283: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
284: THEN
285: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
286: fnd_message.set_token('COL_NAME','START_PERIOD_NAME');
287: fnd_msg_pub.add;
283: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
284: THEN
285: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
286: fnd_message.set_token('COL_NAME','START_PERIOD_NAME');
287: fnd_msg_pub.add;
288: END IF;
289: x_return_status := fnd_api.g_ret_sts_error;
290: END IF;
291:
294: OR
295: p_quota_rec.start_period_name IS NULL
296: THEN
297: --
298: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
299: THEN
300: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
301: fnd_message.set_token('COL_NAME','END_PERIOD_NAME');
302: fnd_msg_pub.add;
298: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
299: THEN
300: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
301: fnd_message.set_token('COL_NAME','END_PERIOD_NAME');
302: fnd_msg_pub.add;
303: END IF;
304: x_return_status := fnd_api.g_ret_sts_error;
305: END IF;
306:
309: OR
310: p_quota_rec.quota_amount IS NULL
311: THEN
312: --
313: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
314: THEN
315: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
316: fnd_message.set_token('COL_NAME','QUOTA_AMOUNT');
317: fnd_msg_pub.add;
313: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
314: THEN
315: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
316: fnd_message.set_token('COL_NAME','QUOTA_AMOUNT');
317: fnd_msg_pub.add;
318: END IF;
319: x_return_status := fnd_api.g_ret_sts_error;
320: END IF;
321:
324: OR
325: p_quota_rec.owner IS NULL
326: THEN
327: --
328: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
329: THEN
330: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
331: fnd_message.set_token('COL_NAME','OWNER');
332: fnd_msg_pub.add;
328: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
329: THEN
330: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
331: fnd_message.set_token('COL_NAME','OWNER');
332: fnd_msg_pub.add;
333: END IF;
334: x_return_status := fnd_api.g_ret_sts_error;
335: END IF;
336:
339: OR
340: p_quota_rec.product_spread_time_id IS NULL
341: THEN
342: --
343: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
344: THEN
345: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
346: fnd_message.set_token('COL_NAME','PRODUCT_SPREAD_TIME_ID');
347: fnd_msg_pub.add;
343: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
344: THEN
345: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
346: fnd_message.set_token('COL_NAME','PRODUCT_SPREAD_TIME_ID');
347: fnd_msg_pub.add;
348: END IF;
349: x_return_status := fnd_api.g_ret_sts_error;
350: END IF;
351:
371: --
372: IF p_method = 'ALLOCATE'
373: THEN
374: --
375: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
376: THEN
377: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
378: fnd_message.set_token('COL_NAME', 'PARENT_QUOTA_ID');
379: fnd_msg_pub.add;
375: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
376: THEN
377: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
378: fnd_message.set_token('COL_NAME', 'PARENT_QUOTA_ID');
379: fnd_msg_pub.add;
380: END IF;
381: x_return_status := fnd_api.g_ret_sts_error;
382: RETURN;
383: --
389:
390: IF l_quota_exists IS NULL
391: THEN
392: --
393: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
394: THEN
395: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
396: fnd_message.set_token('COL_NAME', 'PARENT_QUOTA_ID');
397: fnd_msg_pub.add;
393: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
394: THEN
395: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
396: fnd_message.set_token('COL_NAME', 'PARENT_QUOTA_ID');
397: fnd_msg_pub.add;
398: END IF;
399: x_return_status := fnd_api.g_ret_sts_error;
400: RETURN;
401: END IF;
414: CLOSE c_custom_setup_exists;
415:
416: IF l_custom_setup_exists IS NULL
417: THEN
418: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
419: THEN
420: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
421: fnd_message.set_token('COL_NAME', 'CUSTOM_SETUP_ID');
422: fnd_msg_pub.add;
418: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
419: THEN
420: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
421: fnd_message.set_token('COL_NAME', 'CUSTOM_SETUP_ID');
422: fnd_msg_pub.add;
423: END IF;
424: x_return_status := fnd_api.g_ret_sts_error;
425: RETURN;
426: END IF;
437: CLOSE c_user_status_id;
438:
439: IF l_status_code IS NULL
440: THEN
441: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
442: THEN
443: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
444: fnd_message.set_token('COL_NAME', 'USER_STATUS_ID');
445: fnd_msg_pub.add;
441: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
442: THEN
443: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
444: fnd_message.set_token('COL_NAME', 'USER_STATUS_ID');
445: fnd_msg_pub.add;
446: END IF;
447: x_return_status := fnd_api.g_ret_sts_error;
448: RETURN;
449: END IF;
460: CLOSE c_period_exists;
461:
462: IF l_start_date_active IS NULL
463: THEN
464: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
465: THEN
466: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
467: fnd_message.set_token('COL_NAME', 'START_PERIOD_NAME');
468: fnd_msg_pub.add;
464: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
465: THEN
466: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
467: fnd_message.set_token('COL_NAME', 'START_PERIOD_NAME');
468: fnd_msg_pub.add;
469: END IF;
470: x_return_status := fnd_api.g_ret_sts_error;
471: RETURN;
472: END IF;
483: CLOSE c_period_exists;
484:
485: IF l_end_date_active IS NULL
486: THEN
487: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
488: THEN
489: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
490: fnd_message.set_token('COL_NAME', 'END_PERIOD_NAME');
491: fnd_msg_pub.add;
487: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
488: THEN
489: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
490: fnd_message.set_token('COL_NAME', 'END_PERIOD_NAME');
491: fnd_msg_pub.add;
492: END IF;
493: x_return_status := fnd_api.g_ret_sts_error;
494: RETURN;
495: END IF;
503: THEN
504:
505: IF p_quota_rec.product_spread_time_id NOT IN ('32', '64')
506: THEN
507: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
508: THEN
509: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
510: fnd_message.set_token('COL_NAME', 'PRODUCT_SPREAD_TIME_ID');
511: fnd_msg_pub.add;
507: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
508: THEN
509: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
510: fnd_message.set_token('COL_NAME', 'PRODUCT_SPREAD_TIME_ID');
511: fnd_msg_pub.add;
512: END IF;
513: x_return_status := fnd_api.g_ret_sts_error;
514: RETURN;
515: END IF;
536: CLOSE c_resource_exists;
537:
538: IF l_owner_exists IS NULL
539: THEN
540: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
541: THEN
542: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
543: fnd_message.set_token('COL_NAME', 'OWNER');
544: fnd_msg_pub.add;
540: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
541: THEN
542: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
543: fnd_message.set_token('COL_NAME', 'OWNER');
544: fnd_msg_pub.add;
545: END IF;
546: x_return_status := fnd_api.g_ret_sts_error;
547: RETURN;
548: END IF;
561:
562: IF l_threshold_exists IS NULL
563: THEN
564: --
565: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
566: THEN
567: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
568: fnd_message.set_token('COL_NAME', 'THRESHOLD_ID');
569: fnd_msg_pub.add;
565: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
566: THEN
567: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
568: fnd_message.set_token('COL_NAME', 'THRESHOLD_ID');
569: fnd_msg_pub.add;
570: END IF;
571: x_return_status := fnd_api.g_ret_sts_error;
572: RETURN;
573: END IF;
584: AND
585: (p_quota_rec.quota_number = fnd_api.g_miss_char OR p_quota_rec.quota_number IS NULL)
586: THEN
587:
588: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
589: fnd_message.set_name('OZF', 'OZF_NO_QUOTA_ID_NUM');
590: fnd_msg_pub.add;
591: END IF;
592: x_return_status := fnd_api.g_ret_sts_error;
586: THEN
587:
588: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
589: fnd_message.set_name('OZF', 'OZF_NO_QUOTA_ID_NUM');
590: fnd_msg_pub.add;
591: END IF;
592: x_return_status := fnd_api.g_ret_sts_error;
593: RETURN;
594:
603: FETCH c_quota_exists INTO l_quota_exists;
604: CLOSE c_quota_exists;
605:
606: IF l_quota_exists IS NULL THEN
607: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
608: fnd_message.set_name('OZF', 'OZF_INVALID_QUOTA_ID');
609: fnd_msg_pub.add;
610: END IF;
611: x_return_status := fnd_api.g_ret_sts_error;
605:
606: IF l_quota_exists IS NULL THEN
607: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
608: fnd_message.set_name('OZF', 'OZF_INVALID_QUOTA_ID');
609: fnd_msg_pub.add;
610: END IF;
611: x_return_status := fnd_api.g_ret_sts_error;
612: RETURN;
613: END IF;
619: FETCH c_quota_num_exists INTO p_quota_rec.quota_id;
620: CLOSE c_quota_num_exists;
621:
622: IF p_quota_rec.quota_id IS NULL THEN
623: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
624: fnd_message.set_name('OZF', 'OZF_INVALID_QUOTA_NUM');
625: fnd_msg_pub.add;
626: END IF;
627: x_return_status := fnd_api.g_ret_sts_error;
621:
622: IF p_quota_rec.quota_id IS NULL THEN
623: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
624: fnd_message.set_name('OZF', 'OZF_INVALID_QUOTA_NUM');
625: fnd_msg_pub.add;
626: END IF;
627: x_return_status := fnd_api.g_ret_sts_error;
628: RETURN;
629: END IF;
702: --
703: IF l_quota_products_rec.item_type NOT IN ('PRODUCT','FAMILY')
704: THEN
705: --
706: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
707: THEN
708: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
709: fnd_message.set_token('COL_NAME', 'ITEM_TYPE');
710: fnd_msg_pub.add;
706: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
707: THEN
708: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
709: fnd_message.set_token('COL_NAME', 'ITEM_TYPE');
710: fnd_msg_pub.add;
711: END IF;
712: x_return_status := fnd_api.g_ret_sts_error;
713: RETURN;
714: ELSE
726: END IF;
727: --
728: ELSE
729: --
730: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
731: THEN
732: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
733: fnd_message.set_token('COL_NAME','ITEM_TYPE');
734: fnd_msg_pub.add;
730: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
731: THEN
732: fnd_message.set_name('OZF', 'OZF_QUOTA_MISSING_COL_VALUE');
733: fnd_message.set_token('COL_NAME','ITEM_TYPE');
734: fnd_msg_pub.add;
735: END IF;
736: x_return_status := fnd_api.g_ret_sts_error;
737: --
738: END IF;
746: EXCEPTION
747:
748: WHEN FND_API.G_EXC_ERROR THEN
749: x_return_status := FND_API.G_RET_STS_ERROR ;
750: FND_MSG_PUB.Count_And_Get
751: ( P_count => x_msg_count,
752: P_data => x_msg_data
753: );
754:
753: );
754:
755: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
756: X_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
757: FND_MSG_PUB.Count_And_Get
758: ( p_count => x_msg_count,
759: p_data => x_msg_data
760: );
761:
760: );
761:
762: WHEN OTHERS THEN
763: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
764: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )
765: THEN
766: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,
767: 'Others exception inside Validate_Product_Record'
768: || sqlerrm);
762: WHEN OTHERS THEN
763: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
764: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )
765: THEN
766: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,
767: 'Others exception inside Validate_Product_Record'
768: || sqlerrm);
769: END IF;
770:
929:
930: EXCEPTION
931: WHEN FND_API.G_EXC_ERROR THEN
932: x_return_status := FND_API.G_RET_STS_ERROR ;
933: FND_MSG_PUB.Count_And_Get
934: ( P_count => x_msg_count,
935: P_data => x_msg_data
936: );
937:
936: );
937:
938: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
939: X_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
940: FND_MSG_PUB.Count_And_Get
941: ( p_count => x_msg_count,
942: p_data => x_msg_data
943: );
944:
943: );
944:
945: WHEN OTHERS THEN
946: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
947: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )
948: THEN
949: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,
950: 'Others exception inside Create_Quota_Header'
951: || sqlerrm);
945: WHEN OTHERS THEN
946: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
947: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )
948: THEN
949: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,
950: 'Others exception inside Create_Quota_Header'
951: || sqlerrm);
952: END IF;
953:
1053: --if both quota id and quota number are null, then raise exception
1054: IF (p_alloc_rec.quota_id = fnd_api.g_miss_num OR p_alloc_rec.quota_id IS NULL) AND
1055: (p_alloc_rec.quota_number = fnd_api.g_miss_char OR p_alloc_rec.quota_number IS NULL) THEN
1056:
1057: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1058: fnd_message.set_name('OZF', 'OZF_NO_QUOTA_ID_NUM');
1059: fnd_msg_pub.add;
1060: END IF;
1061: x_return_status := fnd_api.g_ret_sts_error;
1055: (p_alloc_rec.quota_number = fnd_api.g_miss_char OR p_alloc_rec.quota_number IS NULL) THEN
1056:
1057: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1058: fnd_message.set_name('OZF', 'OZF_NO_QUOTA_ID_NUM');
1059: fnd_msg_pub.add;
1060: END IF;
1061: x_return_status := fnd_api.g_ret_sts_error;
1062: RETURN;
1063:
1070: FETCH c_quota_exists INTO l_quota_exists;
1071: CLOSE c_quota_exists;
1072:
1073: IF l_quota_exists IS NULL THEN
1074: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1075: fnd_message.set_name('OZF', 'OZF_INVALID_QUOTA_ID');
1076: fnd_msg_pub.add;
1077: END IF;
1078: x_return_status := fnd_api.g_ret_sts_error;
1072:
1073: IF l_quota_exists IS NULL THEN
1074: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1075: fnd_message.set_name('OZF', 'OZF_INVALID_QUOTA_ID');
1076: fnd_msg_pub.add;
1077: END IF;
1078: x_return_status := fnd_api.g_ret_sts_error;
1079: RETURN;
1080: END IF;
1086: FETCH c_quota_num_exists INTO p_alloc_rec.quota_id;
1087: CLOSE c_quota_num_exists;
1088:
1089: IF p_alloc_rec.quota_id IS NULL THEN
1090: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1091: fnd_message.set_name('OZF', 'OZF_INVALID_QUOTA_NUM');
1092: fnd_msg_pub.add;
1093: END IF;
1094: x_return_status := fnd_api.g_ret_sts_error;
1088:
1089: IF p_alloc_rec.quota_id IS NULL THEN
1090: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1091: fnd_message.set_name('OZF', 'OZF_INVALID_QUOTA_NUM');
1092: fnd_msg_pub.add;
1093: END IF;
1094: x_return_status := fnd_api.g_ret_sts_error;
1095: RETURN;
1096: END IF;
1098: END IF;
1099:
1100: --if hierarchy id is null, then raise exception
1101: IF p_alloc_rec.hierarchy_id = fnd_api.g_miss_num OR p_alloc_rec.hierarchy_id IS NULL THEN
1102: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1103: fnd_message.set_name('OZF', 'OZF_NO_HIER_ID');
1104: fnd_msg_pub.add;
1105: END IF;
1106: x_return_status := fnd_api.g_ret_sts_error;
1100: --if hierarchy id is null, then raise exception
1101: IF p_alloc_rec.hierarchy_id = fnd_api.g_miss_num OR p_alloc_rec.hierarchy_id IS NULL THEN
1102: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1103: fnd_message.set_name('OZF', 'OZF_NO_HIER_ID');
1104: fnd_msg_pub.add;
1105: END IF;
1106: x_return_status := fnd_api.g_ret_sts_error;
1107: RETURN;
1108: ELSE
1111: FETCH c_hier_id_exists INTO p_alloc_rec.hierarchy_id;
1112: CLOSE c_hier_id_exists;
1113:
1114: IF p_alloc_rec.hierarchy_id IS NULL THEN
1115: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1116: fnd_message.set_name('OZF', 'OZF_INVALID_HIER_ID');
1117: fnd_msg_pub.add;
1118: END IF;
1119: x_return_status := fnd_api.g_ret_sts_error;
1113:
1114: IF p_alloc_rec.hierarchy_id IS NULL THEN
1115: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1116: fnd_message.set_name('OZF', 'OZF_INVALID_HIER_ID');
1117: fnd_msg_pub.add;
1118: END IF;
1119: x_return_status := fnd_api.g_ret_sts_error;
1120: RETURN;
1121: END IF;
1122: END IF;
1123:
1124: --if from level is null, then raise exception
1125: IF p_alloc_rec.from_level = fnd_api.g_miss_num OR p_alloc_rec.from_level IS NULL THEN
1126: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1127: fnd_message.set_name('OZF', 'OZF_NO_FROM_LEVEL');
1128: fnd_msg_pub.add;
1129: END IF;
1130: x_return_status := fnd_api.g_ret_sts_error;
1124: --if from level is null, then raise exception
1125: IF p_alloc_rec.from_level = fnd_api.g_miss_num OR p_alloc_rec.from_level IS NULL THEN
1126: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1127: fnd_message.set_name('OZF', 'OZF_NO_FROM_LEVEL');
1128: fnd_msg_pub.add;
1129: END IF;
1130: x_return_status := fnd_api.g_ret_sts_error;
1131: RETURN;
1132: ELSE
1135: FETCH c_from_level_exists INTO p_alloc_rec.from_level;
1136: CLOSE c_from_level_exists;
1137:
1138: IF p_alloc_rec.from_level IS NULL THEN
1139: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1140: fnd_message.set_name('OZF', 'OZF_INVALID_FROM_LEVEL');
1141: fnd_msg_pub.add;
1142: END IF;
1143: x_return_status := fnd_api.g_ret_sts_error;
1137:
1138: IF p_alloc_rec.from_level IS NULL THEN
1139: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1140: fnd_message.set_name('OZF', 'OZF_INVALID_FROM_LEVEL');
1141: fnd_msg_pub.add;
1142: END IF;
1143: x_return_status := fnd_api.g_ret_sts_error;
1144: RETURN;
1145: END IF;
1146: END IF;
1147:
1148: --if to level is null, then raise exception
1149: IF p_alloc_rec.to_level = fnd_api.g_miss_num OR p_alloc_rec.to_level IS NULL THEN
1150: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1151: fnd_message.set_name('OZF', 'OZF_NO_TO_LEVEL');
1152: fnd_msg_pub.add;
1153: END IF;
1154: x_return_status := fnd_api.g_ret_sts_error;
1148: --if to level is null, then raise exception
1149: IF p_alloc_rec.to_level = fnd_api.g_miss_num OR p_alloc_rec.to_level IS NULL THEN
1150: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1151: fnd_message.set_name('OZF', 'OZF_NO_TO_LEVEL');
1152: fnd_msg_pub.add;
1153: END IF;
1154: x_return_status := fnd_api.g_ret_sts_error;
1155: RETURN;
1156: ELSE
1159: FETCH c_to_level_exists INTO p_alloc_rec.to_level;
1160: CLOSE c_to_level_exists;
1161:
1162: IF p_alloc_rec.to_level IS NULL THEN
1163: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1164: fnd_message.set_name('OZF', 'OZF_INVALID_TO_LEVEL');
1165: fnd_msg_pub.add;
1166: END IF;
1167: x_return_status := fnd_api.g_ret_sts_error;
1161:
1162: IF p_alloc_rec.to_level IS NULL THEN
1163: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1164: fnd_message.set_name('OZF', 'OZF_INVALID_TO_LEVEL');
1165: fnd_msg_pub.add;
1166: END IF;
1167: x_return_status := fnd_api.g_ret_sts_error;
1168: RETURN;
1169: END IF;
1170: END IF;
1171:
1172: --if start node is null, then raise exception
1173: IF p_alloc_rec.start_node = fnd_api.g_miss_num OR p_alloc_rec.start_node IS NULL THEN
1174: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1175: fnd_message.set_name('OZF', 'OZF_NO_START_NODE');
1176: fnd_msg_pub.add;
1177: END IF;
1178: x_return_status := fnd_api.g_ret_sts_error;
1172: --if start node is null, then raise exception
1173: IF p_alloc_rec.start_node = fnd_api.g_miss_num OR p_alloc_rec.start_node IS NULL THEN
1174: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1175: fnd_message.set_name('OZF', 'OZF_NO_START_NODE');
1176: fnd_msg_pub.add;
1177: END IF;
1178: x_return_status := fnd_api.g_ret_sts_error;
1179: RETURN;
1180: ELSE
1183: FETCH c_start_node_exists INTO p_alloc_rec.start_node;
1184: CLOSE c_start_node_exists;
1185:
1186: IF p_alloc_rec.start_node IS NULL THEN
1187: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1188: fnd_message.set_name('OZF', 'OZF_INVALID_START_NODE');
1189: fnd_msg_pub.add;
1190: END IF;
1191: x_return_status := fnd_api.g_ret_sts_error;
1185:
1186: IF p_alloc_rec.start_node IS NULL THEN
1187: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1188: fnd_message.set_name('OZF', 'OZF_INVALID_START_NODE');
1189: fnd_msg_pub.add;
1190: END IF;
1191: x_return_status := fnd_api.g_ret_sts_error;
1192: RETURN;
1193: END IF;
1194: END IF;
1195:
1196: --if start period name is null
1197: IF p_alloc_rec.start_period_name = fnd_api.g_miss_char OR p_alloc_rec.start_period_name IS NULL THEN
1198: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1199: fnd_message.set_name('OZF', 'OZF_NO_START_PERIOD');
1200: fnd_msg_pub.add;
1201: END IF;
1202: x_return_status := fnd_api.g_ret_sts_error;
1196: --if start period name is null
1197: IF p_alloc_rec.start_period_name = fnd_api.g_miss_char OR p_alloc_rec.start_period_name IS NULL THEN
1198: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1199: fnd_message.set_name('OZF', 'OZF_NO_START_PERIOD');
1200: fnd_msg_pub.add;
1201: END IF;
1202: x_return_status := fnd_api.g_ret_sts_error;
1203: RETURN;
1204: ELSE
1207: FETCH c_period_exists INTO l_period_exists;
1208: CLOSE c_period_exists;
1209:
1210: IF l_period_exists IS NULL THEN
1211: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1212: fnd_message.set_name('OZF', 'OZF_INVALID_START_PERIOD');
1213: fnd_msg_pub.add;
1214: END IF;
1215: x_return_status := fnd_api.g_ret_sts_error;
1209:
1210: IF l_period_exists IS NULL THEN
1211: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1212: fnd_message.set_name('OZF', 'OZF_INVALID_START_PERIOD');
1213: fnd_msg_pub.add;
1214: END IF;
1215: x_return_status := fnd_api.g_ret_sts_error;
1216: RETURN;
1217: END IF;
1219: END IF;
1220:
1221: --if end period name is null
1222: IF p_alloc_rec.end_period_name = fnd_api.g_miss_char OR p_alloc_rec.end_period_name IS NULL THEN
1223: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1224: fnd_message.set_name('OZF', 'OZF_NO_END_PERIOD');
1225: fnd_msg_pub.add;
1226: END IF;
1227: x_return_status := fnd_api.g_ret_sts_error;
1221: --if end period name is null
1222: IF p_alloc_rec.end_period_name = fnd_api.g_miss_char OR p_alloc_rec.end_period_name IS NULL THEN
1223: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1224: fnd_message.set_name('OZF', 'OZF_NO_END_PERIOD');
1225: fnd_msg_pub.add;
1226: END IF;
1227: x_return_status := fnd_api.g_ret_sts_error;
1228: RETURN;
1229: ELSE
1232: FETCH c_period_exists INTO l_period_exists;
1233: CLOSE c_period_exists;
1234:
1235: IF l_period_exists IS NULL THEN
1236: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1237: fnd_message.set_name('OZF', 'OZF_INVALID_END_PERIOD');
1238: fnd_msg_pub.add;
1239: END IF;
1240: x_return_status := fnd_api.g_ret_sts_error;
1234:
1235: IF l_period_exists IS NULL THEN
1236: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1237: fnd_message.set_name('OZF', 'OZF_INVALID_END_PERIOD');
1238: fnd_msg_pub.add;
1239: END IF;
1240: x_return_status := fnd_api.g_ret_sts_error;
1241: RETURN;
1242: END IF;
1251: CLOSE c_to_date;
1252:
1253: --if allocation amount is null, then raise exception
1254: IF p_alloc_rec.alloc_amount = fnd_api.g_miss_num OR p_alloc_rec.alloc_amount IS NULL THEN
1255: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1256: fnd_message.set_name('OZF', 'OZF_NO_ALLOC_AMT');
1257: fnd_msg_pub.add;
1258: END IF;
1259: x_return_status := fnd_api.g_ret_sts_error;
1253: --if allocation amount is null, then raise exception
1254: IF p_alloc_rec.alloc_amount = fnd_api.g_miss_num OR p_alloc_rec.alloc_amount IS NULL THEN
1255: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1256: fnd_message.set_name('OZF', 'OZF_NO_ALLOC_AMT');
1257: fnd_msg_pub.add;
1258: END IF;
1259: x_return_status := fnd_api.g_ret_sts_error;
1260: RETURN;
1261: END IF;
1261: END IF;
1262:
1263: --if method code is null, then raise exception
1264: IF p_alloc_rec.method_code = fnd_api.g_miss_char OR p_alloc_rec.method_code IS NULL THEN
1265: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1266: fnd_message.set_name('OZF', 'OZF_NO_METHOD_CODE');
1267: fnd_msg_pub.add;
1268: END IF;
1269: x_return_status := fnd_api.g_ret_sts_error;
1263: --if method code is null, then raise exception
1264: IF p_alloc_rec.method_code = fnd_api.g_miss_char OR p_alloc_rec.method_code IS NULL THEN
1265: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1266: fnd_message.set_name('OZF', 'OZF_NO_METHOD_CODE');
1267: fnd_msg_pub.add;
1268: END IF;
1269: x_return_status := fnd_api.g_ret_sts_error;
1270: RETURN;
1271: ELSE
1274: FETCH c_method_code_exists INTO p_alloc_rec.method_code;
1275: CLOSE c_method_code_exists;
1276:
1277: IF p_alloc_rec.method_code IS NULL THEN
1278: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1279: fnd_message.set_name('OZF', 'OZF_INVALID_METHOD_CODE');
1280: fnd_msg_pub.add;
1281: END IF;
1282: x_return_status := fnd_api.g_ret_sts_error;
1276:
1277: IF p_alloc_rec.method_code IS NULL THEN
1278: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1279: fnd_message.set_name('OZF', 'OZF_INVALID_METHOD_CODE');
1280: fnd_msg_pub.add;
1281: END IF;
1282: x_return_status := fnd_api.g_ret_sts_error;
1283: RETURN;
1284: END IF;
1286:
1287: --if basis year is null, then raise exception
1288: IF p_alloc_rec.basis_year = fnd_api.g_miss_num OR p_alloc_rec.basis_year IS NULL
1289: AND p_alloc_rec.method_code = 'PRIOR_SALES_TOTAL' THEN
1290: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1291: fnd_message.set_name('OZF', 'OZF_NO_BASIS_YEAR');
1292: fnd_msg_pub.add;
1293: END IF;
1294: x_return_status := fnd_api.g_ret_sts_error;
1288: IF p_alloc_rec.basis_year = fnd_api.g_miss_num OR p_alloc_rec.basis_year IS NULL
1289: AND p_alloc_rec.method_code = 'PRIOR_SALES_TOTAL' THEN
1290: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1291: fnd_message.set_name('OZF', 'OZF_NO_BASIS_YEAR');
1292: fnd_msg_pub.add;
1293: END IF;
1294: x_return_status := fnd_api.g_ret_sts_error;
1295: RETURN;
1296: END IF;
1521:
1522: EXCEPTION
1523: WHEN OTHERS THEN
1524: X_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1525: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )
1526: THEN
1527: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME, 'Others exception in Create_Product_Alloc_Record');
1528: END IF;
1529:
1523: WHEN OTHERS THEN
1524: X_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1525: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )
1526: THEN
1527: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME, 'Others exception in Create_Product_Alloc_Record');
1528: END IF;
1529:
1530: END Create_Product_Alloc_Record;
1531:
1610:
1611: EXCEPTION
1612: WHEN OTHERS THEN
1613: X_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1614: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )
1615: THEN
1616: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME, 'Others exception in Create_Account_Alloc_Record');
1617: END IF;
1618:
1612: WHEN OTHERS THEN
1613: X_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1614: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )
1615: THEN
1616: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME, 'Others exception in Create_Account_Alloc_Record');
1617: END IF;
1618:
1619: END Create_Account_Alloc_Record;
1620:
1692: EXCEPTION
1693:
1694: WHEN OTHERS THEN
1695: X_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1696: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )
1697: THEN
1698: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME, 'Others exception in Create_Time_Alloc_Record');
1699: END IF;
1700:
1694: WHEN OTHERS THEN
1695: X_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1696: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )
1697: THEN
1698: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME, 'Others exception in Create_Time_Alloc_Record');
1699: END IF;
1700:
1701: END Create_Time_Alloc_Record;
1702:
1740:
1741: -- p_quota_products_tbl will already have record by now
1742:
1743: IF (p_quota_prod_spread_tbl.count = 0 ) Then
1744: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1745: FND_MESSAGE.Set_Name('OZF', 'OZF_QUOTA_MISSING_PROD_SPREAD');
1746: FND_MSG_PUB.ADD;
1747: END IF;
1748: x_return_status := FND_API.G_RET_STS_ERROR;
1742:
1743: IF (p_quota_prod_spread_tbl.count = 0 ) Then
1744: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1745: FND_MESSAGE.Set_Name('OZF', 'OZF_QUOTA_MISSING_PROD_SPREAD');
1746: FND_MSG_PUB.ADD;
1747: END IF;
1748: x_return_status := FND_API.G_RET_STS_ERROR;
1749: RAISE FND_API.G_EXC_ERROR;
1750: END IF;
1865: IF G_DEBUG THEN
1866: ozf_utility_pvt.debug_message('End Procedure: '|| l_api_name );
1867: END IF;
1868:
1869: FND_MSG_PUB.Count_And_Get (
1870: p_encoded => FND_API.G_FALSE,
1871: p_count => x_msg_count,
1872: p_data => x_msg_data
1873: );
1876: WHEN FND_API.G_EXC_ERROR THEN
1877: ROLLBACK TO create_quota_product_spread;
1878: x_return_status := FND_API.G_RET_STS_ERROR;
1879: -- Standard call to get message count and if count=1, get the message
1880: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
1881: ,p_count => x_msg_count
1882: ,p_data => x_msg_data
1883: );
1884: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1884: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1885: ROLLBACK TO create_quota_product_spread;
1886: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1887: -- Standard call to get message count and if count=1, get the message
1888: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
1889: ,p_count => x_msg_count
1890: ,p_data => x_msg_data
1891: );
1892: WHEN OTHERS THEN
1891: );
1892: WHEN OTHERS THEN
1893: ROLLBACK TO create_quota_product_spread;
1894: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1895: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1896: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1897: END IF;
1898: -- Standard call to get message count and if count=1, get the message
1899: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
1892: WHEN OTHERS THEN
1893: ROLLBACK TO create_quota_product_spread;
1894: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1895: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1896: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1897: END IF;
1898: -- Standard call to get message count and if count=1, get the message
1899: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
1900: ,p_count => x_msg_count
1895: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1896: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1897: END IF;
1898: -- Standard call to get message count and if count=1, get the message
1899: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
1900: ,p_count => x_msg_count
1901: ,p_data => x_msg_data
1902: );
1903:
1962: -- Initialize API return status to success
1963: x_return_status := FND_API.G_RET_STS_SUCCESS;
1964:
1965: IF (p_quota_accounts_tbl.count = 0 ) Then
1966: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1967: FND_MESSAGE.Set_Name('OZF', 'OZF_QUOTA_MISSING_ACCOUNTS');
1968: FND_MSG_PUB.ADD;
1969: END IF;
1970: x_return_status := FND_API.G_RET_STS_ERROR;
1964:
1965: IF (p_quota_accounts_tbl.count = 0 ) Then
1966: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1967: FND_MESSAGE.Set_Name('OZF', 'OZF_QUOTA_MISSING_ACCOUNTS');
1968: FND_MSG_PUB.ADD;
1969: END IF;
1970: x_return_status := FND_API.G_RET_STS_ERROR;
1971: RAISE FND_API.G_EXC_ERROR;
1972: END IF;
1971: RAISE FND_API.G_EXC_ERROR;
1972: END IF;
1973:
1974: IF (p_account_spread_tbl.count = 0 ) Then
1975: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1976: FND_MESSAGE.Set_Name('OZF', 'OZF_QUOTA_MISSING_ACCT_SPREAD');
1977: FND_MSG_PUB.ADD;
1978: END IF;
1979: x_return_status := FND_API.G_RET_STS_ERROR;
1973:
1974: IF (p_account_spread_tbl.count = 0 ) Then
1975: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1976: FND_MESSAGE.Set_Name('OZF', 'OZF_QUOTA_MISSING_ACCT_SPREAD');
1977: FND_MSG_PUB.ADD;
1978: END IF;
1979: x_return_status := FND_API.G_RET_STS_ERROR;
1980: RAISE FND_API.G_EXC_ERROR;
1981: END IF;
2005: --
2006: END IF;
2007:
2008: IF (l_rollup_party_id IS NULL) Then
2009: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2010: FND_MESSAGE.Set_Name('OZF', 'OZF_QUOTA_INVALID_SHIP_TO');
2011: FND_MSG_PUB.ADD;
2012: END IF;
2013: x_return_status := FND_API.G_RET_STS_ERROR;
2007:
2008: IF (l_rollup_party_id IS NULL) Then
2009: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2010: FND_MESSAGE.Set_Name('OZF', 'OZF_QUOTA_INVALID_SHIP_TO');
2011: FND_MSG_PUB.ADD;
2012: END IF;
2013: x_return_status := FND_API.G_RET_STS_ERROR;
2014: RAISE FND_API.G_EXC_ERROR;
2015: END IF;
2182: NULL;
2183: END LOOP; -- Process Next Account
2184:
2185: --
2186: FND_MSG_PUB.Count_And_Get (
2187: p_encoded => FND_API.G_FALSE,
2188: p_count => x_msg_count,
2189: p_data => x_msg_data
2190: );
2193: WHEN FND_API.G_EXC_ERROR THEN
2194: ROLLBACK TO create_quota_account_spread;
2195: x_return_status := FND_API.G_RET_STS_ERROR;
2196: -- Standard call to get message count and if count=1, get the message
2197: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2198: ,p_count => x_msg_count
2199: ,p_data => x_msg_data
2200: );
2201: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2201: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2202: ROLLBACK TO create_quota_account_spread;
2203: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2204: -- Standard call to get message count and if count=1, get the message
2205: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2206: ,p_count => x_msg_count
2207: ,p_data => x_msg_data
2208: );
2209: WHEN OTHERS THEN
2208: );
2209: WHEN OTHERS THEN
2210: ROLLBACK TO create_quota_account_spread;
2211: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2212: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2213: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,'Create_Quota_Account_Spread');
2214: END IF;
2215: -- Standard call to get message count and if count=1, get the message
2216: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2209: WHEN OTHERS THEN
2210: ROLLBACK TO create_quota_account_spread;
2211: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2212: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2213: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,'Create_Quota_Account_Spread');
2214: END IF;
2215: -- Standard call to get message count and if count=1, get the message
2216: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2217: ,p_count => x_msg_count
2212: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2213: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,'Create_Quota_Account_Spread');
2214: END IF;
2215: -- Standard call to get message count and if count=1, get the message
2216: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2217: ,p_count => x_msg_count
2218: ,p_data => x_msg_data
2219: );
2220:
2281: -- Default is 'MANUAL'
2282: IF p_method NOT IN ('MANUAL', 'ALLOCATION')
2283: THEN
2284: --
2285: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
2286: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
2287: fnd_message.set_token('COL_NAME', 'P_METHOD');
2288: fnd_msg_pub.add;
2289: END IF;
2284: --
2285: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
2286: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
2287: fnd_message.set_token('COL_NAME', 'P_METHOD');
2288: fnd_msg_pub.add;
2289: END IF;
2290: x_return_status := fnd_api.g_ret_sts_error;
2291: RAISE fnd_api.g_exc_error;
2292: --
2296:
2297: -- Products are always required
2298: IF (p_quota_products_tbl.COUNT = 0 )
2299: THEN
2300: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2301: FND_MESSAGE.Set_Name('OZF', 'OZF_QUOTA_MISSING_PRODUCTS');
2302: FND_MSG_PUB.ADD;
2303: END IF;
2304: x_return_status := FND_API.G_RET_STS_ERROR;
2298: IF (p_quota_products_tbl.COUNT = 0 )
2299: THEN
2300: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2301: FND_MESSAGE.Set_Name('OZF', 'OZF_QUOTA_MISSING_PRODUCTS');
2302: FND_MSG_PUB.ADD;
2303: END IF;
2304: x_return_status := FND_API.G_RET_STS_ERROR;
2305: raise FND_API.G_EXC_ERROR;
2306: END IF;
2444: IF G_DEBUG THEN
2445: ozf_utility_pvt.debug_message('End Procedure: '|| l_api_name );
2446: END IF;
2447:
2448: FND_MSG_PUB.Count_And_Get (
2449: p_encoded => FND_API.G_FALSE,
2450: p_count => x_msg_count,
2451: p_data => x_msg_data
2452: );
2455: WHEN FND_API.G_EXC_ERROR THEN
2456: ROLLBACK TO create_quota;
2457: x_return_status := FND_API.G_RET_STS_ERROR;
2458: -- Standard call to get message count and if count=1, get the message
2459: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2460: ,p_count => x_msg_count
2461: ,p_data => x_msg_data
2462: );
2463: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2463: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2464: ROLLBACK TO create_quota;
2465: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2466: -- Standard call to get message count and if count=1, get the message
2467: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2468: ,p_count => x_msg_count
2469: ,p_data => x_msg_data
2470: );
2471: WHEN OTHERS THEN
2470: );
2471: WHEN OTHERS THEN
2472: ROLLBACK TO create_quota;
2473: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2474: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2475: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2476: END IF;
2477: -- Standard call to get message count and if count=1, get the message
2478: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2471: WHEN OTHERS THEN
2472: ROLLBACK TO create_quota;
2473: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2474: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2475: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2476: END IF;
2477: -- Standard call to get message count and if count=1, get the message
2478: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2479: ,p_count => x_msg_count
2474: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2475: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2476: END IF;
2477: -- Standard call to get message count and if count=1, get the message
2478: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2479: ,p_count => x_msg_count
2480: ,p_data => x_msg_data
2481: );
2482: END create_quota;
2645: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
2646: RAISE fnd_api.g_exc_error;
2647: END IF;
2648:
2649: FND_MSG_PUB.Count_And_Get (
2650: p_encoded => FND_API.G_FALSE,
2651: p_count => x_msg_count,
2652: p_data => x_msg_data
2653: );
2656: WHEN FND_API.G_EXC_ERROR THEN
2657: ROLLBACK TO update_quota;
2658: x_return_status := FND_API.G_RET_STS_ERROR;
2659: -- Standard call to get message count and if count=1, get the message
2660: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2661: ,p_count => x_msg_count
2662: ,p_data => x_msg_data
2663: );
2664: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2664: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2665: ROLLBACK TO update_quota;
2666: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2667: -- Standard call to get message count and if count=1, get the message
2668: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2669: ,p_count => x_msg_count
2670: ,p_data => x_msg_data
2671: );
2672: WHEN OTHERS THEN
2671: );
2672: WHEN OTHERS THEN
2673: ROLLBACK TO update_quota;
2674: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2675: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2676: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2677: END IF;
2678: -- Standard call to get message count and if count=1, get the message
2679: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2672: WHEN OTHERS THEN
2673: ROLLBACK TO update_quota;
2674: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2675: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2676: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2677: END IF;
2678: -- Standard call to get message count and if count=1, get the message
2679: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2680: ,p_count => x_msg_count
2675: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2676: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2677: END IF;
2678: -- Standard call to get message count and if count=1, get the message
2679: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2680: ,p_count => x_msg_count
2681: ,p_data => x_msg_data
2682: );
2683: END Update_Quota;
2737:
2738: IF l_product_allocation_id IS NULL
2739: THEN
2740: --
2741: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
2742: THEN
2743: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
2744: fnd_message.set_token('COL_NAME', 'PRODUCT_ALLOCATION_ID');
2745: fnd_msg_pub.add;
2741: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
2742: THEN
2743: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
2744: fnd_message.set_token('COL_NAME', 'PRODUCT_ALLOCATION_ID');
2745: fnd_msg_pub.add;
2746: END IF;
2747: x_return_status := fnd_api.g_ret_sts_error;
2748: RETURN;
2749: --
2775:
2776: IF l_time_allocation_id IS NULL
2777: THEN
2778: --
2779: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
2780: THEN
2781: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
2782: fnd_message.set_token('COL_NAME', 'TIME_ALLOCATION_ID');
2783: fnd_msg_pub.add;
2779: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
2780: THEN
2781: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
2782: fnd_message.set_token('COL_NAME', 'TIME_ALLOCATION_ID');
2783: fnd_msg_pub.add;
2784: END IF;
2785: x_return_status := fnd_api.g_ret_sts_error;
2786: RETURN;
2787: --
2804: IF G_DEBUG THEN
2805: ozf_utility_pvt.debug_message('End Procedure: '|| l_api_name );
2806: END IF;
2807:
2808: FND_MSG_PUB.Count_And_Get (
2809: p_encoded => FND_API.G_FALSE,
2810: p_count => x_msg_count,
2811: p_data => x_msg_data
2812: );
2815: WHEN FND_API.G_EXC_ERROR THEN
2816: ROLLBACK TO update_quota_product_spread;
2817: x_return_status := FND_API.G_RET_STS_ERROR;
2818: -- Standard call to get message count and if count=1, get the message
2819: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2820: ,p_count => x_msg_count
2821: ,p_data => x_msg_data
2822: );
2823:
2824: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2825: ROLLBACK TO update_quota_product_spread;
2826: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2827: -- Standard call to get message count and if count=1, get the message
2828: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2829: ,p_count => x_msg_count
2830: ,p_data => x_msg_data
2831: );
2832: WHEN OTHERS THEN
2831: );
2832: WHEN OTHERS THEN
2833: ROLLBACK TO update_quota_product_spread;
2834: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2835: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2836: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2837: END IF;
2838: -- Standard call to get message count and if count=1, get the message
2839: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2832: WHEN OTHERS THEN
2833: ROLLBACK TO update_quota_product_spread;
2834: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2835: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2836: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2837: END IF;
2838: -- Standard call to get message count and if count=1, get the message
2839: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2840: ,p_count => x_msg_count
2835: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2836: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2837: END IF;
2838: -- Standard call to get message count and if count=1, get the message
2839: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2840: ,p_count => x_msg_count
2841: ,p_data => x_msg_data
2842: );
2843:
2898:
2899: IF l_account_allocation_id IS NULL
2900: THEN
2901: --
2902: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
2903: THEN
2904: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
2905: fnd_message.set_token('COL_NAME', 'ACCOUNT_ALLOCATION_ID');
2906: fnd_msg_pub.add;
2902: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
2903: THEN
2904: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
2905: fnd_message.set_token('COL_NAME', 'ACCOUNT_ALLOCATION_ID');
2906: fnd_msg_pub.add;
2907: END IF;
2908: x_return_status := fnd_api.g_ret_sts_error;
2909: RETURN;
2910: --
2936:
2937: IF l_time_allocation_id IS NULL
2938: THEN
2939: --
2940: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
2941: THEN
2942: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
2943: fnd_message.set_token('COL_NAME', 'TIME_ALLOCATION_ID');
2944: fnd_msg_pub.add;
2940: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error)
2941: THEN
2942: fnd_message.set_name('OZF', 'OZF_QUOTA_INVALID_COL_VALUE');
2943: fnd_message.set_token('COL_NAME', 'TIME_ALLOCATION_ID');
2944: fnd_msg_pub.add;
2945: END IF;
2946: x_return_status := fnd_api.g_ret_sts_error;
2947: RETURN;
2948: --
2965: IF G_DEBUG THEN
2966: ozf_utility_pvt.debug_message('End Procedure: '|| l_api_name );
2967: END IF;
2968:
2969: FND_MSG_PUB.Count_And_Get (
2970: p_encoded => FND_API.G_FALSE,
2971: p_count => x_msg_count,
2972: p_data => x_msg_data
2973: );
2976: WHEN FND_API.G_EXC_ERROR THEN
2977: ROLLBACK TO update_quota_account_spread;
2978: x_return_status := FND_API.G_RET_STS_ERROR;
2979: -- Standard call to get message count and if count=1, get the message
2980: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2981: ,p_count => x_msg_count
2982: ,p_data => x_msg_data
2983: );
2984:
2985: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2986: ROLLBACK TO update_quota_account_spread;
2987: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2988: -- Standard call to get message count and if count=1, get the message
2989: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2990: ,p_count => x_msg_count
2991: ,p_data => x_msg_data
2992: );
2993: WHEN OTHERS THEN
2992: );
2993: WHEN OTHERS THEN
2994: ROLLBACK TO update_quota_account_spread;
2995: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2996: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2997: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2998: END IF;
2999: -- Standard call to get message count and if count=1, get the message
3000: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
2993: WHEN OTHERS THEN
2994: ROLLBACK TO update_quota_account_spread;
2995: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2996: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2997: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2998: END IF;
2999: -- Standard call to get message count and if count=1, get the message
3000: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3001: ,p_count => x_msg_count
2996: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2997: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2998: END IF;
2999: -- Standard call to get message count and if count=1, get the message
3000: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3001: ,p_count => x_msg_count
3002: ,p_data => x_msg_data
3003: );
3004:
3109:
3110: --if quota id is null, then raise exception
3111: IF (p_quota_id = fnd_api.g_miss_num OR p_quota_id IS NULL) THEN
3112:
3113: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3114: fnd_message.set_name('OZF', 'OZF_NO_QUOTA_ID');
3115: fnd_msg_pub.add;
3116: END IF;
3117: RAISE fnd_api.g_exc_error;
3111: IF (p_quota_id = fnd_api.g_miss_num OR p_quota_id IS NULL) THEN
3112:
3113: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3114: fnd_message.set_name('OZF', 'OZF_NO_QUOTA_ID');
3115: fnd_msg_pub.add;
3116: END IF;
3117: RAISE fnd_api.g_exc_error;
3118: END IF;
3119:
3122: FETCH c_valid_quota INTO l_object_version;
3123: CLOSE c_valid_quota;
3124:
3125: IF l_object_version IS NULL THEN
3126: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3127: fnd_message.set_name('OZF', 'OZF_INVALID_QUOTA_ID');
3128: fnd_msg_pub.add;
3129: END IF;
3130: RAISE fnd_api.g_exc_error;
3124:
3125: IF l_object_version IS NULL THEN
3126: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3127: fnd_message.set_name('OZF', 'OZF_INVALID_QUOTA_ID');
3128: fnd_msg_pub.add;
3129: END IF;
3130: RAISE fnd_api.g_exc_error;
3131: END IF;
3132:
3148: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3149: RAISE fnd_api.g_exc_error;
3150: END IF;
3151:
3152: FND_MSG_PUB.Count_And_Get (
3153: p_encoded => FND_API.G_FALSE,
3154: p_count => x_msg_count,
3155: p_data => x_msg_data
3156: );
3159: WHEN FND_API.G_EXC_ERROR THEN
3160: ROLLBACK TO delete_quota;
3161: x_return_status := FND_API.G_RET_STS_ERROR;
3162: -- Standard call to get message count and if count=1, get the message
3163: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3164: ,p_count => x_msg_count
3165: ,p_data => x_msg_data
3166: );
3167: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3167: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3168: ROLLBACK TO delete_quota;
3169: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3170: -- Standard call to get message count and if count=1, get the message
3171: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3172: ,p_count => x_msg_count
3173: ,p_data => x_msg_data
3174: );
3175: WHEN OTHERS THEN
3174: );
3175: WHEN OTHERS THEN
3176: ROLLBACK TO delete_quota;
3177: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3178: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3179: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3180: END IF;
3181: -- Standard call to get message count and if count=1, get the message
3182: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3175: WHEN OTHERS THEN
3176: ROLLBACK TO delete_quota;
3177: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3178: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3179: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3180: END IF;
3181: -- Standard call to get message count and if count=1, get the message
3182: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3183: ,p_count => x_msg_count
3178: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3179: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3180: END IF;
3181: -- Standard call to get message count and if count=1, get the message
3182: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3183: ,p_count => x_msg_count
3184: ,p_data => x_msg_data
3185: );
3186: END delete_quota;
3235:
3236: --if quota id is null, then raise exception
3237: IF (p_quota_id = fnd_api.g_miss_num OR p_quota_id IS NULL) THEN
3238:
3239: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3240: fnd_message.set_name('OZF', 'OZF_NO_QUOTA_ID');
3241: fnd_msg_pub.add;
3242: END IF;
3243: RAISE fnd_api.g_exc_error;
3237: IF (p_quota_id = fnd_api.g_miss_num OR p_quota_id IS NULL) THEN
3238:
3239: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3240: fnd_message.set_name('OZF', 'OZF_NO_QUOTA_ID');
3241: fnd_msg_pub.add;
3242: END IF;
3243: RAISE fnd_api.g_exc_error;
3244: END IF;
3245:
3248: FETCH c_valid_quota INTO l_valid_quota;
3249: CLOSE c_valid_quota;
3250:
3251: IF l_valid_quota IS NULL THEN
3252: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3253: fnd_message.set_name('OZF', 'OZF_INVALID_QUOTA_ID');
3254: fnd_msg_pub.add;
3255: END IF;
3256: RAISE fnd_api.g_exc_error;
3250:
3251: IF l_valid_quota IS NULL THEN
3252: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3253: fnd_message.set_name('OZF', 'OZF_INVALID_QUOTA_ID');
3254: fnd_msg_pub.add;
3255: END IF;
3256: RAISE fnd_api.g_exc_error;
3257: END IF;
3258:
3261: FETCH c_product_exists INTO l_prod_exists;
3262: CLOSE c_product_exists;
3263:
3264: IF l_prod_exists IS NULL THEN
3265: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3266: fnd_message.set_name('OZF', 'OZF_QUOTA_NO_PROD');
3267: fnd_msg_pub.add;
3268: END IF;
3269: RAISE fnd_api.g_exc_error;
3263:
3264: IF l_prod_exists IS NULL THEN
3265: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3266: fnd_message.set_name('OZF', 'OZF_QUOTA_NO_PROD');
3267: fnd_msg_pub.add;
3268: END IF;
3269: RAISE fnd_api.g_exc_error;
3270: END IF;
3271:
3287: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3288: RAISE fnd_api.g_exc_error;
3289: END IF;
3290:
3291: FND_MSG_PUB.Count_And_Get(p_count => x_error_number,
3292: p_data => x_error_message);
3293:
3294: EXCEPTION
3295: WHEN FND_API.G_EXC_ERROR THEN
3294: EXCEPTION
3295: WHEN FND_API.G_EXC_ERROR THEN
3296: ROLLBACK TO generate_product_spread;
3297: x_return_status := FND_API.G_RET_STS_ERROR;
3298: FND_MSG_PUB.Count_And_Get(p_count => x_error_number,
3299: p_data => x_error_message);
3300: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3301: ROLLBACK TO generate_product_spread;
3302: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3299: p_data => x_error_message);
3300: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3301: ROLLBACK TO generate_product_spread;
3302: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3303: FND_MSG_PUB.Count_And_Get(p_count => x_error_number,
3304: p_data => x_error_message);
3305: WHEN OTHERS THEN
3306: ROLLBACK TO generate_product_spread;
3307: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3304: p_data => x_error_message);
3305: WHEN OTHERS THEN
3306: ROLLBACK TO generate_product_spread;
3307: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3308: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3309: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3310: END IF;
3311: FND_MSG_PUB.Count_And_Get(p_count => x_error_number,
3312: p_data => x_error_message);
3305: WHEN OTHERS THEN
3306: ROLLBACK TO generate_product_spread;
3307: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3308: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3309: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3310: END IF;
3311: FND_MSG_PUB.Count_And_Get(p_count => x_error_number,
3312: p_data => x_error_message);
3313: END generate_product_spread;
3307: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3308: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3309: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3310: END IF;
3311: FND_MSG_PUB.Count_And_Get(p_count => x_error_number,
3312: p_data => x_error_message);
3313: END generate_product_spread;
3314:
3315: ---------------------------------------------------------------------
3370: FETCH c_product_spread_exists INTO l_spread_exists;
3371: CLOSE c_product_spread_exists;
3372:
3373: IF l_spread_exists IS NULL THEN
3374: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3375: fnd_message.set_name('OZF', 'OZF_NO_PROD_SPREAD'); -- product spread needs to be created before creating allocation
3376: fnd_msg_pub.add;
3377: END IF;
3378: RAISE fnd_api.g_exc_error;
3372:
3373: IF l_spread_exists IS NULL THEN
3374: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3375: fnd_message.set_name('OZF', 'OZF_NO_PROD_SPREAD'); -- product spread needs to be created before creating allocation
3376: fnd_msg_pub.add;
3377: END IF;
3378: RAISE fnd_api.g_exc_error;
3379: END IF;
3380:
3428: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3429: RAISE fnd_api.g_exc_error;
3430: END IF;
3431:
3432: FND_MSG_PUB.Count_And_Get (
3433: p_encoded => FND_API.G_FALSE,
3434: p_count => x_msg_count,
3435: p_data => x_msg_data
3436: );
3439: WHEN FND_API.G_EXC_ERROR THEN
3440: ROLLBACK TO create_allocation;
3441: x_return_status := FND_API.G_RET_STS_ERROR;
3442: -- Standard call to get message count and if count=1, get the message
3443: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3444: ,p_count => x_msg_count
3445: ,p_data => x_msg_data
3446: );
3447: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3447: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3448: ROLLBACK TO create_allocation;
3449: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3450: -- Standard call to get message count and if count=1, get the message
3451: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3452: ,p_count => x_msg_count
3453: ,p_data => x_msg_data
3454: );
3455: WHEN OTHERS THEN
3454: );
3455: WHEN OTHERS THEN
3456: ROLLBACK TO create_allocation;
3457: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3458: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3459: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3460: END IF;
3461: -- Standard call to get message count and if count=1, get the message
3462: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3455: WHEN OTHERS THEN
3456: ROLLBACK TO create_allocation;
3457: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3458: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3459: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3460: END IF;
3461: -- Standard call to get message count and if count=1, get the message
3462: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3463: ,p_count => x_msg_count
3458: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3459: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3460: END IF;
3461: -- Standard call to get message count and if count=1, get the message
3462: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3463: ,p_count => x_msg_count
3464: ,p_data => x_msg_data
3465: );
3466: END create_allocation;
3518: FETCH c_valid_alloc INTO l_valid_alloc;
3519: CLOSE c_valid_alloc;
3520:
3521: IF l_valid_alloc IS NULL THEN
3522: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3523: fnd_message.set_name('OZF', 'OZF_INVALID_ALLOC_ID');
3524: fnd_msg_pub.add;
3525: END IF;
3526: RAISE fnd_api.g_exc_error;
3520:
3521: IF l_valid_alloc IS NULL THEN
3522: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3523: fnd_message.set_name('OZF', 'OZF_INVALID_ALLOC_ID');
3524: fnd_msg_pub.add;
3525: END IF;
3526: RAISE fnd_api.g_exc_error;
3527: END IF;
3528:
3563: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3564: RAISE fnd_api.g_exc_error;
3565: END IF;
3566:
3567: FND_MSG_PUB.Count_And_Get (
3568: p_encoded => FND_API.G_FALSE,
3569: p_count => x_msg_count,
3570: p_data => x_msg_data
3571: );
3574: WHEN FND_API.G_EXC_ERROR THEN
3575: ROLLBACK TO publish_allocation;
3576: x_return_status := FND_API.G_RET_STS_ERROR;
3577: -- Standard call to get message count and if count=1, get the message
3578: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3579: ,p_count => x_msg_count
3580: ,p_data => x_msg_data
3581: );
3582: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3582: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3583: ROLLBACK TO publish_allocation;
3584: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3585: -- Standard call to get message count and if count=1, get the message
3586: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3587: ,p_count => x_msg_count
3588: ,p_data => x_msg_data
3589: );
3590: WHEN OTHERS THEN
3589: );
3590: WHEN OTHERS THEN
3591: ROLLBACK TO publish_allocation;
3592: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3593: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3594: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3595: END IF;
3596: -- Standard call to get message count and if count=1, get the message
3597: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3590: WHEN OTHERS THEN
3591: ROLLBACK TO publish_allocation;
3592: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3593: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3594: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3595: END IF;
3596: -- Standard call to get message count and if count=1, get the message
3597: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3598: ,p_count => x_msg_count
3593: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3594: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3595: END IF;
3596: -- Standard call to get message count and if count=1, get the message
3597: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3598: ,p_count => x_msg_count
3599: ,p_data => x_msg_data
3600: );
3601: END publish_allocation;
3648: FETCH c_valid_alloc INTO l_alloc_obj_ver;
3649: CLOSE c_valid_alloc;
3650:
3651: IF l_alloc_obj_ver IS NULL THEN
3652: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3653: fnd_message.set_name('OZF', 'OZF_INVALID_ALLOC_ID');
3654: fnd_msg_pub.add;
3655: END IF;
3656: RAISE fnd_api.g_exc_error;
3650:
3651: IF l_alloc_obj_ver IS NULL THEN
3652: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
3653: fnd_message.set_name('OZF', 'OZF_INVALID_ALLOC_ID');
3654: fnd_msg_pub.add;
3655: END IF;
3656: RAISE fnd_api.g_exc_error;
3657: END IF;
3658:
3673: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3674: RAISE fnd_api.g_exc_error;
3675: END IF;
3676:
3677: FND_MSG_PUB.Count_And_Get (
3678: p_encoded => FND_API.G_FALSE,
3679: p_count => x_msg_count,
3680: p_data => x_msg_data
3681: );
3684: WHEN FND_API.G_EXC_ERROR THEN
3685: ROLLBACK TO update_alloc_status;
3686: x_return_status := FND_API.G_RET_STS_ERROR;
3687: -- Standard call to get message count and if count=1, get the message
3688: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3689: ,p_count => x_msg_count
3690: ,p_data => x_msg_data
3691: );
3692: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3692: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3693: ROLLBACK TO update_alloc_status;
3694: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3695: -- Standard call to get message count and if count=1, get the message
3696: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3697: ,p_count => x_msg_count
3698: ,p_data => x_msg_data
3699: );
3700: WHEN OTHERS THEN
3699: );
3700: WHEN OTHERS THEN
3701: ROLLBACK TO update_alloc_status;
3702: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3703: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3704: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3705: END IF;
3706: -- Standard call to get message count and if count=1, get the message
3707: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3700: WHEN OTHERS THEN
3701: ROLLBACK TO update_alloc_status;
3702: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3703: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3704: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3705: END IF;
3706: -- Standard call to get message count and if count=1, get the message
3707: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3708: ,p_count => x_msg_count
3703: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3704: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3705: END IF;
3706: -- Standard call to get message count and if count=1, get the message
3707: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
3708: ,p_count => x_msg_count
3709: ,p_data => x_msg_data
3710: );
3711: END update_alloc_status;