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
10: ,p_commit IN VARCHAR2 := fnd_api.g_false
11: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
12: ,p_quota_id IN NUMBER
13: ,x_return_status OUT NOCOPY VARCHAR2
6:
7: PROCEDURE generate_product_spread(
8: p_api_version IN NUMBER
9: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
10: ,p_commit IN VARCHAR2 := fnd_api.g_false
11: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
12: ,p_quota_id IN NUMBER
13: ,x_return_status OUT NOCOPY VARCHAR2
14: ,x_error_number OUT NOCOPY NUMBER
7: PROCEDURE generate_product_spread(
8: p_api_version IN NUMBER
9: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
10: ,p_commit IN VARCHAR2 := fnd_api.g_false
11: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
12: ,p_quota_id IN NUMBER
13: ,x_return_status OUT NOCOPY VARCHAR2
14: ,x_error_number OUT NOCOPY NUMBER
15: ,x_error_message OUT NOCOPY VARCHAR2) ;
15: ,x_error_message OUT NOCOPY VARCHAR2) ;
16:
17: PROCEDURE create_allocation(
18: p_api_version IN NUMBER
19: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
20: ,p_commit IN VARCHAR2 := fnd_api.g_false
21: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
22: ,p_alloc_rec IN alloc_rec_type
23: ,x_return_status OUT NOCOPY VARCHAR2
16:
17: PROCEDURE create_allocation(
18: p_api_version IN NUMBER
19: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
20: ,p_commit IN VARCHAR2 := fnd_api.g_false
21: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
22: ,p_alloc_rec IN alloc_rec_type
23: ,x_return_status OUT NOCOPY VARCHAR2
24: ,x_msg_count OUT NOCOPY NUMBER
17: PROCEDURE create_allocation(
18: p_api_version IN NUMBER
19: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
20: ,p_commit IN VARCHAR2 := fnd_api.g_false
21: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
22: ,p_alloc_rec IN alloc_rec_type
23: ,x_return_status OUT NOCOPY VARCHAR2
24: ,x_msg_count OUT NOCOPY NUMBER
25: ,x_msg_data OUT NOCOPY VARCHAR2
26: ,x_alloc_id OUT NOCOPY NUMBER) ;
27:
28: PROCEDURE publish_allocation(
29: p_api_version IN NUMBER
30: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
31: ,p_commit IN VARCHAR2 := fnd_api.g_false
32: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
33: ,p_alloc_id IN NUMBER
34: ,x_return_status OUT NOCOPY VARCHAR2
27:
28: PROCEDURE publish_allocation(
29: p_api_version IN NUMBER
30: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
31: ,p_commit IN VARCHAR2 := fnd_api.g_false
32: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
33: ,p_alloc_id IN NUMBER
34: ,x_return_status OUT NOCOPY VARCHAR2
35: ,x_msg_count OUT NOCOPY NUMBER
28: PROCEDURE publish_allocation(
29: p_api_version IN NUMBER
30: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
31: ,p_commit IN VARCHAR2 := fnd_api.g_false
32: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
33: ,p_alloc_id IN NUMBER
34: ,x_return_status OUT NOCOPY VARCHAR2
35: ,x_msg_count OUT NOCOPY NUMBER
36: ,x_msg_data OUT NOCOPY VARCHAR2) ;
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:
66: IF p_period_type_id = 32
67: 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:
88: END IF;
89:
147: ---------------------------------------------------------------------
148: PROCEDURE validate_quota_attributes (
149: p_quota_rec IN OUT NOCOPY quota_rec_type
150: ,p_mode IN VARCHAR2
151: ,p_method IN VARCHAR2 := FND_API.G_MISS_CHAR
152: ,p_fund_rec IN OUT NOCOPY OZF_Funds_Pub.fund_rec_type
153: ,x_return_status OUT NOCOPY VARCHAR2
154: )
155: IS
229: p_quota_rec.quota_id := NULL;
230:
231: -- Required Column Check ------------------------
232: -- Short_Name
233: IF p_quota_rec.short_name = fnd_api.g_miss_char
234: OR
235: p_quota_rec.short_name IS NULL
236: THEN
237: --
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:
247: -- Custom_Setup_Id
248: IF p_quota_rec.custom_setup_id = fnd_api.g_miss_num
244: x_return_status := fnd_api.g_ret_sts_error;
245: END IF;
246:
247: -- Custom_Setup_Id
248: IF p_quota_rec.custom_setup_id = fnd_api.g_miss_num
249: OR
250: p_quota_rec.custom_setup_id IS NULL
251: THEN
252: --
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:
262: -- User_Status_Id
263: IF p_quota_rec.user_status_id = fnd_api.g_miss_num
259: x_return_status := fnd_api.g_ret_sts_error;
260: END IF;
261:
262: -- User_Status_Id
263: IF p_quota_rec.user_status_id = fnd_api.g_miss_num
264: OR
265: p_quota_rec.user_status_id IS NULL
266: THEN
267: --
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:
277: -- Start_Period_Name
278: IF p_quota_rec.start_period_name = fnd_api.g_miss_char
274: x_return_status := fnd_api.g_ret_sts_error;
275: END IF;
276:
277: -- Start_Period_Name
278: IF p_quota_rec.start_period_name = fnd_api.g_miss_char
279: OR
280: p_quota_rec.start_period_name IS NULL
281: THEN
282: --
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:
292: -- End_Period_Name
293: IF p_quota_rec.start_period_name = fnd_api.g_miss_char
289: x_return_status := fnd_api.g_ret_sts_error;
290: END IF;
291:
292: -- End_Period_Name
293: IF p_quota_rec.start_period_name = fnd_api.g_miss_char
294: OR
295: p_quota_rec.start_period_name IS NULL
296: THEN
297: --
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:
307: -- Quota_Amount
308: IF p_quota_rec.quota_amount = fnd_api.g_miss_num
304: x_return_status := fnd_api.g_ret_sts_error;
305: END IF;
306:
307: -- Quota_Amount
308: IF p_quota_rec.quota_amount = fnd_api.g_miss_num
309: OR
310: p_quota_rec.quota_amount IS NULL
311: THEN
312: --
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:
322: -- Owner
323: IF p_quota_rec.owner = fnd_api.g_miss_num
319: x_return_status := fnd_api.g_ret_sts_error;
320: END IF;
321:
322: -- Owner
323: IF p_quota_rec.owner = fnd_api.g_miss_num
324: OR
325: p_quota_rec.owner IS NULL
326: THEN
327: --
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:
337: -- Product_Spread_Time_Id
338: IF p_quota_rec.product_spread_time_id = fnd_api.g_miss_num
334: x_return_status := fnd_api.g_ret_sts_error;
335: END IF;
336:
337: -- Product_Spread_Time_Id
338: IF p_quota_rec.product_spread_time_id = fnd_api.g_miss_num
339: OR
340: p_quota_rec.product_spread_time_id IS NULL
341: THEN
342: --
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:
352: -- Return Error when all the required columns are checked
353: IF x_return_status = fnd_api.g_ret_sts_error
349: x_return_status := fnd_api.g_ret_sts_error;
350: END IF;
351:
352: -- Return Error when all the required columns are checked
353: IF x_return_status = fnd_api.g_ret_sts_error
354: THEN
355: RETURN;
356: END IF;
357:
359:
360: -- Check Foreign Key for columns that are valid for Create mode only
361:
362: -- If Parent_Quota_Id is provided, then it should be valid
363: IF p_quota_rec.parent_quota_id <> fnd_api.g_miss_num
364: AND
365: p_quota_rec.parent_quota_id IS NOT NULL
366: THEN
367: --
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: --
384: ELSE
385: --
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;
402: --
403: END IF;
404: --
405: END IF; -- Check Parent Quota Id
406:
407: -- Custom_Setup_Id
408: IF p_quota_rec.custom_setup_id <> fnd_api.g_miss_num
409: AND
410: p_quota_rec.custom_setup_id IS NOT NULL
411: THEN
412: OPEN c_custom_setup_exists (p_quota_rec.custom_setup_id);
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;
427: --
428: END IF;
427: --
428: END IF;
429:
430: -- User_Status_Id
431: IF p_quota_rec.user_status_id <> fnd_api.g_miss_num
432: AND
433: p_quota_rec.user_status_id IS NOT NULL
434: THEN
435: OPEN c_user_status_id (p_quota_rec.user_status_id);
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;
450: --
451: END IF;
450: --
451: END IF;
452:
453: -- Start_Period_Name
454: IF p_quota_rec.start_period_name <> fnd_api.g_miss_char
455: AND
456: p_quota_rec.start_period_name IS NOT NULL
457: THEN
458: OPEN c_period_exists (p_quota_rec.start_period_name);
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;
473: --
474: END IF;
473: --
474: END IF;
475:
476: -- End_Period_Name
477: IF p_quota_rec.end_period_name <> fnd_api.g_miss_char
478: AND
479: p_quota_rec.end_period_name IS NOT NULL
480: THEN
481: OPEN c_period_exists (p_quota_rec.end_period_name);
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;
496: --
497: END IF;
496: --
497: END IF;
498:
499: -- Product_Spread_Time_Id
500: IF p_quota_rec.product_spread_time_id <> fnd_api.g_miss_num
501: AND
502: p_quota_rec.product_spread_time_id IS NOT NULL
503: THEN
504:
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;
516: --
517: END IF;
525: -- 1. Owner
526: -- 2. Threshold_Id
527:
528: -- Owner
529: IF p_quota_rec.owner <> fnd_api.g_miss_num
530: AND
531: p_quota_rec.owner IS NOT NULL
532: THEN
533:
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;
549: --
550: END IF;
549: --
550: END IF;
551:
552: -- Threshold_Id
553: IF p_quota_rec.threshold_id <> fnd_api.g_miss_num
554: AND
555: p_quota_rec.threshold_id IS NOT NULL
556: THEN
557: --
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;
574: --
575: END IF;
579: THEN
580:
581: -- UPDATE MODE
582: --if both quota id and quota number are null, then raise exception
583: IF (p_quota_rec.quota_id = fnd_api.g_miss_num OR p_quota_rec.quota_id IS NULL)
584: AND
585: (p_quota_rec.quota_number = fnd_api.g_miss_char OR p_quota_rec.quota_number IS NULL)
586: THEN
587:
581: -- UPDATE MODE
582: --if both quota id and quota number are null, then raise exception
583: IF (p_quota_rec.quota_id = fnd_api.g_miss_num OR p_quota_rec.quota_id IS NULL)
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');
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:
595: ELSE
596: --if quota id is not null it takes precedence over quota number
593: RETURN;
594:
595: ELSE
596: --if quota id is not null it takes precedence over quota number
597: IF p_quota_rec.quota_id <> fnd_api.g_miss_num
598: AND p_quota_rec.quota_id IS NOT NULL
599: THEN
600:
601: --check if the input quota_id is valid
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;
614:
615: --if quota number is not null
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;
630: --
631: END IF; -- End quota_id number check
685: IF G_DEBUG THEN
686: ozf_utility_pvt.debug_message('Start Procedure: '|| l_api_name);
687: END IF;
688:
689: x_return_status := FND_API.G_RET_STS_SUCCESS;
690:
691: -- Default values
692: l_act_product_rec.ACT_PRODUCT_USED_BY_ID := p_quota_id;
693: l_act_product_rec.ARC_ACT_PRODUCT_USED_BY := 'FUND';
694: l_act_product_rec.PRIMARY_PRODUCT_FLAG := 'N';
695: l_act_product_rec.ENABLED_FLAG := 'Y';
696: l_act_product_rec.EXCLUDED_FLAG := 'N';
697:
698: IF l_quota_products_rec.item_type <> fnd_api.g_miss_char
699: AND
700: l_quota_products_rec.item_type IS NOT NULL
701: THEN
702: --
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
715: --
716: l_act_product_rec.level_type_code := l_quota_products_rec.item_type;
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;
739:
740: x_act_product_rec := l_act_product_rec;
744: END IF;
745:
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
745:
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: );
751: ( P_count => x_msg_count,
752: P_data => x_msg_data
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
752: P_data => x_msg_data
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: );
759: p_data => x_msg_data
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'
772:
773:
774: PROCEDURE create_quota_header(
775: p_api_version IN NUMBER
776: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
777: ,p_commit IN VARCHAR2 := fnd_api.g_false
778: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
779: ,x_return_status OUT NOCOPY VARCHAR2
780: ,x_msg_count OUT NOCOPY NUMBER
773:
774: PROCEDURE create_quota_header(
775: p_api_version IN NUMBER
776: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
777: ,p_commit IN VARCHAR2 := fnd_api.g_false
778: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
779: ,x_return_status OUT NOCOPY VARCHAR2
780: ,x_msg_count OUT NOCOPY NUMBER
781: ,x_msg_data OUT NOCOPY VARCHAR2
774: PROCEDURE create_quota_header(
775: p_api_version IN NUMBER
776: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
777: ,p_commit IN VARCHAR2 := fnd_api.g_false
778: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
779: ,x_return_status OUT NOCOPY VARCHAR2
780: ,x_msg_count OUT NOCOPY NUMBER
781: ,x_msg_data OUT NOCOPY VARCHAR2
782: ,p_method IN VARCHAR2
813: IF G_DEBUG THEN
814: ozf_utility_pvt.debug_message('Start Procedure: '|| l_api_name);
815: END IF;
816:
817: x_return_status := FND_API.G_RET_STS_SUCCESS;
818:
819: validate_quota_attributes( p_quota_rec => l_quota_rec
820: ,p_mode => p_mode
821: ,p_method => p_method
821: ,p_method => p_method
822: ,p_fund_rec => l_fund_rec
823: ,x_return_status => x_return_status);
824:
825: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
826: RAISE fnd_api.g_exc_unexpected_error;
827: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
828: RAISE fnd_api.g_exc_error;
829: END IF;
822: ,p_fund_rec => l_fund_rec
823: ,x_return_status => x_return_status);
824:
825: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
826: RAISE fnd_api.g_exc_unexpected_error;
827: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
828: RAISE fnd_api.g_exc_error;
829: END IF;
830:
823: ,x_return_status => x_return_status);
824:
825: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
826: RAISE fnd_api.g_exc_unexpected_error;
827: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
828: RAISE fnd_api.g_exc_error;
829: END IF;
830:
831: ozf_funds_pub.create_fund(p_api_version => p_api_version
824:
825: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
826: RAISE fnd_api.g_exc_unexpected_error;
827: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
828: RAISE fnd_api.g_exc_error;
829: END IF;
830:
831: ozf_funds_pub.create_fund(p_api_version => p_api_version
832: ,p_init_msg_list => p_init_msg_list
850: ozf_utility_pvt.debug_message('Quota ID: ' || x_quota_id);
851: ozf_utility_pvt.debug_message('Return Status: ' || x_return_status);
852: END IF;
853:
854: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
855: RAISE FND_API.G_EXC_ERROR;
856: END IF;
857:
858:
851: ozf_utility_pvt.debug_message('Return Status: ' || x_return_status);
852: END IF;
853:
854: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
855: RAISE FND_API.G_EXC_ERROR;
856: END IF;
857:
858:
859: IF p_quota_markets_tbl.COUNT > 0
877: ,x_msg_count
878: ,x_msg_data
879: ,l_act_mks_id );
880:
881: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
882: RAISE FND_API.G_EXC_ERROR;
883: END IF;
884: --
885: END LOOP;
878: ,x_msg_data
879: ,l_act_mks_id );
880:
881: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
882: RAISE FND_API.G_EXC_ERROR;
883: END IF;
884: --
885: END LOOP;
886: --
892:
893: IF l_quota_products_tbl(l_counter).item_type <> 'OTHERS'
894: THEN
895: --
896: validate_product_record(p_init_msg_list => FND_API.G_FALSE,
897: x_Return_Status => x_return_status,
898: x_msg_count => x_msg_count,
899: x_msg_data => x_msg_data,
900: p_quota_id => x_quota_id,
900: p_quota_id => x_quota_id,
901: p_quota_products_rec => l_quota_products_tbl(l_counter),
902: x_act_product_rec => l_act_product_rec);
903:
904: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
905: RAISE FND_API.G_EXC_ERROR;
906: END IF;
907:
908: ams_actproduct_pvt.create_act_product(
901: p_quota_products_rec => l_quota_products_tbl(l_counter),
902: x_act_product_rec => l_act_product_rec);
903:
904: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
905: RAISE FND_API.G_EXC_ERROR;
906: END IF;
907:
908: ams_actproduct_pvt.create_act_product(
909: p_api_version => p_api_version
915: ,x_msg_data => x_msg_data
916: ,p_act_Product_rec => l_act_product_rec
917: ,x_act_Product_id => l_product_id );
918:
919: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
920: RAISE FND_API.G_EXC_ERROR;
921: END IF;
922: END IF;
923: --
916: ,p_act_Product_rec => l_act_product_rec
917: ,x_act_Product_id => l_product_id );
918:
919: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
920: RAISE FND_API.G_EXC_ERROR;
921: END IF;
922: END IF;
923: --
924: END LOOP;
927: ozf_utility_pvt.debug_message('End Procedure: '|| l_api_name);
928: END IF;
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
928: END IF;
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: );
934: ( P_count => x_msg_count,
935: P_data => x_msg_data
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
935: P_data => x_msg_data
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: );
942: p_data => x_msg_data
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'
1050: ozf_utility_pvt.debug_message('Start Procedure: '|| l_api_name);
1051: END IF;
1052:
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');
1051: END IF;
1052:
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;
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:
1064: ELSE
1065: --if quota id is not null
1062: RETURN;
1063:
1064: ELSE
1065: --if quota id is not null
1066: IF p_alloc_rec.quota_id <> fnd_api.g_miss_num AND p_alloc_rec.quota_id IS NOT NULL THEN
1067:
1068: --check if the input quota_id is valid
1069: OPEN c_quota_exists (p_alloc_rec.quota_id);
1070: FETCH c_quota_exists INTO l_quota_exists;
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;
1081:
1082: --if quota number is not null
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;
1097: END IF;
1098: END IF;
1097: 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;
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
1109: --check if the input hierarchy id is valid
1110: OPEN c_hier_id_exists (p_alloc_rec.hierarchy_id);
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:
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;
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
1133: --check if the from level is valid
1134: OPEN c_from_level_exists (p_alloc_rec.hierarchy_id, p_alloc_rec.from_level);
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:
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;
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
1157: --check if the to level is valid
1158: OPEN c_to_level_exists (p_alloc_rec.hierarchy_id, p_alloc_rec.from_level, p_alloc_rec.to_level);
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:
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;
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
1181: --check if the start node is valid
1182: OPEN c_start_node_exists (p_alloc_rec.hierarchy_id, p_alloc_rec.from_level);
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:
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;
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
1205: --check if the input start period name is valid
1206: OPEN c_period_exists (p_alloc_rec.start_period_name);
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;
1218: l_period_exists := NULL;
1219: END IF;
1218: l_period_exists := NULL;
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;
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
1230: --check if the input end period name is valid
1231: OPEN c_period_exists (p_alloc_rec.end_period_name);
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;
1243: END IF;
1244:
1250: FETCH c_to_date INTO p_alloc_rec.to_date;
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;
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;
1262:
1263: --if method code is null, then raise exception
1260: RETURN;
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;
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
1272: --check if the method code is valid
1273: OPEN c_method_code_exists (p_alloc_rec.method_code);
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;
1285: END IF;
1286:
1284: END IF;
1285: 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;
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;
1297:
1298: OPEN c_product_spread (p_alloc_rec.quota_id);
1446: -- This procedure can be called to create product allocations
1447: -- to a Quota or an Account
1448: PROCEDURE Create_Product_Alloc_Record(
1449: p_api_version IN NUMBER
1450: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1451: ,p_commit IN VARCHAR2 := fnd_api.g_false
1452: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1453: ,x_return_status OUT NOCOPY VARCHAR2
1454: ,x_msg_count OUT NOCOPY NUMBER
1447: -- to a Quota or an Account
1448: PROCEDURE Create_Product_Alloc_Record(
1449: p_api_version IN NUMBER
1450: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1451: ,p_commit IN VARCHAR2 := fnd_api.g_false
1452: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1453: ,x_return_status OUT NOCOPY VARCHAR2
1454: ,x_msg_count OUT NOCOPY NUMBER
1455: ,x_msg_data OUT NOCOPY VARCHAR2
1448: PROCEDURE Create_Product_Alloc_Record(
1449: p_api_version IN NUMBER
1450: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1451: ,p_commit IN VARCHAR2 := fnd_api.g_false
1452: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1453: ,x_return_status OUT NOCOPY VARCHAR2
1454: ,x_msg_count OUT NOCOPY NUMBER
1455: ,x_msg_data OUT NOCOPY VARCHAR2
1456: ,p_product_alloc_rec IN ozf_product_allocations%ROWTYPE
1468: IF G_DEBUG THEN
1469: ozf_utility_pvt.debug_message('Start Procedure: '|| l_api_name);
1470: END IF;
1471:
1472: x_return_status := FND_API.G_RET_STS_SUCCESS;
1473:
1474: l_product_allocation_id := get_product_allocation_id;
1475:
1476: -- Call the Insert here
1512:
1513: -- If succesfull, set the out variables
1514: -- If there is a error, calling routine will handle it
1515: x_product_allocation_Id := l_product_allocation_id;
1516: x_return_status := FND_API.G_RET_STS_SUCCESS;
1517:
1518: IF G_DEBUG THEN
1519: ozf_utility_pvt.debug_message('End Procedure: '|| l_api_name);
1520: END IF;
1520: 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;
1530: END Create_Product_Alloc_Record;
1531:
1532: PROCEDURE Create_Account_Alloc_Record(
1533: p_api_version IN NUMBER
1534: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1535: ,p_commit IN VARCHAR2 := fnd_api.g_false
1536: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1537: ,x_return_status OUT NOCOPY VARCHAR2
1538: ,x_msg_count OUT NOCOPY NUMBER
1531:
1532: PROCEDURE Create_Account_Alloc_Record(
1533: p_api_version IN NUMBER
1534: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1535: ,p_commit IN VARCHAR2 := fnd_api.g_false
1536: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1537: ,x_return_status OUT NOCOPY VARCHAR2
1538: ,x_msg_count OUT NOCOPY NUMBER
1539: ,x_msg_data OUT NOCOPY VARCHAR2
1532: PROCEDURE Create_Account_Alloc_Record(
1533: p_api_version IN NUMBER
1534: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1535: ,p_commit IN VARCHAR2 := fnd_api.g_false
1536: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1537: ,x_return_status OUT NOCOPY VARCHAR2
1538: ,x_msg_count OUT NOCOPY NUMBER
1539: ,x_msg_data OUT NOCOPY VARCHAR2
1540: ,p_account_alloc_rec IN ozf_account_allocations%ROWTYPE
1551: IF G_DEBUG THEN
1552: ozf_utility_pvt.debug_message('Start Procedure: '|| l_api_name);
1553: END IF;
1554:
1555: x_return_status := FND_API.G_RET_STS_SUCCESS;
1556:
1557: -- Call the Insert here
1558: l_account_allocation_id := get_account_allocation_id;
1559:
1601:
1602: -- If succesfull, set the out variables
1603: -- If there is a error, calling routine will handle it
1604: x_account_allocation_Id := l_account_allocation_id;
1605: x_return_status := FND_API.G_RET_STS_SUCCESS;
1606:
1607: IF G_DEBUG THEN
1608: ozf_utility_pvt.debug_message('End Procedure: '|| l_api_name);
1609: END IF;
1609: END IF;
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;
1620:
1621:
1622: PROCEDURE Create_Time_Alloc_Record(
1623: p_api_version IN NUMBER
1624: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1625: ,p_commit IN VARCHAR2 := fnd_api.g_false
1626: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1627: ,x_return_status OUT NOCOPY VARCHAR2
1628: ,x_msg_count OUT NOCOPY NUMBER
1621:
1622: PROCEDURE Create_Time_Alloc_Record(
1623: p_api_version IN NUMBER
1624: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1625: ,p_commit IN VARCHAR2 := fnd_api.g_false
1626: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1627: ,x_return_status OUT NOCOPY VARCHAR2
1628: ,x_msg_count OUT NOCOPY NUMBER
1629: ,x_msg_data OUT NOCOPY VARCHAR2
1622: PROCEDURE Create_Time_Alloc_Record(
1623: p_api_version IN NUMBER
1624: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1625: ,p_commit IN VARCHAR2 := fnd_api.g_false
1626: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1627: ,x_return_status OUT NOCOPY VARCHAR2
1628: ,x_msg_count OUT NOCOPY NUMBER
1629: ,x_msg_data OUT NOCOPY VARCHAR2
1630: ,p_time_alloc_rec IN ozf_time_allocations%ROWTYPE
1641: IF G_DEBUG THEN
1642: ozf_utility_pvt.debug_message('Start Procedure: '|| l_api_name);
1643: END IF;
1644:
1645: x_return_status := FND_API.G_RET_STS_SUCCESS;
1646:
1647: l_time_allocation_id := get_time_allocation_id;
1648: -- Call the Insert here
1649:
1682:
1683: -- If succesfull, set the out variables
1684: -- If there is a error, calling routine will handle it
1685: x_time_allocation_Id := l_time_allocation_id;
1686: x_return_status := FND_API.G_RET_STS_SUCCESS;
1687:
1688: IF G_DEBUG THEN
1689: ozf_utility_pvt.debug_message('End Procedure: '|| l_api_name);
1690: END IF;
1691:
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;
1706: -- Users should be able to create add new Product Spread Records to
1707: -- Existing Quotas
1708: PROCEDURE Create_Quota_Product_Spread(
1709: p_api_version IN NUMBER
1710: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1711: ,p_commit IN VARCHAR2 := fnd_api.g_false
1712: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1713: ,x_return_status OUT NOCOPY VARCHAR2
1714: ,x_msg_count OUT NOCOPY NUMBER
1707: -- Existing Quotas
1708: PROCEDURE Create_Quota_Product_Spread(
1709: p_api_version IN NUMBER
1710: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1711: ,p_commit IN VARCHAR2 := fnd_api.g_false
1712: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1713: ,x_return_status OUT NOCOPY VARCHAR2
1714: ,x_msg_count OUT NOCOPY NUMBER
1715: ,x_msg_data OUT NOCOPY VARCHAR2
1708: PROCEDURE Create_Quota_Product_Spread(
1709: p_api_version IN NUMBER
1710: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1711: ,p_commit IN VARCHAR2 := fnd_api.g_false
1712: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1713: ,x_return_status OUT NOCOPY VARCHAR2
1714: ,x_msg_count OUT NOCOPY NUMBER
1715: ,x_msg_data OUT NOCOPY VARCHAR2
1716: ,p_allocation_for IN VARCHAR2
1735: ozf_utility_pvt.debug_message('Start Procedure: '|| l_api_name );
1736: END IF;
1737:
1738: -- Initialize API return status to success
1739: x_return_status := FND_API.G_RET_STS_SUCCESS;
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;
1749: RAISE FND_API.G_EXC_ERROR;
1750: END IF;
1751:
1752: FOR l_product_counter IN 1..p_quota_products_tbl.count
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;
1751:
1752: FOR l_product_counter IN 1..p_quota_products_tbl.count
1753: LOOP
1794: ,x_msg_data => x_msg_data
1795: ,p_product_alloc_rec => l_product_alloc_rec
1796: ,x_product_allocation_id => l_product_allocation_id ) ;
1797:
1798: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1799: RAISE FND_API.g_exc_unexpected_error;
1800: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1801: RAISE FND_API.g_exc_unexpected_error;
1802: END IF;
1795: ,p_product_alloc_rec => l_product_alloc_rec
1796: ,x_product_allocation_id => l_product_allocation_id ) ;
1797:
1798: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1799: RAISE FND_API.g_exc_unexpected_error;
1800: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1801: RAISE FND_API.g_exc_unexpected_error;
1802: END IF;
1803:
1796: ,x_product_allocation_id => l_product_allocation_id ) ;
1797:
1798: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1799: RAISE FND_API.g_exc_unexpected_error;
1800: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1801: RAISE FND_API.g_exc_unexpected_error;
1802: END IF;
1803:
1804: /* Target Spread Record Type
1797:
1798: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1799: RAISE FND_API.g_exc_unexpected_error;
1800: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1801: RAISE FND_API.g_exc_unexpected_error;
1802: END IF;
1803:
1804: /* Target Spread Record Type
1805: time_allocation_id NUMBER
1831: validate_time_period (l_time_alloc_rec.period_type_id,
1832: l_time_alloc_rec.time_id ,
1833: x_return_status);
1834:
1835: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1836: RAISE FND_API.g_exc_unexpected_error;
1837: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1838: RAISE FND_API.g_exc_unexpected_error;
1839: END IF;
1832: l_time_alloc_rec.time_id ,
1833: x_return_status);
1834:
1835: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1836: RAISE FND_API.g_exc_unexpected_error;
1837: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1838: RAISE FND_API.g_exc_unexpected_error;
1839: END IF;
1840:
1833: x_return_status);
1834:
1835: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1836: RAISE FND_API.g_exc_unexpected_error;
1837: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1838: RAISE FND_API.g_exc_unexpected_error;
1839: END IF;
1840:
1841: Create_Time_Alloc_Record(
1834:
1835: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1836: RAISE FND_API.g_exc_unexpected_error;
1837: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1838: RAISE FND_API.g_exc_unexpected_error;
1839: END IF;
1840:
1841: Create_Time_Alloc_Record(
1842: p_api_version => p_api_version
1848: ,x_msg_data => x_msg_data
1849: ,p_time_alloc_rec => l_time_alloc_rec
1850: ,x_time_allocation_id => l_time_allocation_id ) ;
1851:
1852: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1853: RAISE FND_API.g_exc_unexpected_error;
1854: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1855: RAISE FND_API.g_exc_unexpected_error;
1856: END IF;
1849: ,p_time_alloc_rec => l_time_alloc_rec
1850: ,x_time_allocation_id => l_time_allocation_id ) ;
1851:
1852: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1853: RAISE FND_API.g_exc_unexpected_error;
1854: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1855: RAISE FND_API.g_exc_unexpected_error;
1856: END IF;
1857:
1850: ,x_time_allocation_id => l_time_allocation_id ) ;
1851:
1852: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1853: RAISE FND_API.g_exc_unexpected_error;
1854: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1855: RAISE FND_API.g_exc_unexpected_error;
1856: END IF;
1857:
1858: END IF;
1851:
1852: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1853: RAISE FND_API.g_exc_unexpected_error;
1854: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1855: RAISE FND_API.g_exc_unexpected_error;
1856: END IF;
1857:
1858: END IF;
1859: --
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: );
1874:
1872: p_data => x_msg_data
1873: );
1874:
1875: EXCEPTION
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
1874:
1875: EXCEPTION
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
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
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
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
1882: ,p_data => x_msg_data
1883: );
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
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
1890: ,p_data => x_msg_data
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
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:
1904: END Create_Quota_Product_Spread;
1905:
1906: PROCEDURE Create_Quota_Account_Spread(
1907: p_api_version IN NUMBER
1908: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1909: ,p_commit IN VARCHAR2 := fnd_api.g_false
1910: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1911: ,x_return_status OUT NOCOPY VARCHAR2
1912: ,x_msg_count OUT NOCOPY NUMBER
1905:
1906: PROCEDURE Create_Quota_Account_Spread(
1907: p_api_version IN NUMBER
1908: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1909: ,p_commit IN VARCHAR2 := fnd_api.g_false
1910: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1911: ,x_return_status OUT NOCOPY VARCHAR2
1912: ,x_msg_count OUT NOCOPY NUMBER
1913: ,x_msg_data OUT NOCOPY VARCHAR2
1906: PROCEDURE Create_Quota_Account_Spread(
1907: p_api_version IN NUMBER
1908: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1909: ,p_commit IN VARCHAR2 := fnd_api.g_false
1910: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1911: ,x_return_status OUT NOCOPY VARCHAR2
1912: ,x_msg_count OUT NOCOPY NUMBER
1913: ,x_msg_data OUT NOCOPY VARCHAR2
1914: ,p_fund_id IN NUMBER
1959: BEGIN
1960: --
1961: SAVEPOINT create_quota_account_spread;
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');
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;
1973:
1974: IF (p_account_spread_tbl.count = 0 ) 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;
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
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;
1982:
1983: FOR l_account_counter IN 1..p_quota_accounts_tbl.count
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;
1982:
1983: FOR l_account_counter IN 1..p_quota_accounts_tbl.count
1984: LOOP
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;
2016:
2017: l_account_alloc_rec.cust_account_id := l_cust_account_id;
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;
2016:
2017: l_account_alloc_rec.cust_account_id := l_cust_account_id;
2018: l_account_alloc_rec.location_id := l_location_id;
2053: ,x_msg_data => x_msg_data
2054: ,p_account_alloc_rec => l_account_alloc_rec
2055: ,x_account_allocation_id => l_account_allocation_id ) ;
2056:
2057: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2058: RAISE FND_API.g_exc_unexpected_error;
2059: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2060: RAISE FND_API.g_exc_unexpected_error;
2061: END IF;
2054: ,p_account_alloc_rec => l_account_alloc_rec
2055: ,x_account_allocation_id => l_account_allocation_id ) ;
2056:
2057: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2058: RAISE FND_API.g_exc_unexpected_error;
2059: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2060: RAISE FND_API.g_exc_unexpected_error;
2061: END IF;
2062:
2055: ,x_account_allocation_id => l_account_allocation_id ) ;
2056:
2057: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2058: RAISE FND_API.g_exc_unexpected_error;
2059: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2060: RAISE FND_API.g_exc_unexpected_error;
2061: END IF;
2062:
2063: IF l_account_alloc_rec.parent_party_id = -9999
2056:
2057: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2058: RAISE FND_API.g_exc_unexpected_error;
2059: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2060: RAISE FND_API.g_exc_unexpected_error;
2061: END IF;
2062:
2063: IF l_account_alloc_rec.parent_party_id = -9999
2064: THEN
2088: validate_time_period (l_time_alloc_rec.period_type_id,
2089: l_time_alloc_rec.time_id ,
2090: x_return_status);
2091:
2092: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2093: RAISE FND_API.g_exc_unexpected_error;
2094: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2095: RAISE FND_API.g_exc_unexpected_error;
2096: END IF;
2089: l_time_alloc_rec.time_id ,
2090: x_return_status);
2091:
2092: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2093: RAISE FND_API.g_exc_unexpected_error;
2094: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2095: RAISE FND_API.g_exc_unexpected_error;
2096: END IF;
2097:
2090: x_return_status);
2091:
2092: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2093: RAISE FND_API.g_exc_unexpected_error;
2094: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2095: RAISE FND_API.g_exc_unexpected_error;
2096: END IF;
2097:
2098: Create_Time_Alloc_Record(
2091:
2092: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2093: RAISE FND_API.g_exc_unexpected_error;
2094: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2095: RAISE FND_API.g_exc_unexpected_error;
2096: END IF;
2097:
2098: Create_Time_Alloc_Record(
2099: p_api_version => p_api_version
2105: ,x_msg_data => x_msg_data
2106: ,p_time_alloc_rec => l_time_alloc_rec
2107: ,x_time_allocation_id => l_time_allocation_id ) ;
2108:
2109: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2110: RAISE FND_API.g_exc_unexpected_error;
2111: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2112: RAISE FND_API.g_exc_unexpected_error;
2113: END IF;
2106: ,p_time_alloc_rec => l_time_alloc_rec
2107: ,x_time_allocation_id => l_time_allocation_id ) ;
2108:
2109: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2110: RAISE FND_API.g_exc_unexpected_error;
2111: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2112: RAISE FND_API.g_exc_unexpected_error;
2113: END IF;
2114:
2107: ,x_time_allocation_id => l_time_allocation_id ) ;
2108:
2109: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2110: RAISE FND_API.g_exc_unexpected_error;
2111: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2112: RAISE FND_API.g_exc_unexpected_error;
2113: END IF;
2114:
2115: END IF;
2108:
2109: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2110: RAISE FND_API.g_exc_unexpected_error;
2111: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2112: RAISE FND_API.g_exc_unexpected_error;
2113: END IF;
2114:
2115: END IF;
2116: --
2171: ,p_allocation_for_id => l_account_allocation_id
2172: ,p_quota_products_tbl => l_prod_for_this_acct_tbl
2173: ,p_quota_prod_spread_tbl => l_prod_sprd_for_this_acct_tbl );
2174:
2175: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2176: RAISE FND_API.g_exc_unexpected_error;
2177: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2178: RAISE FND_API.g_exc_unexpected_error;
2179: END IF;
2172: ,p_quota_products_tbl => l_prod_for_this_acct_tbl
2173: ,p_quota_prod_spread_tbl => l_prod_sprd_for_this_acct_tbl );
2174:
2175: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2176: RAISE FND_API.g_exc_unexpected_error;
2177: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2178: RAISE FND_API.g_exc_unexpected_error;
2179: END IF;
2180:
2173: ,p_quota_prod_spread_tbl => l_prod_sprd_for_this_acct_tbl );
2174:
2175: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2176: RAISE FND_API.g_exc_unexpected_error;
2177: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2178: RAISE FND_API.g_exc_unexpected_error;
2179: END IF;
2180:
2181: <
2174:
2175: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2176: RAISE FND_API.g_exc_unexpected_error;
2177: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2178: RAISE FND_API.g_exc_unexpected_error;
2179: END IF;
2180:
2181: <
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: );
2191:
2189: p_data => x_msg_data
2190: );
2191:
2192: EXCEPTION
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
2191:
2192: EXCEPTION
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
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
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
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
2199: ,p_data => x_msg_data
2200: );
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
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
2207: ,p_data => x_msg_data
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
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:
2235: -- 06/29/2005 kdass Created
2236: ---------------------------------------------------------------------
2237: PROCEDURE create_quota(
2238: p_api_version IN NUMBER
2239: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
2240: ,p_commit IN VARCHAR2 := fnd_api.g_false
2241: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
2242: ,x_return_status OUT NOCOPY VARCHAR2
2243: ,x_msg_count OUT NOCOPY NUMBER
2236: ---------------------------------------------------------------------
2237: PROCEDURE create_quota(
2238: p_api_version IN NUMBER
2239: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
2240: ,p_commit IN VARCHAR2 := fnd_api.g_false
2241: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
2242: ,x_return_status OUT NOCOPY VARCHAR2
2243: ,x_msg_count OUT NOCOPY NUMBER
2244: ,x_msg_data OUT NOCOPY VARCHAR2
2237: PROCEDURE create_quota(
2238: p_api_version IN NUMBER
2239: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
2240: ,p_commit IN VARCHAR2 := fnd_api.g_false
2241: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
2242: ,x_return_status OUT NOCOPY VARCHAR2
2243: ,x_msg_count OUT NOCOPY NUMBER
2244: ,x_msg_data OUT NOCOPY VARCHAR2
2245: ,p_method IN VARCHAR2 := 'MANUAL'
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: --
2293: END IF;
2294:
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: --
2293: END IF;
2294:
2295: ------------------------------------------------------------------------------
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;
2307:
2308: -- Create_Quota_Header will create quota and associate products
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;
2307:
2308: -- Create_Quota_Header will create quota and associate products
2309: -- These both are always required by any quota
2327: ozf_utility_pvt.debug_message('Quota ID: ' || x_quota_id);
2328: ozf_utility_pvt.debug_message('Return Status: ' || x_return_status);
2329: END IF;
2330:
2331: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2332: RAISE FND_API.g_exc_unexpected_error;
2333: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2334: RAISE FND_API.g_exc_unexpected_error;
2335: END IF;
2328: ozf_utility_pvt.debug_message('Return Status: ' || x_return_status);
2329: END IF;
2330:
2331: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2332: RAISE FND_API.g_exc_unexpected_error;
2333: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2334: RAISE FND_API.g_exc_unexpected_error;
2335: END IF;
2336:
2329: END IF;
2330:
2331: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2332: RAISE FND_API.g_exc_unexpected_error;
2333: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2334: RAISE FND_API.g_exc_unexpected_error;
2335: END IF;
2336:
2337: IF p_method = 'ALLOCATION'
2330:
2331: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2332: RAISE FND_API.g_exc_unexpected_error;
2333: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2334: RAISE FND_API.g_exc_unexpected_error;
2335: END IF;
2336:
2337: IF p_method = 'ALLOCATION'
2338: THEN
2346: ,x_return_status => x_return_status
2347: ,x_error_number => x_msg_count
2348: ,x_error_message => x_msg_data );
2349:
2350: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2351: RAISE FND_API.g_exc_unexpected_error;
2352: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2353: RAISE FND_API.g_exc_unexpected_error;
2354: END IF;
2347: ,x_error_number => x_msg_count
2348: ,x_error_message => x_msg_data );
2349:
2350: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2351: RAISE FND_API.g_exc_unexpected_error;
2352: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2353: RAISE FND_API.g_exc_unexpected_error;
2354: END IF;
2355:
2348: ,x_error_message => x_msg_data );
2349:
2350: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2351: RAISE FND_API.g_exc_unexpected_error;
2352: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2353: RAISE FND_API.g_exc_unexpected_error;
2354: END IF;
2355:
2356: l_alloc_rec.quota_id := x_quota_id;
2349:
2350: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2351: RAISE FND_API.g_exc_unexpected_error;
2352: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2353: RAISE FND_API.g_exc_unexpected_error;
2354: END IF;
2355:
2356: l_alloc_rec.quota_id := x_quota_id;
2357:
2365: ,x_msg_count => x_msg_count
2366: ,x_msg_data => x_msg_data
2367: ,x_alloc_id => l_alloc_id);
2368:
2369: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2370: RAISE FND_API.g_exc_unexpected_error;
2371: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2372: RAISE FND_API.g_exc_unexpected_error;
2373: END IF;
2366: ,x_msg_data => x_msg_data
2367: ,x_alloc_id => l_alloc_id);
2368:
2369: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2370: RAISE FND_API.g_exc_unexpected_error;
2371: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2372: RAISE FND_API.g_exc_unexpected_error;
2373: END IF;
2374:
2367: ,x_alloc_id => l_alloc_id);
2368:
2369: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2370: RAISE FND_API.g_exc_unexpected_error;
2371: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2372: RAISE FND_API.g_exc_unexpected_error;
2373: END IF;
2374:
2375: publish_allocation(
2368:
2369: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2370: RAISE FND_API.g_exc_unexpected_error;
2371: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2372: RAISE FND_API.g_exc_unexpected_error;
2373: END IF;
2374:
2375: publish_allocation(
2376: p_api_version => p_api_version
2381: ,x_return_status => x_return_status
2382: ,x_msg_count => x_msg_count
2383: ,x_msg_data => x_msg_data );
2384:
2385: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2386: RAISE FND_API.g_exc_unexpected_error;
2387: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2388: RAISE FND_API.g_exc_unexpected_error;
2389: END IF;
2382: ,x_msg_count => x_msg_count
2383: ,x_msg_data => x_msg_data );
2384:
2385: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2386: RAISE FND_API.g_exc_unexpected_error;
2387: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2388: RAISE FND_API.g_exc_unexpected_error;
2389: END IF;
2390:
2383: ,x_msg_data => x_msg_data );
2384:
2385: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2386: RAISE FND_API.g_exc_unexpected_error;
2387: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2388: RAISE FND_API.g_exc_unexpected_error;
2389: END IF;
2390:
2391: END IF;
2384:
2385: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2386: RAISE FND_API.g_exc_unexpected_error;
2387: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2388: RAISE FND_API.g_exc_unexpected_error;
2389: END IF;
2390:
2391: END IF;
2392:
2405: ,p_allocation_for_id => x_quota_id
2406: ,p_quota_products_tbl => l_quota_products_tbl
2407: ,p_quota_prod_spread_tbl => l_quota_prod_spread_tbl );
2408:
2409: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2410: RAISE FND_API.g_exc_unexpected_error;
2411: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2412: RAISE FND_API.g_exc_unexpected_error;
2413: END IF;
2406: ,p_quota_products_tbl => l_quota_products_tbl
2407: ,p_quota_prod_spread_tbl => l_quota_prod_spread_tbl );
2408:
2409: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2410: RAISE FND_API.g_exc_unexpected_error;
2411: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2412: RAISE FND_API.g_exc_unexpected_error;
2413: END IF;
2414:
2407: ,p_quota_prod_spread_tbl => l_quota_prod_spread_tbl );
2408:
2409: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2410: RAISE FND_API.g_exc_unexpected_error;
2411: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2412: RAISE FND_API.g_exc_unexpected_error;
2413: END IF;
2414:
2415: IF p_quota_accounts_tbl.COUNT <> 0
2408:
2409: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2410: RAISE FND_API.g_exc_unexpected_error;
2411: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2412: RAISE FND_API.g_exc_unexpected_error;
2413: END IF;
2414:
2415: IF p_quota_accounts_tbl.COUNT <> 0
2416: THEN
2430: ,p_acct_prod_spread_tbl => l_acct_prod_spread_tbl);
2431: --
2432: END IF;
2433:
2434: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2435: RAISE FND_API.g_exc_unexpected_error;
2436: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2437: RAISE FND_API.g_exc_unexpected_error;
2438: END IF;
2431: --
2432: END IF;
2433:
2434: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2435: RAISE FND_API.g_exc_unexpected_error;
2436: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2437: RAISE FND_API.g_exc_unexpected_error;
2438: END IF;
2439:
2432: END IF;
2433:
2434: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2435: RAISE FND_API.g_exc_unexpected_error;
2436: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2437: RAISE FND_API.g_exc_unexpected_error;
2438: END IF;
2439:
2440: --
2433:
2434: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2435: RAISE FND_API.g_exc_unexpected_error;
2436: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2437: RAISE FND_API.g_exc_unexpected_error;
2438: END IF;
2439:
2440: --
2441: END IF;
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: );
2453:
2451: p_data => x_msg_data
2452: );
2453:
2454: EXCEPTION
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
2453:
2454: EXCEPTION
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
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
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
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
2461: ,p_data => x_msg_data
2462: );
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
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
2469: ,p_data => x_msg_data
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
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;
2495: -- 06/29/2005 kdass Created
2496: ---------------------------------------------------------------------
2497: PROCEDURE update_quota(
2498: p_api_version IN NUMBER
2499: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
2500: ,p_commit IN VARCHAR2 := fnd_api.g_false
2501: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
2502: ,x_return_status OUT NOCOPY VARCHAR2
2503: ,x_msg_count OUT NOCOPY NUMBER
2496: ---------------------------------------------------------------------
2497: PROCEDURE update_quota(
2498: p_api_version IN NUMBER
2499: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
2500: ,p_commit IN VARCHAR2 := fnd_api.g_false
2501: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
2502: ,x_return_status OUT NOCOPY VARCHAR2
2503: ,x_msg_count OUT NOCOPY NUMBER
2504: ,x_msg_data OUT NOCOPY VARCHAR2
2497: PROCEDURE update_quota(
2498: p_api_version IN NUMBER
2499: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
2500: ,p_commit IN VARCHAR2 := fnd_api.g_false
2501: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
2502: ,x_return_status OUT NOCOPY VARCHAR2
2503: ,x_msg_count OUT NOCOPY NUMBER
2504: ,x_msg_data OUT NOCOPY VARCHAR2
2505: ,p_quota_rec IN quota_rec_type
2595: ,p_method => 'MANUAL'
2596: ,p_fund_rec => l_fund_rec
2597: ,x_return_status => x_return_status);
2598:
2599: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2600: RAISE fnd_api.g_exc_unexpected_error;
2601: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
2602: RAISE fnd_api.g_exc_error;
2603: END IF;
2596: ,p_fund_rec => l_fund_rec
2597: ,x_return_status => x_return_status);
2598:
2599: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2600: RAISE fnd_api.g_exc_unexpected_error;
2601: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
2602: RAISE fnd_api.g_exc_error;
2603: END IF;
2604:
2597: ,x_return_status => x_return_status);
2598:
2599: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2600: RAISE fnd_api.g_exc_unexpected_error;
2601: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
2602: RAISE fnd_api.g_exc_error;
2603: END IF;
2604:
2605: l_fund_rec.fund_id := l_quota_rec.quota_id;
2598:
2599: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2600: RAISE fnd_api.g_exc_unexpected_error;
2601: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
2602: RAISE fnd_api.g_exc_error;
2603: END IF;
2604:
2605: l_fund_rec.fund_id := l_quota_rec.quota_id;
2606: l_fund_rec.fund_number := l_quota_rec.quota_number;
2639: ,p_qualifier_tbl => l_qualifier_tbl
2640: ,p_vo_mo_tbl => l_vo_mo_tbl
2641: );
2642:
2643: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2644: RAISE fnd_api.g_exc_unexpected_error;
2645: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
2646: RAISE fnd_api.g_exc_error;
2647: END IF;
2640: ,p_vo_mo_tbl => l_vo_mo_tbl
2641: );
2642:
2643: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2644: RAISE fnd_api.g_exc_unexpected_error;
2645: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
2646: RAISE fnd_api.g_exc_error;
2647: END IF;
2648:
2641: );
2642:
2643: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2644: RAISE fnd_api.g_exc_unexpected_error;
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 (
2642:
2643: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2644: RAISE fnd_api.g_exc_unexpected_error;
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,
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: );
2654:
2652: p_data => x_msg_data
2653: );
2654:
2655: EXCEPTION
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
2654:
2655: EXCEPTION
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
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
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
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
2662: ,p_data => x_msg_data
2663: );
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
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
2670: ,p_data => x_msg_data
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
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;
2683: END Update_Quota;
2684:
2685: PROCEDURE Update_Quota_Product_Spread(
2686: p_api_version IN NUMBER
2687: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
2688: ,p_commit IN VARCHAR2 := fnd_api.g_false
2689: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
2690: ,x_return_status OUT NOCOPY VARCHAR2
2691: ,x_msg_count OUT NOCOPY NUMBER
2684:
2685: PROCEDURE Update_Quota_Product_Spread(
2686: p_api_version IN NUMBER
2687: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
2688: ,p_commit IN VARCHAR2 := fnd_api.g_false
2689: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
2690: ,x_return_status OUT NOCOPY VARCHAR2
2691: ,x_msg_count OUT NOCOPY NUMBER
2692: ,x_msg_data OUT NOCOPY VARCHAR2
2685: PROCEDURE Update_Quota_Product_Spread(
2686: p_api_version IN NUMBER
2687: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
2688: ,p_commit IN VARCHAR2 := fnd_api.g_false
2689: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
2690: ,x_return_status OUT NOCOPY VARCHAR2
2691: ,x_msg_count OUT NOCOPY NUMBER
2692: ,x_msg_data OUT NOCOPY VARCHAR2
2693: ,p_quota_products_tbl IN quota_products_tbl_type
2719: ozf_utility_pvt.debug_message('Start Procedure: '|| l_api_name );
2720: END IF;
2721:
2722: -- Initialize API return status to success
2723: x_return_status := FND_API.G_RET_STS_SUCCESS;
2724:
2725: ---------------------------------------------
2726:
2727: IF p_quota_products_tbl.COUNT > 0
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: --
2750: END IF;
2751:
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: --
2788: END IF;
2789:
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: );
2813:
2811: p_data => x_msg_data
2812: );
2813:
2814: EXCEPTION
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
2813:
2814: EXCEPTION
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
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:
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
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
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
2830: ,p_data => x_msg_data
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
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:
2845:
2846:
2847: PROCEDURE Update_Quota_Account_Spread(
2848: p_api_version IN NUMBER
2849: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
2850: ,p_commit IN VARCHAR2 := fnd_api.g_false
2851: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
2852: ,x_return_status OUT NOCOPY VARCHAR2
2853: ,x_msg_count OUT NOCOPY NUMBER
2846:
2847: PROCEDURE Update_Quota_Account_Spread(
2848: p_api_version IN NUMBER
2849: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
2850: ,p_commit IN VARCHAR2 := fnd_api.g_false
2851: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
2852: ,x_return_status OUT NOCOPY VARCHAR2
2853: ,x_msg_count OUT NOCOPY NUMBER
2854: ,x_msg_data OUT NOCOPY VARCHAR2
2847: PROCEDURE Update_Quota_Account_Spread(
2848: p_api_version IN NUMBER
2849: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
2850: ,p_commit IN VARCHAR2 := fnd_api.g_false
2851: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
2852: ,x_return_status OUT NOCOPY VARCHAR2
2853: ,x_msg_count OUT NOCOPY NUMBER
2854: ,x_msg_data OUT NOCOPY VARCHAR2
2855: ,p_quota_accounts_tbl IN quota_accounts_tbl_type
2880: ozf_utility_pvt.debug_message('Start Procedure: '|| l_api_name );
2881: END IF;
2882:
2883: -- Initialize API return status to success
2884: x_return_status := FND_API.G_RET_STS_SUCCESS;
2885:
2886: ---------------------------------------------
2887:
2888: IF p_quota_accounts_tbl.COUNT > 0
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: --
2911: END IF;
2912:
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: --
2949: END IF;
2950:
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: );
2974:
2972: p_data => x_msg_data
2973: );
2974:
2975: EXCEPTION
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
2974:
2975: EXCEPTION
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
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:
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
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
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
2991: ,p_data => x_msg_data
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
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:
3081: -- 07/04/2005 kdass Created
3082: ---------------------------------------------------------------------
3083: PROCEDURE delete_quota(
3084: p_api_version IN NUMBER
3085: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
3086: ,p_commit IN VARCHAR2 := fnd_api.g_false
3087: ,p_quota_id IN NUMBER
3088: ,x_return_status OUT NOCOPY VARCHAR2
3089: ,x_msg_count OUT NOCOPY NUMBER
3082: ---------------------------------------------------------------------
3083: PROCEDURE delete_quota(
3084: p_api_version IN NUMBER
3085: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
3086: ,p_commit IN VARCHAR2 := fnd_api.g_false
3087: ,p_quota_id IN NUMBER
3088: ,x_return_status OUT NOCOPY VARCHAR2
3089: ,x_msg_count OUT NOCOPY NUMBER
3090: ,x_msg_data OUT NOCOPY VARCHAR2
3107:
3108: SAVEPOINT delete_quota;
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;
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:
3120: --check if the quota id is valid and get the object_version_number
3121: OPEN c_valid_quota;
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:
3133: delete_quota_allocations(p_quota_id);
3134:
3142: ,x_msg_count => x_msg_count
3143: ,x_msg_data => x_msg_data
3144: );
3145:
3146: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3147: RAISE fnd_api.g_exc_unexpected_error;
3148: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3149: RAISE fnd_api.g_exc_error;
3150: END IF;
3143: ,x_msg_data => x_msg_data
3144: );
3145:
3146: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3147: RAISE fnd_api.g_exc_unexpected_error;
3148: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3149: RAISE fnd_api.g_exc_error;
3150: END IF;
3151:
3144: );
3145:
3146: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3147: RAISE fnd_api.g_exc_unexpected_error;
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 (
3145:
3146: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3147: RAISE fnd_api.g_exc_unexpected_error;
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,
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: );
3157:
3155: p_data => x_msg_data
3156: );
3157:
3158: EXCEPTION
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
3157:
3158: EXCEPTION
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
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
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
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
3165: ,p_data => x_msg_data
3166: );
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
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
3173: ,p_data => x_msg_data
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
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;
3199: -- 07/04/2005 kdass Created
3200: ---------------------------------------------------------------------
3201: PROCEDURE generate_product_spread(
3202: p_api_version IN NUMBER
3203: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
3204: ,p_commit IN VARCHAR2 := fnd_api.g_false
3205: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
3206: ,p_quota_id IN NUMBER
3207: ,x_return_status OUT NOCOPY VARCHAR2
3200: ---------------------------------------------------------------------
3201: PROCEDURE generate_product_spread(
3202: p_api_version IN NUMBER
3203: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
3204: ,p_commit IN VARCHAR2 := fnd_api.g_false
3205: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
3206: ,p_quota_id IN NUMBER
3207: ,x_return_status OUT NOCOPY VARCHAR2
3208: ,x_error_number OUT NOCOPY NUMBER
3201: PROCEDURE generate_product_spread(
3202: p_api_version IN NUMBER
3203: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
3204: ,p_commit IN VARCHAR2 := fnd_api.g_false
3205: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
3206: ,p_quota_id IN NUMBER
3207: ,x_return_status OUT NOCOPY VARCHAR2
3208: ,x_error_number OUT NOCOPY NUMBER
3209: ,x_error_message OUT NOCOPY VARCHAR2
3233:
3234: SAVEPOINT generate_product_spread;
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;
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:
3246: --check if the quota id is valid and get the object_version_number
3247: OPEN c_valid_quota;
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:
3259: --check if the quota has any products
3260: OPEN c_product_exists;
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:
3272: -- create product spread for quota
3273: OZF_ALLOCATION_ENGINE_PVT.setup_product_spread(p_api_version => l_api_version
3281: ,p_obj_id => p_quota_id
3282: ,p_context => 'ROOT'
3283: );
3284:
3285: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3286: RAISE fnd_api.g_exc_unexpected_error;
3287: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3288: RAISE fnd_api.g_exc_error;
3289: END IF;
3282: ,p_context => 'ROOT'
3283: );
3284:
3285: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3286: RAISE fnd_api.g_exc_unexpected_error;
3287: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3288: RAISE fnd_api.g_exc_error;
3289: END IF;
3290:
3283: );
3284:
3285: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3286: RAISE fnd_api.g_exc_unexpected_error;
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,
3284:
3285: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3286: RAISE fnd_api.g_exc_unexpected_error;
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);
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
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);
3293:
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;
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;
3303: FND_MSG_PUB.Count_And_Get(p_count => x_error_number,
3304: p_data => x_error_message);
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;
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;
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;
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,
3327: -- 07/04/2005 kdass Created
3328: ---------------------------------------------------------------------
3329: PROCEDURE create_allocation(
3330: p_api_version IN NUMBER
3331: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
3332: ,p_commit IN VARCHAR2 := fnd_api.g_false
3333: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
3334: ,p_alloc_rec IN alloc_rec_type
3335: ,x_return_status OUT NOCOPY VARCHAR2
3328: ---------------------------------------------------------------------
3329: PROCEDURE create_allocation(
3330: p_api_version IN NUMBER
3331: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
3332: ,p_commit IN VARCHAR2 := fnd_api.g_false
3333: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
3334: ,p_alloc_rec IN alloc_rec_type
3335: ,x_return_status OUT NOCOPY VARCHAR2
3336: ,x_msg_count OUT NOCOPY NUMBER
3329: PROCEDURE create_allocation(
3330: p_api_version IN NUMBER
3331: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
3332: ,p_commit IN VARCHAR2 := fnd_api.g_false
3333: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
3334: ,p_alloc_rec IN alloc_rec_type
3335: ,x_return_status OUT NOCOPY VARCHAR2
3336: ,x_msg_count OUT NOCOPY NUMBER
3337: ,x_msg_data OUT NOCOPY VARCHAR2
3358:
3359: validate_alloc_attributes(p_alloc_rec => l_alloc_rec
3360: ,x_return_status => x_return_status);
3361:
3362: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3363: RAISE fnd_api.g_exc_unexpected_error;
3364: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3365: RAISE fnd_api.g_exc_error;
3366: END IF;
3359: validate_alloc_attributes(p_alloc_rec => l_alloc_rec
3360: ,x_return_status => x_return_status);
3361:
3362: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3363: RAISE fnd_api.g_exc_unexpected_error;
3364: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3365: RAISE fnd_api.g_exc_error;
3366: END IF;
3367:
3360: ,x_return_status => x_return_status);
3361:
3362: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3363: RAISE fnd_api.g_exc_unexpected_error;
3364: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3365: RAISE fnd_api.g_exc_error;
3366: END IF;
3367:
3368: --check if the product spread exists
3361:
3362: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3363: RAISE fnd_api.g_exc_unexpected_error;
3364: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3365: RAISE fnd_api.g_exc_error;
3366: END IF;
3367:
3368: --check if the product spread exists
3369: OPEN c_product_spread_exists (l_alloc_rec.quota_id);
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:
3381: l_act_metric_rec.act_metric_used_by_id := l_alloc_rec.quota_id;
3382: l_act_metric_rec.arc_act_metric_used_by := 'FUND';
3422: ,p_alloc_id => x_alloc_id
3423: );
3424: END IF;
3425:
3426: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3427: RAISE fnd_api.g_exc_unexpected_error;
3428: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3429: RAISE fnd_api.g_exc_error;
3430: END IF;
3423: );
3424: END IF;
3425:
3426: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3427: RAISE fnd_api.g_exc_unexpected_error;
3428: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3429: RAISE fnd_api.g_exc_error;
3430: END IF;
3431:
3424: END IF;
3425:
3426: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3427: RAISE fnd_api.g_exc_unexpected_error;
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 (
3425:
3426: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3427: RAISE fnd_api.g_exc_unexpected_error;
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,
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: );
3437:
3435: p_data => x_msg_data
3436: );
3437:
3438: EXCEPTION
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
3437:
3438: EXCEPTION
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
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
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
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
3445: ,p_data => x_msg_data
3446: );
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
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
3453: ,p_data => x_msg_data
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
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;
3479: -- 07/04/2005 kdass Created
3480: ---------------------------------------------------------------------
3481: PROCEDURE publish_allocation(
3482: p_api_version IN NUMBER
3483: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
3484: ,p_commit IN VARCHAR2 := fnd_api.g_false
3485: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
3486: ,p_alloc_id IN NUMBER
3487: ,x_return_status OUT NOCOPY VARCHAR2
3480: ---------------------------------------------------------------------
3481: PROCEDURE publish_allocation(
3482: p_api_version IN NUMBER
3483: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
3484: ,p_commit IN VARCHAR2 := fnd_api.g_false
3485: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
3486: ,p_alloc_id IN NUMBER
3487: ,x_return_status OUT NOCOPY VARCHAR2
3488: ,x_msg_count OUT NOCOPY NUMBER
3481: PROCEDURE publish_allocation(
3482: p_api_version IN NUMBER
3483: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
3484: ,p_commit IN VARCHAR2 := fnd_api.g_false
3485: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
3486: ,p_alloc_id IN NUMBER
3487: ,x_return_status OUT NOCOPY VARCHAR2
3488: ,x_msg_count OUT NOCOPY NUMBER
3489: ,x_msg_data OUT NOCOPY VARCHAR2
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:
3529: OPEN c_alloc_details;
3530: FETCH c_alloc_details INTO l_alloc_status, l_alloc_obj_ver;
3541: ,x_msg_count => x_msg_count
3542: ,x_msg_data => x_msg_data
3543: );
3544:
3545: IF x_return_status = fnd_api.g_ret_sts_error THEN
3546: RAISE fnd_api.g_exc_error;
3547: ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3548: RAISE fnd_api.g_exc_unexpected_error;
3549: END IF;
3542: ,x_msg_data => x_msg_data
3543: );
3544:
3545: IF x_return_status = fnd_api.g_ret_sts_error THEN
3546: RAISE fnd_api.g_exc_error;
3547: ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3548: RAISE fnd_api.g_exc_unexpected_error;
3549: END IF;
3550:
3543: );
3544:
3545: IF x_return_status = fnd_api.g_ret_sts_error THEN
3546: RAISE fnd_api.g_exc_error;
3547: ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3548: RAISE fnd_api.g_exc_unexpected_error;
3549: END IF;
3550:
3551: ozf_quota_allocations_pvt.publish_allocation(p_api_version => l_api_version
3544:
3545: IF x_return_status = fnd_api.g_ret_sts_error THEN
3546: RAISE fnd_api.g_exc_error;
3547: ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3548: RAISE fnd_api.g_exc_unexpected_error;
3549: END IF;
3550:
3551: ozf_quota_allocations_pvt.publish_allocation(p_api_version => l_api_version
3552: ,p_init_msg_list => l_init_msg_list
3557: ,x_msg_count => x_msg_count
3558: ,x_msg_data => x_msg_data
3559: );
3560:
3561: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3562: RAISE fnd_api.g_exc_unexpected_error;
3563: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3564: RAISE fnd_api.g_exc_error;
3565: END IF;
3558: ,x_msg_data => x_msg_data
3559: );
3560:
3561: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3562: RAISE fnd_api.g_exc_unexpected_error;
3563: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3564: RAISE fnd_api.g_exc_error;
3565: END IF;
3566:
3559: );
3560:
3561: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3562: RAISE fnd_api.g_exc_unexpected_error;
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 (
3560:
3561: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3562: RAISE fnd_api.g_exc_unexpected_error;
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,
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: );
3572:
3570: p_data => x_msg_data
3571: );
3572:
3573: EXCEPTION
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
3572:
3573: EXCEPTION
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
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
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
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
3580: ,p_data => x_msg_data
3581: );
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
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
3588: ,p_data => x_msg_data
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
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;
3615: -- 07/04/2005 kdass Created
3616: ---------------------------------------------------------------------
3617: PROCEDURE update_alloc_status(
3618: p_api_version IN NUMBER
3619: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
3620: ,p_commit IN VARCHAR2 := fnd_api.g_false
3621: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
3622: ,p_alloc_id IN NUMBER
3623: ,p_alloc_status IN VARCHAR2
3616: ---------------------------------------------------------------------
3617: PROCEDURE update_alloc_status(
3618: p_api_version IN NUMBER
3619: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
3620: ,p_commit IN VARCHAR2 := fnd_api.g_false
3621: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
3622: ,p_alloc_id IN NUMBER
3623: ,p_alloc_status IN VARCHAR2
3624: ,x_return_status OUT NOCOPY VARCHAR2
3617: PROCEDURE update_alloc_status(
3618: p_api_version IN NUMBER
3619: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
3620: ,p_commit IN VARCHAR2 := fnd_api.g_false
3621: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
3622: ,p_alloc_id IN NUMBER
3623: ,p_alloc_status IN VARCHAR2
3624: ,x_return_status OUT NOCOPY VARCHAR2
3625: ,x_msg_count OUT NOCOPY NUMBER
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:
3659: ozf_fund_allocations_pvt.update_alloc_status(p_api_version => l_api_version
3660: ,p_init_msg_list => l_init_msg_list
3667: ,x_msg_count => x_msg_count
3668: ,x_msg_data => x_msg_data
3669: );
3670:
3671: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3672: RAISE fnd_api.g_exc_unexpected_error;
3673: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3674: RAISE fnd_api.g_exc_error;
3675: END IF;
3668: ,x_msg_data => x_msg_data
3669: );
3670:
3671: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3672: RAISE fnd_api.g_exc_unexpected_error;
3673: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
3674: RAISE fnd_api.g_exc_error;
3675: END IF;
3676:
3669: );
3670:
3671: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3672: RAISE fnd_api.g_exc_unexpected_error;
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 (
3670:
3671: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
3672: RAISE fnd_api.g_exc_unexpected_error;
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,
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: );
3682: */
3680: p_data => x_msg_data
3681: );
3682: */
3683: EXCEPTION
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
3682: */
3683: EXCEPTION
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
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
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
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
3690: ,p_data => x_msg_data
3691: );
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
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
3698: ,p_data => x_msg_data
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
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;