DBA Data[Home] [Help]

APPS.MSD_ROLL_DEMAND_PLAN dependencies on MSD_DP_SCENARIOS

Line 18: | It also changes the parameter_name in msd_dp_scenarios table for latest |

14:
15: /*========================================================================================+
16: | DESCRIPTION : This procedure is called to roll forward the start and end dates of |
17: | parameters and to attach the latest forecast version. |
18: | It also changes the parameter_name in msd_dp_scenarios table for latest |
19: | forecasts versions attached. |
20: +========================================================================================*/
21:
22: PROCEDURE update_parameters ( p_demand_plan_id IN NUMBER,

Line 68: UPDATE msd_dp_scenarios

64:
65:
66:
67:
68: UPDATE msd_dp_scenarios
69: SET parameter_name = decode(lv_parameter_type,G_TYPE_INPUT_SCENARIO,(substr(parameter_name,1,instr( parameter_name,':',instr(parameter_name,':')+1))||lv_forecast_name),parameter_name)
70: WHERE nvl(parameter_name, NULL_CHAR ) = nvl(lv_parameter_name, NULL_CHAR )
71: AND nvl(forecast_based_on,NULL_CHAR) = nvl(lv_parameter_type,NULL_CHAR)
72: AND nvl(forecast_date_used,NULL_CHAR) = nvl(lv_forecast_date_used,NULL_CHAR)

Line 76: msc_st_util.log_message ('No Change for the parameter_name for latest forecast version in msd_dp_scenarios table');

72: AND nvl(forecast_date_used,NULL_CHAR) = nvl(lv_forecast_date_used,NULL_CHAR)
73: AND demand_plan_id = p_demand_plan_id;
74:
75: IF ( SQL%NOTFOUND AND lv_parameter_type= G_TYPE_INPUT_SCENARIO ) THEN
76: msc_st_util.log_message ('No Change for the parameter_name for latest forecast version in msd_dp_scenarios table');
77: ELSIF ( lv_parameter_type= G_TYPE_INPUT_SCENARIO ) THEN
78: msc_st_util.log_message ('Changed the parameter_name for latest forecast version in msd_dp_scenarios table');
79: END IF;
80:

Line 78: msc_st_util.log_message ('Changed the parameter_name for latest forecast version in msd_dp_scenarios table');

74:
75: IF ( SQL%NOTFOUND AND lv_parameter_type= G_TYPE_INPUT_SCENARIO ) THEN
76: msc_st_util.log_message ('No Change for the parameter_name for latest forecast version in msd_dp_scenarios table');
77: ELSIF ( lv_parameter_type= G_TYPE_INPUT_SCENARIO ) THEN
78: msc_st_util.log_message ('Changed the parameter_name for latest forecast version in msd_dp_scenarios table');
79: END IF;
80:
81:
82: CLOSE latest_forecast_version;

Line 97: UPDATE msd_dp_scenarios

93:
94: BEGIN
95:
96:
97: UPDATE msd_dp_scenarios
98: SET horizon_start_date = decode(nvl(lv_exclude_flag,'N'),'N',decode(p_period_type,G_DAY,(horizon_start_date + p_number_of_periods),ADD_MONTHS(horizon_start_date,p_number_of_periods)),horizon_start_date),
99: horizon_end_date = decode(nvl(lv_exclude_flag,'N'),'N',decode(p_period_type,G_DAY,(horizon_end_date + p_number_of_periods),ADD_MONTHS(horizon_end_date,p_number_of_periods)),horizon_end_date),
100: history_start_date = decode(nvl(lv_exclude_flag,'N'),'N',decode(p_period_type,G_DAY,(history_start_date + p_number_of_periods),ADD_MONTHS(history_start_date,p_number_of_periods)),history_start_date),
101: history_end_date = decode(nvl(lv_exclude_flag,'N'),'N',decode(p_period_type,G_DAY,(history_end_date + p_number_of_periods),ADD_MONTHS(history_end_date,p_number_of_periods)),history_end_date)

Line 105: UPDATE msd_dp_scenarios

101: history_end_date = decode(nvl(lv_exclude_flag,'N'),'N',decode(p_period_type,G_DAY,(history_end_date + p_number_of_periods),ADD_MONTHS(history_end_date,p_number_of_periods)),history_end_date)
102: WHERE scenario_id=lv_scenario_id;
103:
104: IF (( nvl(lv_exclude_flag,'N') = 'N') AND ( p_period_type = G_GREGORIAN_MONTH )) THEN
105: UPDATE msd_dp_scenarios
106: SET horizon_start_date = decode(trunc(horizon_start_date),trunc(history_end_date),horizon_start_date+1,horizon_start_date)
107: WHERE scenario_id=lv_scenario_id;
108: END IF;
109:

Line 146: lv_scenario_id MSD_DP_SCENARIOS.SCENARIO_ID%TYPE;

142: p_period_type IN NUMBER,
143: p_number_of_periods IN NUMBER ) AS
144:
145:
146: lv_scenario_id MSD_DP_SCENARIOS.SCENARIO_ID%TYPE;
147: lv_scenario_name MSD_DP_SCENARIOS.SCENARIO_NAME%TYPE;
148:
149: lv_parameter_type MSD_DP_PARAMETERS.PARAMETER_TYPE%TYPE;
150: lv_exclude_flag MSD_DP_PARAMETERS.EXCLUDE_FROM_ROLLING_CYCLE%TYPE;

Line 147: lv_scenario_name MSD_DP_SCENARIOS.SCENARIO_NAME%TYPE;

143: p_number_of_periods IN NUMBER ) AS
144:
145:
146: lv_scenario_id MSD_DP_SCENARIOS.SCENARIO_ID%TYPE;
147: lv_scenario_name MSD_DP_SCENARIOS.SCENARIO_NAME%TYPE;
148:
149: lv_parameter_type MSD_DP_PARAMETERS.PARAMETER_TYPE%TYPE;
150: lv_exclude_flag MSD_DP_PARAMETERS.EXCLUDE_FROM_ROLLING_CYCLE%TYPE;
151: lv_parameter_id MSD_DP_PARAMETERS.PARAMETER_ID%TYPE;

Line 168: FROM msd_dp_scenarios s, msd_dp_parameters p

164:
165: -- This cursor is used to select all the scenarios that are attached to the demand plan.
166: CURSOR scenarios IS
167: SELECT s.scenario_id,s.scenario_name,p.exclude_from_rolling_cycle
168: FROM msd_dp_scenarios s, msd_dp_parameters p
169: WHERE s.demand_plan_id = p_demand_plan_id
170: AND p.demand_plan_id = p_demand_plan_id
171: AND nvl(s.parameter_name,NULL_CHAR) = nvl(p.parameter_name,NULL_CHAR)
172: AND nvl(s.forecast_based_on,NULL_CHAR) = p.parameter_type

Line 176: FROM msd_dp_scenarios s

172: AND nvl(s.forecast_based_on,NULL_CHAR) = p.parameter_type
173: AND nvl(s.forecast_date_used,NULL_CHAR) = nvl(p.forecast_date_used,NULL_CHAR)
174: UNION ALL
175: SELECT s.scenario_id,s.scenario_name,'N'
176: FROM msd_dp_scenarios s
177: WHERE s.demand_plan_id = p_demand_plan_id
178: AND s.parameter_name IS NULL
179: AND s.forecast_based_on IS NULL
180: AND s.forecast_date_used IS NULL;