DBA Data[Home] [Help]

APPS.MSD_DEM_UPLOAD_FORECAST dependencies on MSD_DP_SCN_ENTRIES_DENORM

Line 735: * export view to table MSD_DP_SCN_ENTRIES_DENORM. The member codes are

731:
732: /*
733: * This procedure, given the export integration data profile name, pushes the
734: * forecast data along with forecast accuracy and demand priority from the
735: * export view to table MSD_DP_SCN_ENTRIES_DENORM. The member codes are
736: * transformed to the corresponding source identifiers. The 'Organization'
737: * level member is used to find out the source instance to which the record
738: * belongs.
739: * The internal names of the series will be used to get the semantic of the

Line 1296: x_insert_clause := 'INSERT INTO MSD_DP_SCN_ENTRIES_DENORM ( ' ||

1292: ' -1, ' ||
1293: ' 1) = 1 ';
1294: END IF;
1295:
1296: x_insert_clause := 'INSERT INTO MSD_DP_SCN_ENTRIES_DENORM ( ' ||
1297: ' DEMAND_PLAN_ID, ' ||
1298: ' SCENARIO_ID, ' ||
1299: ' DEMAND_ID, ' ||
1300: ' BUCKET_TYPE, ' ||

Line 1409: DELETE FROM MSD_DP_SCN_ENTRIES_DENORM

1405:
1406: END IF;
1407:
1408: /* Delete all data in the denorm for the export data profile */
1409: DELETE FROM MSD_DP_SCN_ENTRIES_DENORM
1410: WHERE demand_plan_id = x_demand_plan_id
1411: AND scenario_id = x_scenario_id;
1412:
1413: COMMIT;

Line 1442: 'MSD_DP_SCN_ENTRIES_DENORM');

1438:
1439: msd_dem_collect_history_data.analyze_table (
1440: x_errbuf,
1441: x_retcode,
1442: 'MSD_DP_SCN_ENTRIES_DENORM');
1443:
1444:
1445: /* sjagathe - Added for Product Family Forecast Support */
1446: IF (x_is_pf_level IS NOT NULL)

Line 1452: INSERT INTO MSD_DP_SCN_ENTRIES_DENORM (

1448:
1449: IF ( x_is_global_fcst = 2 )
1450: THEN
1451:
1452: INSERT INTO MSD_DP_SCN_ENTRIES_DENORM (
1453: DEMAND_PLAN_ID,
1454: SCENARIO_ID,
1455: DEMAND_ID,
1456: BUCKET_TYPE,

Line 1515: FROM msd_dp_scn_entries_denorm

1511: demand_class,
1512: start_time,
1513: end_time,
1514: sum(quantity) QUANTITY
1515: FROM msd_dp_scn_entries_denorm
1516: WHERE scenario_id = x_scenario_id
1517: GROUP BY sr_instance_id,
1518: pf_name,
1519: sr_organization_id,

Line 1534: INSERT INTO MSD_DP_SCN_ENTRIES_DENORM (

1530: AND msi.item_name = entries.pf_name;
1531:
1532: ELSE
1533:
1534: INSERT INTO MSD_DP_SCN_ENTRIES_DENORM (
1535: DEMAND_PLAN_ID,
1536: SCENARIO_ID,
1537: DEMAND_ID,
1538: BUCKET_TYPE,

Line 1597: FROM msd_dp_scn_entries_denorm

1593: demand_class,
1594: start_time,
1595: end_time,
1596: sum(quantity) QUANTITY
1597: FROM msd_dp_scn_entries_denorm
1598: WHERE scenario_id = x_scenario_id
1599: GROUP BY sr_instance_id,
1600: pf_name,
1601: sr_organization_id,

Line 1619: DELETE FROM MSD_DP_SCN_ENTRIES_DENORM

1615:
1616: END IF;
1617:
1618: /* Delete Product Family members with forecast control none */
1619: DELETE FROM MSD_DP_SCN_ENTRIES_DENORM
1620: WHERE demand_plan_id = x_demand_plan_id
1621: AND scenario_id = x_scenario_id
1622: AND request_id = 3;
1623:

Line 1649: FROM msd_dp_scn_entries_denorm exp

1645: SELECT
1646: -1, x_scenario_id, exp.inventory_item_id, exp.sr_organization_id, exp.sr_instance_id,
1647: avg(exp.mape_in_sample), avg(exp.mape_out_sample), avg(exp.forecast_volatility), avg(exp.avg_demand),
1648: FND_GLOBAL.USER_ID, systimestamp, systimestamp, FND_GLOBAL.USER_ID, FND_GLOBAL.LOGIN_ID
1649: FROM msd_dp_scn_entries_denorm exp
1650: WHERE exp.scenario_id = x_scenario_id
1651: GROUP BY exp.inventory_item_id, exp.sr_organization_id, exp.sr_instance_id;
1652:
1653: COMMIT;

Line 2272: EXECUTE IMMEDIATE 'SELECT max(demand_id) FROM msd_dp_scn_entries_denorm WHERE scenario_id = :1'

2268: USING lower(p_dep_export_data_profile);
2269: x_dep_scenario_id := x_dep_scenario_id + C_SCENARIO_ID_OFFSET;
2270:
2271: /* Get the max demand id for independent demand */
2272: EXECUTE IMMEDIATE 'SELECT max(demand_id) FROM msd_dp_scn_entries_denorm WHERE scenario_id = :1'
2273: INTO x_max_demand_id
2274: USING x_ind_scenario_id;
2275: IF (x_max_demand_id IS NULL)
2276: THEN

Line 2283: UPDATE msd_dp_scn_entries_denorm

2279: x_max_demand_id := x_max_demand_id + 1;
2280: END IF;
2281:
2282:
2283: UPDATE msd_dp_scn_entries_denorm
2284: SET scenario_id = x_ind_scenario_id,
2285: demand_id = demand_id + x_max_demand_id
2286: WHERE scenario_id = x_dep_scenario_id;
2287: COMMIT;

Line 2293: 'MSD_DP_SCN_ENTRIES_DENORM');

2289:
2290: msd_dem_collect_history_data.analyze_table (
2291: x_errbuf,
2292: x_retcode,
2293: 'MSD_DP_SCN_ENTRIES_DENORM');
2294:
2295: x_small_sql := ' BEGIN ' || x_schema || '.dl_log_status(''' || VS_MSG_UPLOAD_TD || ''' , ''' ||
2296: VS_MSG_LOADED || ' ' || p_ind_export_data_profile || ''' , ''' || VS_MSG_SUCCEEDED || ''' ); END;';
2297:

Line 3624: * then updates msd_dp_scn_entries_denorm (quantity column) and

3620:
3621: /*
3622: * This procedure will identify the item/org tuples that have changed
3623: * after the last upload (full or incremental) was done,
3624: * then updates msd_dp_scn_entries_denorm (quantity column) and
3625: * msc_dmd_scn_metrics (mape_in_sample,mape_out_sample,forecast_volatility,
3626: * avg_demand columns) tables with new values in the 5 series
3627: * (SPF Final Forecast, SPF Forecast MAPE (In Sample), SPF Forecast MAPE (Out of Sample),
3628: * SPF Forecast Volatility, SPF Average Demand)

Line 4074: /* BULK update qty column of msd_dp_scn_entries_denorm table */

4070: EXECUTE IMMEDIATE x_sql BULK COLLECT INTO forecast_table;
4071:
4072: -- bug#11774264 -- 10g does not allow referencing fields of associative arrays within FORALL
4073: -- so using normal FOR loop instead (this will definitely have impact on performance)
4074: /* BULK update qty column of msd_dp_scn_entries_denorm table */
4075: /*FORALL i IN forecast_table.first..forecast_table.last
4076: UPDATE msd_dp_scn_entries_denorm
4077: SET
4078: quantity = forecast_table(i).fcst_spf_final,

Line 4076: UPDATE msd_dp_scn_entries_denorm

4072: -- bug#11774264 -- 10g does not allow referencing fields of associative arrays within FORALL
4073: -- so using normal FOR loop instead (this will definitely have impact on performance)
4074: /* BULK update qty column of msd_dp_scn_entries_denorm table */
4075: /*FORALL i IN forecast_table.first..forecast_table.last
4076: UPDATE msd_dp_scn_entries_denorm
4077: SET
4078: quantity = forecast_table(i).fcst_spf_final,
4079: last_update_login = x_fnd_login_id
4080: WHERE

Line 4089: UPDATE msd_dp_scn_entries_denorm

4085: AND scenario_id = x_ffcast_profile_id + C_SCENARIO_ID_OFFSET ;*/
4086:
4087: FOR i IN forecast_table.first..forecast_table.last
4088: loop
4089: UPDATE msd_dp_scn_entries_denorm
4090: SET
4091: quantity = forecast_table(i).fcst_spf_final,
4092: last_update_login = x_fnd_login_id
4093: WHERE

Line 4115: /* Analyze table MSD_DP_SCN_ENTRIES_DENORM */

4111: x_errbuf,
4112: x_retcode,
4113: var_msc_schema_name || '.MSC_DMD_SCN_METRICS');
4114:
4115: /* Analyze table MSD_DP_SCN_ENTRIES_DENORM */
4116: var_boolean := fnd_installation.get_app_info ('MSD', var_dummy1, var_dummy2, var_msd_schema_name);
4117: msd_dem_collect_history_data.analyze_table (
4118: x_errbuf,
4119: x_retcode,

Line 4120: var_msd_schema_name || '.MSD_DP_SCN_ENTRIES_DENORM');

4116: var_boolean := fnd_installation.get_app_info ('MSD', var_dummy1, var_dummy2, var_msd_schema_name);
4117: msd_dem_collect_history_data.analyze_table (
4118: x_errbuf,
4119: x_retcode,
4120: var_msd_schema_name || '.MSD_DP_SCN_ENTRIES_DENORM');
4121:
4122: /* Alter session to demantra schema */
4123: x_small_sql := ' alter session set current_schema = ' || x_schema ;
4124: EXECUTE IMMEDIATE x_small_sql;

Line 5144: EXECUTE IMMEDIATE ' UPDATE MSD_DP_SCN_ENTRIES_DENORM d '

5140: EXECUTE IMMEDIATE 'SELECT dbname FROM ' || x_schema || '.computed_fields WHERE application_id = :1'
5141: INTO x_fcst_acry_column
5142: USING p_wod_fcst_acry_series_wai;
5143:
5144: EXECUTE IMMEDIATE ' UPDATE MSD_DP_SCN_ENTRIES_DENORM d '
5145: || ' SET forecast_error = nvl((SELECT 100 * ' || x_fcst_acry_column
5146: || ' FROM msc_trading_partners mtp, '
5147: || ' msc_system_items msi, '
5148: || x_schema || '.T_EP_ITEM tei, '

Line 5169: EXECUTE IMMEDIATE 'SELECT max(demand_id) FROM msd_dp_scn_entries_denorm WHERE scenario_id = :1'

5165:
5166: COMMIT;
5167:
5168: /* Get the max demand id for independent demand */
5169: EXECUTE IMMEDIATE 'SELECT max(demand_id) FROM msd_dp_scn_entries_denorm WHERE scenario_id = :1'
5170: INTO x_max_demand_id
5171: USING x_ind_scenario_id;
5172: IF (x_max_demand_id IS NULL)
5173: THEN

Line 5180: MERGE INTO msd_dp_scn_entries_denorm d1

5176: x_max_demand_id := x_max_demand_id + 1;
5177: END IF;
5178:
5179: /* Merge the independent demand and work order demand forecast */
5180: MERGE INTO msd_dp_scn_entries_denorm d1
5181: USING (SELECT rownum rn, demand_plan_id, scenario_id, demand_id, bucket_type, start_time, end_time, quantity,
5182: sr_organization_id, sr_instance_id, sr_inventory_item_id, error_type, forecast_error, inventory_item_id,
5183: dp_uom_code, ascp_uom_code, unit_price, creation_date, created_by, last_update_login
5184: FROM msd_dp_scn_entries_denorm

Line 5184: FROM msd_dp_scn_entries_denorm

5180: MERGE INTO msd_dp_scn_entries_denorm d1
5181: USING (SELECT rownum rn, demand_plan_id, scenario_id, demand_id, bucket_type, start_time, end_time, quantity,
5182: sr_organization_id, sr_instance_id, sr_inventory_item_id, error_type, forecast_error, inventory_item_id,
5183: dp_uom_code, ascp_uom_code, unit_price, creation_date, created_by, last_update_login
5184: FROM msd_dp_scn_entries_denorm
5185: WHERE scenario_id = x_wod_scenario_id) d2
5186: ON ( d1.scenario_id = x_ind_scenario_id
5187: AND d1.sr_organization_id = d2.sr_organization_id
5188: AND d1.sr_instance_id = d2.sr_instance_id

Line 5206: DELETE FROM msd_dp_scn_entries_denorm

5202:
5203: COMMIT;
5204:
5205: /* Delete the forecast data with scenario id of x_wod_scenario_id */
5206: DELETE FROM msd_dp_scn_entries_denorm
5207: WHERE scenario_id = x_wod_scenario_id;
5208:
5209: COMMIT;
5210:

Line 5214: 'MSD_DP_SCN_ENTRIES_DENORM');

5210:
5211: msd_dem_collect_history_data.analyze_table (
5212: x_errbuf,
5213: x_retcode,
5214: 'MSD_DP_SCN_ENTRIES_DENORM');
5215:
5216: x_small_sql := ' BEGIN ' || x_schema || '.dl_log_status(''' || VS_MSG_UPLOAD_TD || ''' , ''' ||
5217: VS_MSG_LOADED || ' ' || x_ind_export_data_profile || ''' , ''' || VS_MSG_SUCCEEDED || ''' ); END;';
5218:

Line 5248: * This procedure will load SPF forecast data into MSD_DP_SCN_ENTRIES_DENORM and

5244:
5245:
5246:
5247: /*
5248: * This procedure will load SPF forecast data into MSD_DP_SCN_ENTRIES_DENORM and
5249: * SPF metrics into MSC_DMD_SCN_METRICS.
5250: * Arguments -
5251: * 1. SPF Upload Forecast and Metrics data profile appl id
5252: * Process -

Line 5253: * a. First forecast and metrics data is loaded to MSD_DP_SCN_ENTRIES_DENORM

5249: * SPF metrics into MSC_DMD_SCN_METRICS.
5250: * Arguments -
5251: * 1. SPF Upload Forecast and Metrics data profile appl id
5252: * Process -
5253: * a. First forecast and metrics data is loaded to MSD_DP_SCN_ENTRIES_DENORM
5254: * b. Then aggregated (time independent) metrics data is copied over to
5255: * MSC_DMD_SCN_METRICS
5256: *
5257: * Note - This way the Demantra export view is queries only once and hence