[Home] [Help]
357: delete from eam_forecast_wedi
358: where forecast_id = p_forecast_id
359: AND wip_entity_id = p_wip_id;
360:
361: delete from eam_forecast_cebba
362: where forecast_id = p_forecast_id
363: AND wip_entity_id = p_wip_id;
364:
365: end delete_work_order;
385:
386: delete from eam_forecast_wedi
387: where forecast_id = p_forecast_id;
388:
389: delete from eam_forecast_cebba
390: where forecast_id = p_forecast_id;
391:
392: end delete_forecast;
393:
409:
410: delete from eam_forecast_wedi
411: where forecast_id = p_forecast_id;
412:
413: delete from eam_forecast_cebba
414: where forecast_id = p_forecast_id;
415:
416: end delete_forecast_data;
417:
1134: -- Remove non-positive transaction values as well as work orders
1135: -- that have no costs associated with them
1136:
1137: -- delete all costs not within the horizon
1138: delete from eam_forecast_cebba where forecast_id = p_forecast_id AND
1139: period_start_date > (select start_date from gl_periods
1140: where
1141: period_set_name = v_forecast_rec.period_set_name_to
1142: and period_name = v_forecast_rec.period_to);
1144: -- delete all work orders that have zero costs associated
1145: delete from eam_forecast_wdj where forecast_id = p_forecast_id and wip_entity_id
1146: in
1147: (select wip_entity_id from (select wip_entity_id, sum(acct_value) as total from
1148: eam_forecast_cebba where forecast_id = p_forecast_id
1149: group by wip_entity_id) where total = 0);
1150:
1151: delete from eam_forecast_wdj where forecast_id = p_forecast_id and
1152: wip_entity_id
1150:
1151: delete from eam_forecast_wdj where forecast_id = p_forecast_id and
1152: wip_entity_id
1153: not in
1154: (select wip_entity_id from eam_forecast_cebba where forecast_id =
1155: p_forecast_id);
1156:
1157:
1158: -- Standard check of p_commit.
1888: x_msg_data => x_msg_data);
1889:
1890: debug('DONE Copying CEBBA');
1891: select * bulk collect INTO l_cebba_table
1892: from eam_forecast_cebba
1893: where forecast_id = p_forecast_rec.forecast_id;
1894:
1895:
1896:
2066: x_msg_data => x_msg_data);
2067:
2068: debug('DONE Copying CEBBA');
2069: select * bulk collect INTO l_cebba_table
2070: from eam_forecast_cebba
2071: where forecast_id = p_forecast_rec.forecast_id;
2072: ROLLBACK;
2073:
2074: insert_into_cebba_auto(l_cebba_table);
2080: IS
2081: pragma autonomous_transaction;
2082: BEGIN
2083: FORALL i IN p_cebba_table.First..p_cebba_table.last
2084: insert into eam_forecast_cebba values p_cebba_table(i);
2085: commit;
2086: END insert_into_cebba_auto;
2087:
2088:
2491: debug(l_hist_cost_tbl(k).PERIOD_YEAR);
2492: debug(l_hist_cost_tbl(k).PERIOD_NUM);
2493:
2494:
2495: INSERT INTO EAM_FORECAST_CEBBA (
2496: PERIOD_SET_NAME, PERIOD_NAME, ACCT_PERIOD_ID,
2497: WIP_ENTITY_ID, ORGANIZATION_ID, OPERATIONS_DEPT_ID,
2498: OPERATION_SEQ_NUM, MAINT_COST_CATEGORY, OWNING_DEPT_ID,
2499: ACCT_VALUE, PERIOD_START_DATE, LAST_UPDATE_DATE,
2535:
2536: ELSE
2537: FORALL j IN p_wip_id_table.FIRST..p_wip_id_table.LAST
2538:
2539: INSERT INTO EAM_FORECAST_CEBBA (
2540: PERIOD_SET_NAME, PERIOD_NAME, ACCT_PERIOD_ID,
2541: WIP_ENTITY_ID, ORGANIZATION_ID, OPERATIONS_DEPT_ID,
2542: OPERATION_SEQ_NUM, MAINT_COST_CATEGORY, OWNING_DEPT_ID,
2543: ACCT_VALUE, PERIOD_START_DATE, LAST_UPDATE_DATE,
2707: AND glp3.period_name = ef2.period_to
2708: )periods,
2709:
2710: (SELECT cebba.wip_entity_id , ef3.forecast_id, cebba.ccid, cebba.period_name AS period_name,SUM(cebba.acct_value) AS cost
2711: FROM eam_forecast_cebba cebba, eam_forecasts ef3
2712: WHERE cebba.forecast_id = ef3.forecast_id
2713: GROUP BY cebba.wip_entity_id, cebba.ccid, cebba.period_name, ef3.forecast_id
2714: ) costs
2715:
2743: mtl_eam_locations loc, mtl_system_items_kfv msi2,
2744: bom_departments bd, hr_organization_units hou,
2745:
2746: (SELECT DISTINCT wip_entity_id, ccid, forecast_id AS id
2747: FROM eam_forecast_cebba )efc,
2748:
2749: gl_code_combinations_kfv glcc
2750:
2751: