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 70: UPDATE msd_dp_scenarios

66:
67:
68:
69:
70: UPDATE msd_dp_scenarios
71: 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)
72: WHERE nvl(parameter_name, NULL_CHAR ) = nvl(lv_parameter_name, NULL_CHAR )
73: AND nvl(forecast_based_on,NULL_CHAR) = nvl(lv_parameter_type,NULL_CHAR)
74: AND nvl(forecast_date_used,NULL_CHAR) = nvl(lv_forecast_date_used,NULL_CHAR)

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

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

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

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

Line 99: UPDATE msd_dp_scenarios

95:
96: BEGIN
97:
98:
99: UPDATE msd_dp_scenarios
100: SET horizon_start_date = decode(nvl(lv_exclude_flag,'N'),'N',decode(p_period_type,G_DAY,(horizon_start_date +
101: p_number_of_periods), G_WEEK, (horizon_start_date + p_number_of_periods*7), ADD_MONTHS(horizon_start_date,p_number_of_periods)),horizon_start_date),
102: horizon_end_date = decode(nvl(lv_exclude_flag,'N'),'N',decode(p_period_type,G_DAY,(horizon_end_date + p_number_of_periods),
103: G_WEEK, (horizon_end_date + p_number_of_periods*7), ADD_MONTHS(horizon_end_date,p_number_of_periods)),horizon_end_date),

Line 111: UPDATE msd_dp_scenarios

107: G_WEEK, (history_end_date + p_number_of_periods*7), ADD_MONTHS(history_end_date,p_number_of_periods)),history_end_date)
108: WHERE scenario_id=lv_scenario_id;
109:
110: IF (( nvl(lv_exclude_flag,'N') = 'N') AND ( p_period_type = G_GREGORIAN_MONTH )) THEN
111: UPDATE msd_dp_scenarios
112: SET horizon_start_date = decode(trunc(horizon_start_date),trunc(history_end_date),horizon_start_date+1,horizon_start_date)
113: WHERE scenario_id=lv_scenario_id;
114: END IF;
115:

Line 152: lv_scenario_id MSD_DP_SCENARIOS.SCENARIO_ID%TYPE;

148: p_period_type IN NUMBER,
149: p_number_of_periods IN NUMBER ) AS
150:
151:
152: lv_scenario_id MSD_DP_SCENARIOS.SCENARIO_ID%TYPE;
153: lv_scenario_name MSD_DP_SCENARIOS.SCENARIO_NAME%TYPE;
154:
155: lv_parameter_type MSD_DP_PARAMETERS.PARAMETER_TYPE%TYPE;
156: lv_exclude_flag MSD_DP_PARAMETERS.EXCLUDE_FROM_ROLLING_CYCLE%TYPE;

Line 153: lv_scenario_name MSD_DP_SCENARIOS.SCENARIO_NAME%TYPE;

149: p_number_of_periods IN NUMBER ) AS
150:
151:
152: lv_scenario_id MSD_DP_SCENARIOS.SCENARIO_ID%TYPE;
153: lv_scenario_name MSD_DP_SCENARIOS.SCENARIO_NAME%TYPE;
154:
155: lv_parameter_type MSD_DP_PARAMETERS.PARAMETER_TYPE%TYPE;
156: lv_exclude_flag MSD_DP_PARAMETERS.EXCLUDE_FROM_ROLLING_CYCLE%TYPE;
157: lv_parameter_id MSD_DP_PARAMETERS.PARAMETER_ID%TYPE;

Line 174: FROM msd_dp_scenarios s, msd_dp_parameters p

170:
171: -- This cursor is used to select all the scenarios that are attached to the demand plan.
172: CURSOR scenarios IS
173: SELECT s.scenario_id,s.scenario_name,p.exclude_from_rolling_cycle
174: FROM msd_dp_scenarios s, msd_dp_parameters p
175: WHERE s.demand_plan_id = p_demand_plan_id
176: AND p.demand_plan_id = p_demand_plan_id
177: AND nvl(s.parameter_name,NULL_CHAR) = nvl(p.parameter_name,NULL_CHAR)
178: AND nvl(s.forecast_based_on,NULL_CHAR) = p.parameter_type

Line 182: FROM msd_dp_scenarios s

178: AND nvl(s.forecast_based_on,NULL_CHAR) = p.parameter_type
179: AND nvl(s.forecast_date_used,NULL_CHAR) = nvl(p.forecast_date_used,NULL_CHAR)
180: UNION ALL
181: SELECT s.scenario_id,s.scenario_name,'N'
182: FROM msd_dp_scenarios s
183: WHERE s.demand_plan_id = p_demand_plan_id
184: AND s.parameter_name IS NULL
185: AND s.forecast_based_on IS NULL
186: AND s.forecast_date_used IS NULL;