[Home] [Help]
365: END IF;
366:
367: SELECT forecast_header_id
368: INTO l_forecast_header_id
369: FROM ce_forecasts
370: WHERE forecast_id = G_forecast_id;
371:
372: req_id := FND_REQUEST.SUBMIT_REQUEST('CE',
373: 'CEFCAMTS',
1216: /* ---------------------------------------------------------------------
1217: | PRIVATE PROCEDURE |
1218: | create_forecast_header |
1219: | DESCRIPTION |
1220: | Create forecast header for new forecast in ce_forecasts table |
1221: | CALLED BY |
1222: | create_forecast |
1223: | HISTORY |
1224: | 12-JUL-1996 Created Bidemi Carrol |
1244: BEGIN
1245: IF G_forecast_id is null THEN
1246: SELECT forecast_id
1247: INTO fid
1248: FROM ce_forecasts
1249: WHERE name = G_rp_forecast_runname;
1250: ELSE
1251: SELECT forecast_id
1252: INTO fid
1249: WHERE name = G_rp_forecast_runname;
1250: ELSE
1251: SELECT forecast_id
1252: INTO fid
1253: FROM ce_forecasts
1254: WHERE name = G_rp_forecast_runname
1255: AND forecast_id <> G_forecast_id;
1256: END IF;
1257:
1264: END IF;
1265:
1266: SELECT count(1)
1267: INTO l_fc_count
1268: FROM ce_forecasts
1269: WHERE forecast_id = G_forecast_id;
1270:
1271: IF l_fc_count = 0 THEN
1272: CE_FORECASTS_TABLE_PKG.Insert_Row(
1268: FROM ce_forecasts
1269: WHERE forecast_id = G_forecast_id;
1270:
1271: IF l_fc_count = 0 THEN
1272: CE_FORECASTS_TABLE_PKG.Insert_Row(
1273: X_Rowid => l_forecast_rowid,
1274: X_forecast_id => G_forecast_id,
1275: X_forecast_header_id => G_rp_forecast_header_id,
1276: X_name => G_rp_forecast_runname,
1322: FND_MESSAGE.set_name ('CE','CE_FC_DUPLICATE_FORECAST_NAME');
1323: error_msg := FND_MESSAGE.GET;
1324: CE_FORECAST_ERRORS_PKG.insert_row(G_forecast_id,G_rp_forecast_header_id,
1325: null,'CE_FC_DUPLICATE_FORECAST_NAME', error_msg);
1326: UPDATE ce_forecasts
1327: SET error_status = 'X'
1328: WHERE forecast_id = G_forecast_id;
1329: END IF;
1330:
1406: valid_pmr := FALSE;
1407: END IF;
1408:
1409: IF(NOT valid_pmr)THEN
1410: UPDATE ce_forecasts
1411: SET error_status = 'E'
1412: WHERE forecast_id = G_forecast_id;
1413:
1414: cep_standard.debug('Forecast NOT run');
1514: OR CE_CASH_FCST.G_rp_exchange_type IS NULL )
1515: THEN
1516: IF( NOT populate_xrate_table )
1517: THEN
1518: UPDATE ce_forecasts
1519: SET error_status = 'X'
1520: WHERE forecast_id = G_forecast_id;
1521: END IF;
1522: END IF;
1532: CE_CASH_FCST.G_rp_amount_threshold IS NOT NULL )
1533: THEN
1534: IF( NOT populate_base_xrate_table )
1535: THEN
1536: UPDATE ce_forecasts
1537: SET error_status = 'X'
1538: WHERE forecast_id = G_forecast_id;
1539: END IF;
1540: END IF;
1541: END IF;
1542:
1543: IF( NOT valid_col_range )
1544: THEN
1545: UPDATE ce_forecasts
1546: SET error_status = 'X'
1547: WHERE forecast_id = G_forecast_id;
1548: END IF;
1549: END IF;
1678: END IF;
1679:
1680: SELECT error_status
1681: INTO l_status
1682: FROM ce_forecasts
1683: WHERE forecast_id = G_forecast_id;
1684:
1685: IF (wrap_up_process(req_data) OR standalone_process)
1686: THEN
1695: END IF;
1696:
1697: IF l_status = 'R'
1698: THEN
1699: UPDATE ce_forecasts
1700: SET error_status = 'S'
1701: WHERE forecast_id = G_forecast_id;
1702:
1703: ELSIF l_status = 'X' THEN
1700: SET error_status = 'S'
1701: WHERE forecast_id = G_forecast_id;
1702:
1703: ELSIF l_status = 'X' THEN
1704: UPDATE ce_forecasts
1705: SET error_status = 'W'
1706: WHERE forecast_id = G_forecast_id;
1707: END IF;
1708:
1800:
1801: -- Now the process is officially 'Running' and not 'Pending'
1802: --bug 4345353 convert amount threshold from canonical to number
1803: p_amount_threshold := fnd_number.canonical_to_number(p_amount_threshold_x);
1804: UPDATE ce_forecasts
1805: SET error_status = 'R'
1806: WHERE forecast_id = p_forecast_id
1807: AND error_status = 'P';
1808:
1818: null,
1819: 'CE_FC_DUPLICATE_FORECAST_NAME',
1820: error_msg);
1821:
1822: UPDATE ce_forecasts
1823: SET error_status = 'X'
1824: WHERE forecast_id = p_forecast_id;
1825: END IF;
1826:
1977: -- bug 4345353 convert amount threshold from canonical to number
1978: p_amount_threshold := fnd_number.canonical_to_number(p_amount_threshold_x);
1979:
1980: -- Now the process is officially 'Running' and not 'Pending'
1981: UPDATE ce_forecasts
1982: SET error_status = 'R'
1983: WHERE forecast_id = p_forecast_id
1984: AND error_status = 'P';
1985: COMMIT;
1994: null,
1995: 'CE_FC_DUPLICATE_FORECAST_NAME',
1996: error_msg);
1997:
1998: UPDATE ce_forecasts
1999: SET error_status = 'X'
2000: WHERE forecast_id = p_forecast_id;
2001: END IF;
2002: