73: );
74: END IF;
75:
76: -- Add the new scenario to the dimension
77: dbms_aw.execute('MAINTAIN scenario_d ADD ' || x_scenario_id);
78:
79:
80: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
81: fnd_log.string
85: 'Setting PC relation for new scenario.'
86: );
87: END IF;
88:
89: dbms_aw.execute('PUSH scenario_d');
90: dbms_aw.execute('LMT scenario_d TO ' || x_scenario_id);
91: -- Associate the scenario with the planning cycle
92: dbms_aw.execute('planning_cycle_scenario_r = ' || p_pc_id);
93: dbms_aw.execute('POP scenario_d');
86: );
87: END IF;
88:
89: dbms_aw.execute('PUSH scenario_d');
90: dbms_aw.execute('LMT scenario_d TO ' || x_scenario_id);
91: -- Associate the scenario with the planning cycle
92: dbms_aw.execute('planning_cycle_scenario_r = ' || p_pc_id);
93: dbms_aw.execute('POP scenario_d');
94:
88:
89: dbms_aw.execute('PUSH scenario_d');
90: dbms_aw.execute('LMT scenario_d TO ' || x_scenario_id);
91: -- Associate the scenario with the planning cycle
92: dbms_aw.execute('planning_cycle_scenario_r = ' || p_pc_id);
93: dbms_aw.execute('POP scenario_d');
94:
95: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
96: fnd_log.string
89: dbms_aw.execute('PUSH scenario_d');
90: dbms_aw.execute('LMT scenario_d TO ' || x_scenario_id);
91: -- Associate the scenario with the planning cycle
92: dbms_aw.execute('planning_cycle_scenario_r = ' || p_pc_id);
93: dbms_aw.execute('POP scenario_d');
94:
95: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
96: fnd_log.string
97: (
220: );
221: END IF;
222:
223:
224: dbms_aw.execute('call copy_sce_data_prg(' || p_scenario_id_source || ' ' || p_scenario_id_target || ' ''' || p_copy_proposed_proj || ''')');
225:
226: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
227: fnd_log.string
228: (
287: END IF;
288:
289: END IF;
290:
291: dbms_aw.execute('LMT scenario_d TO '''
292: || p_scenario_rec.sce_shortname || '''');
293:
294: -- Lock the scenario
295: dbms_aw.execute('is_scenario_locked_m = true');
291: dbms_aw.execute('LMT scenario_d TO '''
292: || p_scenario_rec.sce_shortname || '''');
293:
294: -- Lock the scenario
295: dbms_aw.execute('is_scenario_locked_m = true');
296:
297: -- Set the last update date
298: dbms_aw.execute('last_update_date_scenario_r = '''
299: || to_char(SYSDATE, 'MM-DD-YYYY') || '''');
294: -- Lock the scenario
295: dbms_aw.execute('is_scenario_locked_m = true');
296:
297: -- Set the last update date
298: dbms_aw.execute('last_update_date_scenario_r = '''
299: || to_char(SYSDATE, 'MM-DD-YYYY') || '''');
300:
301: IF g_attach_aw THEN
302: -- Update and commit our changes
300:
301: IF g_attach_aw THEN
302: -- Update and commit our changes
303: IF (p_commit = FND_API.G_TRUE) THEN
304: dbms_aw.execute('UPDATE');
305: COMMIT;
306: END IF;
307:
308: -- Finally, detach the workspace
419:
420: -- Bug 4331948 . Reset apporved flag of all scenario for this planning cycle.
421: -- this make sure there will be only one scenario is apporved
422: -- fix start
423: dbms_aw.execute('LMT scenario_d TO '|| p_scenario_id );
424: dbms_aw.execute('LMT planning_cycle_d to scenario_d');
425: dbms_aw.execute('LMT scenario_d to planning_cycle_d');
426: dbms_aw.execute('scenario_approved_flag_m = na');
427: -- fix end
420: -- Bug 4331948 . Reset apporved flag of all scenario for this planning cycle.
421: -- this make sure there will be only one scenario is apporved
422: -- fix start
423: dbms_aw.execute('LMT scenario_d TO '|| p_scenario_id );
424: dbms_aw.execute('LMT planning_cycle_d to scenario_d');
425: dbms_aw.execute('LMT scenario_d to planning_cycle_d');
426: dbms_aw.execute('scenario_approved_flag_m = na');
427: -- fix end
428:
421: -- this make sure there will be only one scenario is apporved
422: -- fix start
423: dbms_aw.execute('LMT scenario_d TO '|| p_scenario_id );
424: dbms_aw.execute('LMT planning_cycle_d to scenario_d');
425: dbms_aw.execute('LMT scenario_d to planning_cycle_d');
426: dbms_aw.execute('scenario_approved_flag_m = na');
427: -- fix end
428:
429: dbms_aw.execute('LMT scenario_d TO '|| p_scenario_id );
422: -- fix start
423: dbms_aw.execute('LMT scenario_d TO '|| p_scenario_id );
424: dbms_aw.execute('LMT planning_cycle_d to scenario_d');
425: dbms_aw.execute('LMT scenario_d to planning_cycle_d');
426: dbms_aw.execute('scenario_approved_flag_m = na');
427: -- fix end
428:
429: dbms_aw.execute('LMT scenario_d TO '|| p_scenario_id );
430:
425: dbms_aw.execute('LMT scenario_d to planning_cycle_d');
426: dbms_aw.execute('scenario_approved_flag_m = na');
427: -- fix end
428:
429: dbms_aw.execute('LMT scenario_d TO '|| p_scenario_id );
430:
431: dbms_aw.execute('scenario_approved_flag_m = ' || p_approved_flag);
432:
433: -- Set the last update date
427: -- fix end
428:
429: dbms_aw.execute('LMT scenario_d TO '|| p_scenario_id );
430:
431: dbms_aw.execute('scenario_approved_flag_m = ' || p_approved_flag);
432:
433: -- Set the last update date
434: -- need to wite code for this
435:
500: 'Setting the discount rate.'
501: );
502: END IF;
503:
504: dbms_aw.execute('PUSH scenario_d');
505: dbms_aw.execute('LMT scenario_d TO ' || p_scenario_id);
506: -- Associate the scenario with the planning cycle
507: dbms_aw.execute('scenario_discount_rate_m = ' || p_discount_rate/100);
508: -- Update daily discount rate
501: );
502: END IF;
503:
504: dbms_aw.execute('PUSH scenario_d');
505: dbms_aw.execute('LMT scenario_d TO ' || p_scenario_id);
506: -- Associate the scenario with the planning cycle
507: dbms_aw.execute('scenario_discount_rate_m = ' || p_discount_rate/100);
508: -- Update daily discount rate
509: dbms_aw.execute('scenario_discount_rate_daily_m = ((1+scenario_discount_rate_m)**(1/365))-1');
503:
504: dbms_aw.execute('PUSH scenario_d');
505: dbms_aw.execute('LMT scenario_d TO ' || p_scenario_id);
506: -- Associate the scenario with the planning cycle
507: dbms_aw.execute('scenario_discount_rate_m = ' || p_discount_rate/100);
508: -- Update daily discount rate
509: dbms_aw.execute('scenario_discount_rate_daily_m = ((1+scenario_discount_rate_m)**(1/365))-1');
510: dbms_aw.execute('POP scenario_d');
511:
505: dbms_aw.execute('LMT scenario_d TO ' || p_scenario_id);
506: -- Associate the scenario with the planning cycle
507: dbms_aw.execute('scenario_discount_rate_m = ' || p_discount_rate/100);
508: -- Update daily discount rate
509: dbms_aw.execute('scenario_discount_rate_daily_m = ((1+scenario_discount_rate_m)**(1/365))-1');
510: dbms_aw.execute('POP scenario_d');
511:
512: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
513: fnd_log.string
506: -- Associate the scenario with the planning cycle
507: dbms_aw.execute('scenario_discount_rate_m = ' || p_discount_rate/100);
508: -- Update daily discount rate
509: dbms_aw.execute('scenario_discount_rate_daily_m = ((1+scenario_discount_rate_m)**(1/365))-1');
510: dbms_aw.execute('POP scenario_d');
511:
512: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
513: fnd_log.string
514: (
582: WHERE a.planning_cycle = b.planning_cycle
583: AND a.scenario = p_scenario_id ;
584:
585:
586: dbms_aw.execute('PUSH scenario_d');
587: dbms_aw.execute('LMT scenario_d TO ' || p_scenario_id);
588: -- Associate the scenario with the planning cycle
589: dbms_aw.execute('scenario_funding_m = ' || p_scenario_funds*l_pc_disply_factor);
590: dbms_aw.execute('POP scenario_d');
583: AND a.scenario = p_scenario_id ;
584:
585:
586: dbms_aw.execute('PUSH scenario_d');
587: dbms_aw.execute('LMT scenario_d TO ' || p_scenario_id);
588: -- Associate the scenario with the planning cycle
589: dbms_aw.execute('scenario_funding_m = ' || p_scenario_funds*l_pc_disply_factor);
590: dbms_aw.execute('POP scenario_d');
591:
585:
586: dbms_aw.execute('PUSH scenario_d');
587: dbms_aw.execute('LMT scenario_d TO ' || p_scenario_id);
588: -- Associate the scenario with the planning cycle
589: dbms_aw.execute('scenario_funding_m = ' || p_scenario_funds*l_pc_disply_factor);
590: dbms_aw.execute('POP scenario_d');
591:
592: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
593: fnd_log.string
586: dbms_aw.execute('PUSH scenario_d');
587: dbms_aw.execute('LMT scenario_d TO ' || p_scenario_id);
588: -- Associate the scenario with the planning cycle
589: dbms_aw.execute('scenario_funding_m = ' || p_scenario_funds*l_pc_disply_factor);
590: dbms_aw.execute('POP scenario_d');
591:
592: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
593: fnd_log.string
594: (
653: 'Unsetting any previous flags and setting new flag.'
654: );
655: END IF;
656:
657: dbms_aw.execute('PUSH scenario_d');
658: dbms_aw.execute('PUSH planning_cycle_d');
659: dbms_aw.execute('oknullstatus = y');
660: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
661: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
654: );
655: END IF;
656:
657: dbms_aw.execute('PUSH scenario_d');
658: dbms_aw.execute('PUSH planning_cycle_d');
659: dbms_aw.execute('oknullstatus = y');
660: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
661: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
662: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
655: END IF;
656:
657: dbms_aw.execute('PUSH scenario_d');
658: dbms_aw.execute('PUSH planning_cycle_d');
659: dbms_aw.execute('oknullstatus = y');
660: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
661: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
662: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
663: dbms_aw.execute('limit scenario_d to planning_cycle_d');
656:
657: dbms_aw.execute('PUSH scenario_d');
658: dbms_aw.execute('PUSH planning_cycle_d');
659: dbms_aw.execute('oknullstatus = y');
660: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
661: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
662: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
663: dbms_aw.execute('limit scenario_d to planning_cycle_d');
664: dbms_aw.execute('limit scenario_d keep scenario_initial_m');
657: dbms_aw.execute('PUSH scenario_d');
658: dbms_aw.execute('PUSH planning_cycle_d');
659: dbms_aw.execute('oknullstatus = y');
660: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
661: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
662: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
663: dbms_aw.execute('limit scenario_d to planning_cycle_d');
664: dbms_aw.execute('limit scenario_d keep scenario_initial_m');
665: dbms_aw.execute('scenario_initial_m = na');
658: dbms_aw.execute('PUSH planning_cycle_d');
659: dbms_aw.execute('oknullstatus = y');
660: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
661: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
662: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
663: dbms_aw.execute('limit scenario_d to planning_cycle_d');
664: dbms_aw.execute('limit scenario_d keep scenario_initial_m');
665: dbms_aw.execute('scenario_initial_m = na');
666: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
659: dbms_aw.execute('oknullstatus = y');
660: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
661: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
662: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
663: dbms_aw.execute('limit scenario_d to planning_cycle_d');
664: dbms_aw.execute('limit scenario_d keep scenario_initial_m');
665: dbms_aw.execute('scenario_initial_m = na');
666: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
667: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
660: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
661: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
662: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
663: dbms_aw.execute('limit scenario_d to planning_cycle_d');
664: dbms_aw.execute('limit scenario_d keep scenario_initial_m');
665: dbms_aw.execute('scenario_initial_m = na');
666: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
667: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
668: dbms_aw.execute('scenario_initial_m = yes');
661: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
662: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
663: dbms_aw.execute('limit scenario_d to planning_cycle_d');
664: dbms_aw.execute('limit scenario_d keep scenario_initial_m');
665: dbms_aw.execute('scenario_initial_m = na');
666: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
667: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
668: dbms_aw.execute('scenario_initial_m = yes');
669: dbms_aw.execute('POP scenario_d');
662: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
663: dbms_aw.execute('limit scenario_d to planning_cycle_d');
664: dbms_aw.execute('limit scenario_d keep scenario_initial_m');
665: dbms_aw.execute('scenario_initial_m = na');
666: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
667: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
668: dbms_aw.execute('scenario_initial_m = yes');
669: dbms_aw.execute('POP scenario_d');
670: dbms_aw.execute('POP planning_cycle_d');
663: dbms_aw.execute('limit scenario_d to planning_cycle_d');
664: dbms_aw.execute('limit scenario_d keep scenario_initial_m');
665: dbms_aw.execute('scenario_initial_m = na');
666: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
667: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
668: dbms_aw.execute('scenario_initial_m = yes');
669: dbms_aw.execute('POP scenario_d');
670: dbms_aw.execute('POP planning_cycle_d');
671:
664: dbms_aw.execute('limit scenario_d keep scenario_initial_m');
665: dbms_aw.execute('scenario_initial_m = na');
666: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
667: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
668: dbms_aw.execute('scenario_initial_m = yes');
669: dbms_aw.execute('POP scenario_d');
670: dbms_aw.execute('POP planning_cycle_d');
671:
672: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
665: dbms_aw.execute('scenario_initial_m = na');
666: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
667: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
668: dbms_aw.execute('scenario_initial_m = yes');
669: dbms_aw.execute('POP scenario_d');
670: dbms_aw.execute('POP planning_cycle_d');
671:
672: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
673: fnd_log.string
666: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
667: -- dbms_aw.execute('limit scenario_d to p_scenario_id');
668: dbms_aw.execute('scenario_initial_m = yes');
669: dbms_aw.execute('POP scenario_d');
670: dbms_aw.execute('POP planning_cycle_d');
671:
672: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
673: fnd_log.string
674: (
733: 'Unsetting any previous flags and setting new flag.'
734: );
735: END IF;
736:
737: dbms_aw.execute('PUSH scenario_d');
738: dbms_aw.execute('PUSH planning_cycle_d');
739: dbms_aw.execute('oknullstatus = y');
740: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
741: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
734: );
735: END IF;
736:
737: dbms_aw.execute('PUSH scenario_d');
738: dbms_aw.execute('PUSH planning_cycle_d');
739: dbms_aw.execute('oknullstatus = y');
740: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
741: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
742: dbms_aw.execute('limit scenario_d to planning_cycle_d');
735: END IF;
736:
737: dbms_aw.execute('PUSH scenario_d');
738: dbms_aw.execute('PUSH planning_cycle_d');
739: dbms_aw.execute('oknullstatus = y');
740: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
741: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
742: dbms_aw.execute('limit scenario_d to planning_cycle_d');
743: dbms_aw.execute('limit scenario_d keep scenario_working_m');
736:
737: dbms_aw.execute('PUSH scenario_d');
738: dbms_aw.execute('PUSH planning_cycle_d');
739: dbms_aw.execute('oknullstatus = y');
740: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
741: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
742: dbms_aw.execute('limit scenario_d to planning_cycle_d');
743: dbms_aw.execute('limit scenario_d keep scenario_working_m');
744: dbms_aw.execute('scenario_working_m = na');
737: dbms_aw.execute('PUSH scenario_d');
738: dbms_aw.execute('PUSH planning_cycle_d');
739: dbms_aw.execute('oknullstatus = y');
740: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
741: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
742: dbms_aw.execute('limit scenario_d to planning_cycle_d');
743: dbms_aw.execute('limit scenario_d keep scenario_working_m');
744: dbms_aw.execute('scenario_working_m = na');
745: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
738: dbms_aw.execute('PUSH planning_cycle_d');
739: dbms_aw.execute('oknullstatus = y');
740: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
741: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
742: dbms_aw.execute('limit scenario_d to planning_cycle_d');
743: dbms_aw.execute('limit scenario_d keep scenario_working_m');
744: dbms_aw.execute('scenario_working_m = na');
745: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
746: dbms_aw.execute('scenario_working_m = yes');
739: dbms_aw.execute('oknullstatus = y');
740: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
741: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
742: dbms_aw.execute('limit scenario_d to planning_cycle_d');
743: dbms_aw.execute('limit scenario_d keep scenario_working_m');
744: dbms_aw.execute('scenario_working_m = na');
745: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
746: dbms_aw.execute('scenario_working_m = yes');
747: dbms_aw.execute('POP scenario_d');
740: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
741: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
742: dbms_aw.execute('limit scenario_d to planning_cycle_d');
743: dbms_aw.execute('limit scenario_d keep scenario_working_m');
744: dbms_aw.execute('scenario_working_m = na');
745: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
746: dbms_aw.execute('scenario_working_m = yes');
747: dbms_aw.execute('POP scenario_d');
748: dbms_aw.execute('POP planning_cycle_d');
741: dbms_aw.execute('limit planning_cycle_d to planning_cycle_scenario_r');
742: dbms_aw.execute('limit scenario_d to planning_cycle_d');
743: dbms_aw.execute('limit scenario_d keep scenario_working_m');
744: dbms_aw.execute('scenario_working_m = na');
745: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
746: dbms_aw.execute('scenario_working_m = yes');
747: dbms_aw.execute('POP scenario_d');
748: dbms_aw.execute('POP planning_cycle_d');
749:
742: dbms_aw.execute('limit scenario_d to planning_cycle_d');
743: dbms_aw.execute('limit scenario_d keep scenario_working_m');
744: dbms_aw.execute('scenario_working_m = na');
745: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
746: dbms_aw.execute('scenario_working_m = yes');
747: dbms_aw.execute('POP scenario_d');
748: dbms_aw.execute('POP planning_cycle_d');
749:
750: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
743: dbms_aw.execute('limit scenario_d keep scenario_working_m');
744: dbms_aw.execute('scenario_working_m = na');
745: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
746: dbms_aw.execute('scenario_working_m = yes');
747: dbms_aw.execute('POP scenario_d');
748: dbms_aw.execute('POP planning_cycle_d');
749:
750: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
751: fnd_log.string
744: dbms_aw.execute('scenario_working_m = na');
745: dbms_aw.execute('limit scenario_d to ' || p_scenario_id);
746: dbms_aw.execute('scenario_working_m = yes');
747: dbms_aw.execute('POP scenario_d');
748: dbms_aw.execute('POP planning_cycle_d');
749:
750: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
751: fnd_log.string
752: (
815: 'Unsetting any previous flags and setting new flag.'
816: );
817: END IF;
818:
819: dbms_aw.execute('PUSH scenario_d');
820: dbms_aw.execute('lmt scenario_d to ' || p_scenario_id);
821: dbms_aw.execute('scenario_recommended_flag_m = ' || p_scenario_reccom_status);
822: dbms_aw.execute('POP scenario_d');
823:
816: );
817: END IF;
818:
819: dbms_aw.execute('PUSH scenario_d');
820: dbms_aw.execute('lmt scenario_d to ' || p_scenario_id);
821: dbms_aw.execute('scenario_recommended_flag_m = ' || p_scenario_reccom_status);
822: dbms_aw.execute('POP scenario_d');
823:
824: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
817: END IF;
818:
819: dbms_aw.execute('PUSH scenario_d');
820: dbms_aw.execute('lmt scenario_d to ' || p_scenario_id);
821: dbms_aw.execute('scenario_recommended_flag_m = ' || p_scenario_reccom_status);
822: dbms_aw.execute('POP scenario_d');
823:
824: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
825: fnd_log.string
818:
819: dbms_aw.execute('PUSH scenario_d');
820: dbms_aw.execute('lmt scenario_d to ' || p_scenario_id);
821: dbms_aw.execute('scenario_recommended_flag_m = ' || p_scenario_reccom_status);
822: dbms_aw.execute('POP scenario_d');
823:
824: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
825: fnd_log.string
826: (
895: 'Limiting to scenario id passed.'
896: );
897: END IF;
898:
899: dbms_aw.execute('PUSH scenario_d');
900: dbms_aw.execute('LMT scenario_d TO ' || p_scenario_id);
901:
902: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
903: fnd_log.string
896: );
897: END IF;
898:
899: dbms_aw.execute('PUSH scenario_d');
900: dbms_aw.execute('LMT scenario_d TO ' || p_scenario_id);
901:
902: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
903: fnd_log.string
904: (
943: 'Updating FUNDING_STATUS_REC_SCENARIO_PROJECT_R relation for scenario: ' || p_scenario_id || ' and for project: ' || l_project_id
944: );
945: END IF;
946:
947: dbms_aw.execute('funding_status_rec_scenario_project_r(project_d ' || l_project_id || ') = ''' || p_scenario_reccom_value || '''');
948:
949: END LOOP;
950:
951: dbms_aw.execute('POP scenario_d');
947: dbms_aw.execute('funding_status_rec_scenario_project_r(project_d ' || l_project_id || ') = ''' || p_scenario_reccom_value || '''');
948:
949: END LOOP;
950:
951: dbms_aw.execute('POP scenario_d');
952:
953: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
954: fnd_log.string
955: (
1022: (select planning_cycle from fpa_aw_sce_info_v where scenario = p_target_scen_id)
1023: and is_initial_scenario = 1 ;
1024:
1025: l_str := 'call copy_proj_data_prg(' || p_target_scen_id || ', ' || source_scen_id || ', '' ' || p_project_id_str || ''')';
1026: dbms_aw.execute(l_str);
1027: --('call copy_proj_data_prg(' || p_target_scen_id || ' ' || source_scen_id || ' '' ' || p_project_id_str || ''')');
1028:
1029: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
1030: fnd_log.string
1081:
1082: l_str := 'call remove_proj_from_sce_prg(' || p_scenario_id || ', ' || p_project_id || ')';
1083:
1084: -- dbms_output.put_line(l_str);
1085: dbms_aw.execute(l_str);
1086:
1087: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
1088: fnd_log.string
1089: (
1135: --DBMS_OUTPUT.put_line(' ..p_proj_metrics(1).scenario=' || p_proj_metrics(1).scenarioID );
1136:
1137: -- Update user ranking against project ID for the given scenario ID
1138: -- Limit Scenario ID
1139: dbms_aw.execute('LMT scenario_d TO ' || p_proj_metrics(1).scenarioID );
1140:
1141: FOR i IN p_proj_metrics.FIRST..p_proj_metrics.LAST
1142: LOOP
1143:
1153: );
1154: END IF;
1155:
1156: -- Limit project_d
1157: dbms_aw.execute('LMT project_d TO ' || p_proj_metrics(i).projectID );
1158:
1159: -- Set the the user rank for each project
1160: IF p_proj_metrics(i).user_rank IS NULL THEN
1161: dbms_aw.execute( 'scenario_project_user_rank_m = na');
1157: dbms_aw.execute('LMT project_d TO ' || p_proj_metrics(i).projectID );
1158:
1159: -- Set the the user rank for each project
1160: IF p_proj_metrics(i).user_rank IS NULL THEN
1161: dbms_aw.execute( 'scenario_project_user_rank_m = na');
1162: ELSE
1163: dbms_aw.execute( 'scenario_project_user_rank_m = ' || p_proj_metrics(i).user_rank );
1164: END IF;
1165:
1159: -- Set the the user rank for each project
1160: IF p_proj_metrics(i).user_rank IS NULL THEN
1161: dbms_aw.execute( 'scenario_project_user_rank_m = na');
1162: ELSE
1163: dbms_aw.execute( 'scenario_project_user_rank_m = ' || p_proj_metrics(i).user_rank );
1164: END IF;
1165:
1166: END LOOP;
1167:
1242: );
1243: END IF;
1244:
1245: if p_project_id is null and p_class_code_id is null
1246: then dbms_aw.execute('call calc_sce_all_data_prg(' || p_scenario_id || ' na na ''' || p_data_to_calc || ''')');
1247: elsif p_project_id is null
1248: then dbms_aw.execute('call calc_sce_all_data_prg(' || p_scenario_id || ' na ' || p_class_code_id || '''' || p_data_to_calc || ''')');
1249: elsif p_class_code_id is null
1250: then dbms_aw.execute('call calc_sce_all_data_prg(' || p_scenario_id || ' ' || p_project_id || ' na ''' || p_data_to_calc || ''')');
1244:
1245: if p_project_id is null and p_class_code_id is null
1246: then dbms_aw.execute('call calc_sce_all_data_prg(' || p_scenario_id || ' na na ''' || p_data_to_calc || ''')');
1247: elsif p_project_id is null
1248: then dbms_aw.execute('call calc_sce_all_data_prg(' || p_scenario_id || ' na ' || p_class_code_id || '''' || p_data_to_calc || ''')');
1249: elsif p_class_code_id is null
1250: then dbms_aw.execute('call calc_sce_all_data_prg(' || p_scenario_id || ' ' || p_project_id || ' na ''' || p_data_to_calc || ''')');
1251: end if;
1252:
1246: then dbms_aw.execute('call calc_sce_all_data_prg(' || p_scenario_id || ' na na ''' || p_data_to_calc || ''')');
1247: elsif p_project_id is null
1248: then dbms_aw.execute('call calc_sce_all_data_prg(' || p_scenario_id || ' na ' || p_class_code_id || '''' || p_data_to_calc || ''')');
1249: elsif p_class_code_id is null
1250: then dbms_aw.execute('call calc_sce_all_data_prg(' || p_scenario_id || ' ' || p_project_id || ' na ''' || p_data_to_calc || ''')');
1251: end if;
1252:
1253: IF FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL THEN
1254: fnd_log.string