DBA Data[Home] [Help]

APPS.MSD_DEM_UPLOAD_FORECAST dependencies on MSD_DEM_UPLOAD_FORECAST

Line 1: PACKAGE BODY MSD_DEM_UPLOAD_FORECAST AS

1: PACKAGE BODY MSD_DEM_UPLOAD_FORECAST AS
2: /* $Header: msddemufb.pls 120.51.12020000.4 2012/10/18 07:13:50 nallkuma ship $ */
3:
4: /*** CONSTANTS ***/
5:

Line 850: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_forecast - Unable to find schema name');

846:
847: x_schema := fnd_profile.value('MSD_DEM_SCHEMA');
848: IF (x_schema IS NULL)
849: THEN
850: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_forecast - Unable to find schema name');
851: END IF;
852:
853:
854: x_null_value_code := msd_dem_sr_util.get_null_code;

Line 864: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_forecast - No export data profile name provided');

860:
861: /* Initialize global variables */
862: IF (p_export_data_profile IS NULL)
863: THEN
864: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_forecast - No export data profile name provided');
865: ELSE
866: x_export_data_profile := upper(p_export_data_profile);
867: END IF;
868:

Line 902: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_forecast - Unable to get export data profile id');

898: /*** Check basic error conditions - BEGIN ***/
899:
900: IF (x_profile_id IS NULL)
901: THEN
902: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_forecast - Unable to get export data profile id');
903: ELSIF (x_integration_type = C_IMPORT_DATA_PROFILE)
904: THEN
905: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_forecast - ' || p_export_data_profile || 'is not an export data profile');
906: ELSIF (x_export_type = C_EXPORT_TYPE_INCR)

Line 905: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_forecast - ' || p_export_data_profile || 'is not an export data profile');

901: THEN
902: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_forecast - Unable to get export data profile id');
903: ELSIF (x_integration_type = C_IMPORT_DATA_PROFILE)
904: THEN
905: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_forecast - ' || p_export_data_profile || 'is not an export data profile');
906: ELSIF (x_export_type = C_EXPORT_TYPE_INCR)
907: THEN
908: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_forecast - Incremental export type is not supported');
909: ELSIF (x_index_id IS NOT NULL)

Line 908: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_forecast - Incremental export type is not supported');

904: THEN
905: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_forecast - ' || p_export_data_profile || 'is not an export data profile');
906: ELSIF (x_export_type = C_EXPORT_TYPE_INCR)
907: THEN
908: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_forecast - Incremental export type is not supported');
909: ELSIF (x_index_id IS NOT NULL)
910: THEN
911: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_forecast - Forecast amount cannot be uploaded');
912: ELSIF (x_is_view_present = 0)

Line 911: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_forecast - Forecast amount cannot be uploaded');

907: THEN
908: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_forecast - Incremental export type is not supported');
909: ELSIF (x_index_id IS NOT NULL)
910: THEN
911: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_forecast - Forecast amount cannot be uploaded');
912: ELSIF (x_is_view_present = 0)
913: THEN
914: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_forecast - Forecast has not yet been exported');
915: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC)

Line 914: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_forecast - Forecast has not yet been exported');

910: THEN
911: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_forecast - Forecast amount cannot be uploaded');
912: ELSIF (x_is_view_present = 0)
913: THEN
914: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_forecast - Forecast has not yet been exported');
915: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC)
916: THEN
917: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_forecast - Presentation type must by Code');
918: END IF;

Line 917: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_forecast - Presentation type must by Code');

913: THEN
914: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_forecast - Forecast has not yet been exported');
915: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC)
916: THEN
917: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_forecast - Presentation type must by Code');
918: END IF;
919:
920: /*** Check basic error conditions - END ***/
921:

Line 941: raise_application_error (-20009, 'Error: msd_dem_upload_forecast.upload_forecast - Unable to find schema name');

937: x_time_res_id);
938:
939: IF (x_res_type IS NULL)
940: THEN
941: raise_application_error (-20009, 'Error: msd_dem_upload_forecast.upload_forecast - Unable to find schema name');
942: END IF;
943:
944: /*** Get Time Info - END ***/
945:

Line 968: raise_application_error (-20010, 'Error: msd_dem_upload_forecast.upload_forecast - Item or Product Family level is required for upload');

964: x_prd_level := get_level_column (x_profile_id, C_PRODUCT_FAMILY);
965:
966: IF (x_prd_level IS NULL)
967: THEN
968: raise_application_error (-20010, 'Error: msd_dem_upload_forecast.upload_forecast - Item or Product Family level is required for upload');
969: END IF;
970: ELSE
971: x_prd_key_column := get_series_column (x_profile_id, C_DKEY_SERIES_PREFIX, C_DKEY_ITEM);
972:

Line 990: raise_application_error (-20011, 'Error: msd_dem_upload_forecast.upload_forecast - Unable to get sr_instance_id for global forecast');

986:
987: x_sr_instance_id_for_global := get_sr_instance_id_for_global;
988: IF (x_sr_instance_id_for_global IS NULL)
989: THEN
990: raise_application_error (-20011, 'Error: msd_dem_upload_forecast.upload_forecast - Unable to get sr_instance_id for global forecast');
991: END IF;
992:
993: ELSE
994: x_is_global_fcst := 2;

Line 1022: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_forecast - Destination key series for the level Site not found');

1018: x_ship_to_key_column := get_series_column (x_profile_id, C_DKEY_SERIES_PREFIX, C_DKEY_SITE);
1019:
1020: IF (x_ship_to_key_column IS NULL)
1021: THEN
1022: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_forecast - Destination key series for the level Site not found');
1023: END IF;
1024:
1025: END IF;
1026:

Line 1038: x_sr_customer_id := ' msd_dem_upload_forecast.get_customer_from_tpzone ( exp.' || x_cust_zone_level || ', mai.instance_id ) ';

1034: THEN
1035: x_sr_customer_id := ' mtpsil.sr_cust_acct_id ';
1036: ELSIF (x_cust_zone_level IS NOT NULL)
1037: THEN
1038: x_sr_customer_id := ' msd_dem_upload_forecast.get_customer_from_tpzone ( exp.' || x_cust_zone_level || ', mai.instance_id ) ';
1039: END IF;
1040:
1041: x_zone_level := get_level_column (x_profile_id, C_ZONE);
1042: IF (x_zone_level IS NOT NULL)

Line 1048: x_sr_zone_id := ' msd_dem_upload_forecast.get_zone_from_tpzone ( exp.' || x_cust_zone_level || ', mai.instance_id ) ';

1044: x_sr_zone_id := ' mr.region_id ';
1045: x_from_clause := x_from_clause || ' msc_regions mr, ';
1046: ELSIF (x_cust_zone_level IS NOT NULL)
1047: THEN
1048: x_sr_zone_id := ' msd_dem_upload_forecast.get_zone_from_tpzone ( exp.' || x_cust_zone_level || ', mai.instance_id ) ';
1049: END IF;
1050:
1051: x_select_clause := x_select_clause || x_sr_ship_to_loc_id || ' , ' ||
1052: x_sr_customer_id || ' , ' ||

Line 1091: raise_application_error (-20014, 'Error: msd_dem_upload_forecast.upload_forecast - Forecast series not found');

1087: x_fcst_column := get_series_column (x_profile_id, C_FORECAST_SERIES_PREFIX);
1088:
1089: IF (x_fcst_column IS NULL)
1090: THEN
1091: raise_application_error (-20014, 'Error: msd_dem_upload_forecast.upload_forecast - Forecast series not found');
1092: END IF;
1093:
1094: x_fcst_column := 'exp.' || x_fcst_column;
1095:

Line 1434: raise_application_error (-20014, 'Error: msd_dem_upload_forecast.upload_forecast - Error in call to custom hook msd_dem_custom_hooks.upload_hook');

1430:
1431:
1432: EXECUTE IMMEDIATE x_small_sql;
1433:
1434: raise_application_error (-20014, 'Error: msd_dem_upload_forecast.upload_forecast - Error in call to custom hook msd_dem_custom_hooks.upload_hook');
1435: END IF;
1436:
1437: COMMIT;
1438:

Line 1687: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_forecast - ' || substr(SQLERRM,1,150));

1683: /* Alter session to demantra schema */
1684: x_small_sql := 'alter session set current_schema = ' || x_schema;
1685: EXECUTE IMMEDIATE x_small_sql;
1686:
1687: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_forecast - ' || substr(SQLERRM,1,150));
1688:
1689: END UPLOAD_FORECAST;
1690:
1691:

Line 1781: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Unable to find schema name');

1777:
1778: x_schema := fnd_profile.value('MSD_DEM_SCHEMA');
1779: IF (x_schema IS NULL)
1780: THEN
1781: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Unable to find schema name');
1782: END IF;
1783:
1784:
1785:

Line 1795: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Planning Percentage export data profile name NOT provided');

1791:
1792: /* Initialize local variables */
1793: IF (p_pp_export_data_profile IS NULL)
1794: THEN
1795: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Planning Percentage export data profile name NOT provided');
1796: ELSE
1797: x_pctg_exp_dp := lower(p_pp_export_data_profile);
1798: END IF;
1799:

Line 1802: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Total Demand export data profile name NOT provided');

1798: END IF;
1799:
1800: IF (p_fcst_export_data_profile IS NULL)
1801: THEN
1802: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Total Demand export data profile name NOT provided');
1803: ELSE
1804: x_fcst_exp_dp := lower(p_fcst_export_data_profile);
1805: END IF;
1806:

Line 1809: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Planning Percentage series internal name NOT provided');

1805: END IF;
1806:
1807: IF (p_pctg_series_iname IS NULL)
1808: THEN
1809: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Planning Percentage series internal name NOT provided');
1810: ELSE
1811: x_pctg_series_iname := lower(p_pctg_series_iname);
1812: END IF;
1813:

Line 1824: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Parent Item Demand series internal name NOT provided');

1820:
1821: IF (p_parent_item_series_iname IS NULL
1822: AND p_option_item_series_iname IS NOT NULL)
1823: THEN
1824: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Parent Item Demand series internal name NOT provided');
1825: END IF;
1826:
1827: IF (p_option_item_series_iname IS NULL
1828: AND p_parent_item_series_iname IS NOT NULL)

Line 1830: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Option Item Demand series internal name NOT provided');

1826:
1827: IF (p_option_item_series_iname IS NULL
1828: AND p_parent_item_series_iname IS NOT NULL)
1829: THEN
1830: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Option Item Demand series internal name NOT provided');
1831: END IF;
1832:
1833: /* Determine how is planning percentage exported */
1834: IF (p_parent_item_series_iname IS NOT NULL)

Line 1883: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Unable to get pctg export data profile id');

1879: /*** Check basic error conditions - BEGIN ***/
1880:
1881: IF (x_profile_id IS NULL)
1882: THEN
1883: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Unable to get pctg export data profile id');
1884: ELSIF (x_integration_type = C_IMPORT_DATA_PROFILE)
1885: THEN
1886: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_planning_percentages - ' || x_pctg_exp_dp || 'is not an export data profile');
1887: ELSIF (x_export_type = C_EXPORT_TYPE_INCR)

Line 1886: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_planning_percentages - ' || x_pctg_exp_dp || 'is not an export data profile');

1882: THEN
1883: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Unable to get pctg export data profile id');
1884: ELSIF (x_integration_type = C_IMPORT_DATA_PROFILE)
1885: THEN
1886: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_planning_percentages - ' || x_pctg_exp_dp || 'is not an export data profile');
1887: ELSIF (x_export_type = C_EXPORT_TYPE_INCR)
1888: THEN
1889: raise_application_error (-20009, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Incremental export type is not supported');
1890: ELSIF (x_index_id IS NOT NULL)

Line 1889: raise_application_error (-20009, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Incremental export type is not supported');

1885: THEN
1886: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_planning_percentages - ' || x_pctg_exp_dp || 'is not an export data profile');
1887: ELSIF (x_export_type = C_EXPORT_TYPE_INCR)
1888: THEN
1889: raise_application_error (-20009, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Incremental export type is not supported');
1890: ELSIF (x_index_id IS NOT NULL)
1891: THEN
1892: raise_application_error (-20010, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Forecast amount cannot be uploaded');
1893: ELSIF (x_is_view_present = 0)

Line 1892: raise_application_error (-20010, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Forecast amount cannot be uploaded');

1888: THEN
1889: raise_application_error (-20009, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Incremental export type is not supported');
1890: ELSIF (x_index_id IS NOT NULL)
1891: THEN
1892: raise_application_error (-20010, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Forecast amount cannot be uploaded');
1893: ELSIF (x_is_view_present = 0)
1894: THEN
1895: raise_application_error (-20011, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Forecast has not yet been exported');
1896: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC)

Line 1895: raise_application_error (-20011, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Forecast has not yet been exported');

1891: THEN
1892: raise_application_error (-20010, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Forecast amount cannot be uploaded');
1893: ELSIF (x_is_view_present = 0)
1894: THEN
1895: raise_application_error (-20011, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Forecast has not yet been exported');
1896: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC)
1897: THEN
1898: raise_application_error (-20012, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Presentation type must by Code');
1899: ELSIF (x_unit_id <> 1 AND lower(x_uom_code) <> 'units')

Line 1898: raise_application_error (-20012, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Presentation type must by Code');

1894: THEN
1895: raise_application_error (-20011, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Forecast has not yet been exported');
1896: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC)
1897: THEN
1898: raise_application_error (-20012, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Presentation type must by Code');
1899: ELSIF (x_unit_id <> 1 AND lower(x_uom_code) <> 'units')
1900: THEN
1901: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Display unit is not UNITS.');
1902: ELSIF (x_fcst_profile_id IS NULL)

Line 1901: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Display unit is not UNITS.');

1897: THEN
1898: raise_application_error (-20012, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Presentation type must by Code');
1899: ELSIF (x_unit_id <> 1 AND lower(x_uom_code) <> 'units')
1900: THEN
1901: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Display unit is not UNITS.');
1902: ELSIF (x_fcst_profile_id IS NULL)
1903: THEN
1904: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Unable to get forecast export data profile id');
1905: END IF;

Line 1904: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Unable to get forecast export data profile id');

1900: THEN
1901: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Display unit is not UNITS.');
1902: ELSIF (x_fcst_profile_id IS NULL)
1903: THEN
1904: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Unable to get forecast export data profile id');
1905: END IF;
1906:
1907: /*** Check basic error conditions - END ***/
1908:

Line 1927: raise_application_error (-20014, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Unable to find schema name in get_time_strings');

1923: x_time_res_id);
1924:
1925: IF (x_res_type IS NULL)
1926: THEN
1927: raise_application_error (-20014, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Unable to find schema name in get_time_strings');
1928: END IF;
1929:
1930: /*** Get Time Info - END ***/
1931:

Line 1949: raise_application_error (-20015, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Item level is required for upload');

1945: /* PRODUCT */
1946: x_prd_level := get_level_column (x_profile_id, C_ITEM);
1947: IF (x_prd_level IS NULL)
1948: THEN
1949: raise_application_error (-20015, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Item level is required for upload');
1950: ELSE
1951: x_prd_key_column := get_series_column (x_profile_id, C_DKEY_SERIES_PREFIX, C_DKEY_ITEM);
1952: END IF;
1953:

Line 1960: raise_application_error (-20016, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Parent Item level is required for upload');

1956: /* Parent Item */
1957: x_parent_item_level := get_level_column (x_profile_id, C_PARENT_ITEM);
1958: IF (x_parent_item_level IS NULL)
1959: THEN
1960: raise_application_error (-20016, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Parent Item level is required for upload');
1961: END IF;
1962:
1963: /* ORGANIZATION */
1964: x_org_level := get_level_column (x_profile_id, C_ORGANIZATION);

Line 1973: raise_application_error (-20017, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Unable to get sr_instance_id for global planning percentages');

1969:
1970: x_sr_instance_id_for_global := get_sr_instance_id_for_global;
1971: IF (x_sr_instance_id_for_global IS NULL)
1972: THEN
1973: raise_application_error (-20017, 'Error: msd_dem_upload_forecast.upload_planning_percentages - Unable to get sr_instance_id for global planning percentages');
1974: END IF;
1975:
1976: ELSE
1977: x_is_global_fcst := 2;

Line 2181: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_planning_percentages - ' || substr(SQLERRM,1,150));

2177: /* Alter session to demantra schema */
2178: x_small_sql := 'alter session set current_schema = ' || x_schema;
2179: EXECUTE IMMEDIATE x_small_sql;
2180:
2181: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_planning_percentages - ' || substr(SQLERRM,1,150));
2182:
2183: END UPLOAD_PLANNING_PERCENTAGES;
2184:
2185:

Line 2224: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_total_demand - All the four input parameters must be specified');

2220: OR p_dep_export_data_profile IS NULL
2221: OR p_ind_fcst_series_iname IS NULL
2222: OR p_dep_fcst_series_iname IS NULL)
2223: THEN
2224: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_total_demand - All the four input parameters must be specified');
2225: END IF;
2226:
2227: /*** VALIDATE INPUT PARAMETERS - END ***/
2228:

Line 2245: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_total_demand - Unable to find schema name');

2241:
2242: x_schema := fnd_profile.value('MSD_DEM_SCHEMA');
2243: IF (x_schema IS NULL)
2244: THEN
2245: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_total_demand - Unable to find schema name');
2246: END IF;
2247:
2248:
2249:

Line 2318: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_total_demand - ' || substr(SQLERRM,1,150));

2314: /* Alter session to demantra schema */
2315: x_small_sql := 'alter session set current_schema = ' || x_schema;
2316: EXECUTE IMMEDIATE x_small_sql;
2317:
2318: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_total_demand - ' || substr(SQLERRM,1,150));
2319:
2320: END UPLOAD_TOTAL_DEMAND;
2321:
2322:

Line 2355: raise_application_error(-20001, 'Error: msd_dem_upload_forecast.upload_forecast_with_app_id - Export Data Profile Application ID is null');

2351: BEGIN
2352:
2353: IF (p_export_data_profile_wai IS NULL)
2354: THEN
2355: raise_application_error(-20001, 'Error: msd_dem_upload_forecast.upload_forecast_with_app_id - Export Data Profile Application ID is null');
2356: END IF;
2357:
2358: /* Alter session to APPS */
2359: x_small_sql := 'alter session set current_schema = APPS';

Line 2366: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find schema name');

2362:
2363: x_schema := fnd_profile.value('MSD_DEM_SCHEMA');
2364: IF (x_schema IS NULL)
2365: THEN
2366: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find schema name');
2367: END IF;
2368:
2369: /* Get the name of the data profile */
2370: BEGIN

Line 2382: raise_application_error (-20003, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find data profile ' || substr(SQLERRM,1,150));

2378: /* Alter session to demantra schema */
2379: x_small_sql := 'alter session set current_schema = ' || x_schema;
2380: EXECUTE IMMEDIATE x_small_sql;
2381:
2382: raise_application_error (-20003, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find data profile ' || substr(SQLERRM,1,150));
2383: END;
2384:
2385:
2386: /* Get the internal name of the independent demand forecast series */

Line 2404: raise_application_error (-20004, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find ind fcst series ' || substr(SQLERRM,1,150));

2400: /* Alter session to demantra schema */
2401: x_small_sql := 'alter session set current_schema = ' || x_schema;
2402: EXECUTE IMMEDIATE x_small_sql;
2403:
2404: raise_application_error (-20004, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find ind fcst series ' || substr(SQLERRM,1,150));
2405: END;
2406:
2407:
2408: /* Get the internal name of the dependent demand forecast series */

Line 2426: raise_application_error (-20005, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find dep fcst series ' || substr(SQLERRM,1,150));

2422: /* Alter session to demantra schema */
2423: x_small_sql := 'alter session set current_schema = ' || x_schema;
2424: EXECUTE IMMEDIATE x_small_sql;
2425:
2426: raise_application_error (-20005, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find dep fcst series ' || substr(SQLERRM,1,150));
2427: END;
2428:
2429: /* Alter session to demantra schema */
2430: x_small_sql := 'alter session set current_schema = ' || x_schema;

Line 2444: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - ' || substr(SQLERRM,1,150));

2440: /* Alter session to demantra schema */
2441: x_small_sql := 'alter session set current_schema = ' || x_schema;
2442: EXECUTE IMMEDIATE x_small_sql;
2443:
2444: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - ' || substr(SQLERRM,1,150));
2445:
2446: END UPLOAD_FORECAST_WITH_APP_ID;
2447:
2448:

Line 2559: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Unable to find schema name');

2555: EXECUTE IMMEDIATE x_small_sql;
2556:
2557: x_schema := fnd_profile.value('MSD_DEM_SCHEMA');
2558: IF (x_schema IS NULL) THEN
2559: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Unable to find schema name');
2560: END IF;
2561:
2562: x_small_sql := ' BEGIN ' || x_schema || '.dl_log_status(''' || VS_MSG_UPLOAD_PCTG_DRCT || ''' , ''' ||
2563: VS_MSG_LOADING || ' ' || p_pp_export_data_profile || ''' , ''' || VS_MSG_STARTED || ''' ); END;';

Line 2568: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Planning Percentage export data profile name NOT provided');

2564: EXECUTE IMMEDIATE x_small_sql;
2565:
2566: /* Initialize local variables */
2567: IF (p_pp_export_data_profile IS NULL) THEN
2568: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Planning Percentage export data profile name NOT provided');
2569: ELSE
2570: x_pctg_exp_dp := lower(p_pp_export_data_profile);
2571: END IF;
2572:

Line 2574: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Total Demand export data profile name NOT provided');

2570: x_pctg_exp_dp := lower(p_pp_export_data_profile);
2571: END IF;
2572:
2573: IF (p_fcst_export_data_profile IS NULL) THEN
2574: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Total Demand export data profile name NOT provided');
2575: ELSE
2576: x_fcst_exp_dp := lower(p_fcst_export_data_profile);
2577: END IF;
2578:

Line 2580: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Planning Percentage series internal name NOT provided');

2576: x_fcst_exp_dp := lower(p_fcst_export_data_profile);
2577: END IF;
2578:
2579: IF (p_pctg_series_iname IS NULL) THEN
2580: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Planning Percentage series internal name NOT provided');
2581: ELSE
2582: x_pctg_series_iname := lower(p_pctg_series_iname);
2583: END IF;
2584:

Line 2591: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Parent Item Demand series internal name NOT provided');

2587: x_option_series_iname := lower(p_option_item_series_iname);
2588: END IF;
2589:
2590: IF (p_parent_item_series_iname IS NULL AND p_option_item_series_iname IS NOT NULL) THEN
2591: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Parent Item Demand series internal name NOT provided');
2592: END IF;
2593:
2594: IF (p_option_item_series_iname IS NULL AND p_parent_item_series_iname IS NOT NULL) THEN
2595: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Option Item Demand series internal name NOT provided');

Line 2595: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Option Item Demand series internal name NOT provided');

2591: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Parent Item Demand series internal name NOT provided');
2592: END IF;
2593:
2594: IF (p_option_item_series_iname IS NULL AND p_parent_item_series_iname IS NOT NULL) THEN
2595: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Option Item Demand series internal name NOT provided');
2596: END IF;
2597:
2598: /* Determine how is planning percentage exported */
2599: IF (p_parent_item_series_iname IS NOT NULL) THEN

Line 2650: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Unable to get pctg export data profile id');

2646:
2647: /*** Check basic error conditions - BEGIN ***/
2648:
2649: IF (x_profile_id IS NULL) THEN
2650: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Unable to get pctg export data profile id');
2651: ELSIF (x_integration_type = C_IMPORT_DATA_PROFILE) THEN
2652: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - ' || x_pctg_exp_dp || 'is not an export data profile');
2653: ELSIF (x_export_type = C_EXPORT_TYPE_INCR) THEN
2654: raise_application_error (-20009, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Incremental export type is not supported');

Line 2652: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - ' || x_pctg_exp_dp || 'is not an export data profile');

2648:
2649: IF (x_profile_id IS NULL) THEN
2650: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Unable to get pctg export data profile id');
2651: ELSIF (x_integration_type = C_IMPORT_DATA_PROFILE) THEN
2652: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - ' || x_pctg_exp_dp || 'is not an export data profile');
2653: ELSIF (x_export_type = C_EXPORT_TYPE_INCR) THEN
2654: raise_application_error (-20009, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Incremental export type is not supported');
2655: ELSIF (x_index_id IS NOT NULL) THEN
2656: raise_application_error (-20010, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Forecast amount cannot be uploaded');

Line 2654: raise_application_error (-20009, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Incremental export type is not supported');

2650: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Unable to get pctg export data profile id');
2651: ELSIF (x_integration_type = C_IMPORT_DATA_PROFILE) THEN
2652: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - ' || x_pctg_exp_dp || 'is not an export data profile');
2653: ELSIF (x_export_type = C_EXPORT_TYPE_INCR) THEN
2654: raise_application_error (-20009, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Incremental export type is not supported');
2655: ELSIF (x_index_id IS NOT NULL) THEN
2656: raise_application_error (-20010, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Forecast amount cannot be uploaded');
2657: ELSIF (x_is_view_present = 0) THEN
2658: raise_application_error (-20011, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Forecast has not yet been exported');

Line 2656: raise_application_error (-20010, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Forecast amount cannot be uploaded');

2652: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - ' || x_pctg_exp_dp || 'is not an export data profile');
2653: ELSIF (x_export_type = C_EXPORT_TYPE_INCR) THEN
2654: raise_application_error (-20009, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Incremental export type is not supported');
2655: ELSIF (x_index_id IS NOT NULL) THEN
2656: raise_application_error (-20010, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Forecast amount cannot be uploaded');
2657: ELSIF (x_is_view_present = 0) THEN
2658: raise_application_error (-20011, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Forecast has not yet been exported');
2659: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC) THEN
2660: raise_application_error (-20012, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Presentation type must by Code');

Line 2658: raise_application_error (-20011, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Forecast has not yet been exported');

2654: raise_application_error (-20009, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Incremental export type is not supported');
2655: ELSIF (x_index_id IS NOT NULL) THEN
2656: raise_application_error (-20010, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Forecast amount cannot be uploaded');
2657: ELSIF (x_is_view_present = 0) THEN
2658: raise_application_error (-20011, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Forecast has not yet been exported');
2659: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC) THEN
2660: raise_application_error (-20012, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Presentation type must by Code');
2661: ELSIF (x_unit_id <> 1 AND lower(x_uom_code) <> 'units') THEN
2662: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Display unit is not UNITS.');

Line 2660: raise_application_error (-20012, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Presentation type must by Code');

2656: raise_application_error (-20010, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Forecast amount cannot be uploaded');
2657: ELSIF (x_is_view_present = 0) THEN
2658: raise_application_error (-20011, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Forecast has not yet been exported');
2659: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC) THEN
2660: raise_application_error (-20012, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Presentation type must by Code');
2661: ELSIF (x_unit_id <> 1 AND lower(x_uom_code) <> 'units') THEN
2662: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Display unit is not UNITS.');
2663: ELSIF (x_fcst_profile_id IS NULL) THEN
2664: raise_application_error (-20014, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Unable to get forecast export data profile id');

Line 2662: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Display unit is not UNITS.');

2658: raise_application_error (-20011, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Forecast has not yet been exported');
2659: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC) THEN
2660: raise_application_error (-20012, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Presentation type must by Code');
2661: ELSIF (x_unit_id <> 1 AND lower(x_uom_code) <> 'units') THEN
2662: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Display unit is not UNITS.');
2663: ELSIF (x_fcst_profile_id IS NULL) THEN
2664: raise_application_error (-20014, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Unable to get forecast export data profile id');
2665: END IF;
2666:

Line 2664: raise_application_error (-20014, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Unable to get forecast export data profile id');

2660: raise_application_error (-20012, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Presentation type must by Code');
2661: ELSIF (x_unit_id <> 1 AND lower(x_uom_code) <> 'units') THEN
2662: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Display unit is not UNITS.');
2663: ELSIF (x_fcst_profile_id IS NULL) THEN
2664: raise_application_error (-20014, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Unable to get forecast export data profile id');
2665: END IF;
2666:
2667: /*** Check basic error conditions - END ***/
2668:

Line 2678: raise_application_error (-20015, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Item level is required for upload');

2674: */
2675: /* PRODUCT */
2676: x_prd_level := get_level_column (x_profile_id, C_ITEM);
2677: IF (x_prd_level IS NULL) THEN
2678: raise_application_error (-20015, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Item level is required for upload');
2679: END IF;
2680:
2681: /* Parent Item */
2682: x_parent_item_level := get_level_column (x_profile_id, C_PARENT_ITEM);

Line 2684: raise_application_error (-20016, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Parent Item level is required for upload');

2680:
2681: /* Parent Item */
2682: x_parent_item_level := get_level_column (x_profile_id, C_PARENT_ITEM);
2683: IF (x_parent_item_level IS NULL) THEN
2684: raise_application_error (-20016, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Parent Item level is required for upload');
2685: END IF;
2686:
2687: /* Base Model */
2688: x_base_model_level := get_level_column (x_profile_id, C_CTO_BASE_MODEL);

Line 2690: raise_application_error (-20017, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Base Model level is required for upload');

2686:
2687: /* Base Model */
2688: x_base_model_level := get_level_column (x_profile_id, C_CTO_BASE_MODEL);
2689: IF (x_base_model_level IS NULL) THEN
2690: raise_application_error (-20017, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Base Model level is required for upload');
2691: END IF;
2692:
2693: /* ORGANIZATION */
2694: x_org_level := get_level_column (x_profile_id, C_ORGANIZATION);

Line 2701: raise_application_error (-20018, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Unable to get sr_instance_id for global planning percentages');

2697: x_sr_organization_id := '-1';
2698:
2699: x_sr_instance_id_for_global := get_sr_instance_id_for_global;
2700: IF (x_sr_instance_id_for_global IS NULL) THEN
2701: raise_application_error (-20018, 'Error: msd_dem_upload_forecast.upload_cto_plng_pct_direct - Unable to get sr_instance_id for global planning percentages');
2702: END IF;
2703: ELSE
2704: x_is_global_fcst := 2;
2705: x_sr_organization_id := ' msi.organization_id ';

Line 3043: raise_application_error (-20019, 'Exception: msd_dem_upload_forecast.upload_cto_plng_pct_direct - ' || substr(SQLERRM,1,150));

3039: /* Alter session to demantra schema */
3040: x_small_sql := 'alter session set current_schema = ' || x_schema;
3041: EXECUTE IMMEDIATE x_small_sql;
3042:
3043: raise_application_error (-20019, 'Exception: msd_dem_upload_forecast.upload_cto_plng_pct_direct - ' || substr(SQLERRM,1,150));
3044: END UPLOAD_CTO_PLNG_PCT_DIRECT;
3045:
3046:
3047:

Line 3081: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_plng_pctg_with_app_id - Planning Percentage export data profile APP ID NOT provided');

3077: BEGIN
3078:
3079: IF (p_pp_export_data_profile_wai IS NULL)
3080: THEN
3081: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_plng_pctg_with_app_id - Planning Percentage export data profile APP ID NOT provided');
3082: END IF;
3083:
3084: IF (p_fcst_export_data_profile_wai IS NULL)
3085: THEN

Line 3086: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_plng_pctg_with_app_id - Total Demand export data profile APP ID NOT provided');

3082: END IF;
3083:
3084: IF (p_fcst_export_data_profile_wai IS NULL)
3085: THEN
3086: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_plng_pctg_with_app_id - Total Demand export data profile APP ID NOT provided');
3087: END IF;
3088:
3089: IF (p_pctg_series_wai IS NULL)
3090: THEN

Line 3091: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_plng_pctg_with_app_id - Planning Percentage series APP ID NOT provided');

3087: END IF;
3088:
3089: IF (p_pctg_series_wai IS NULL)
3090: THEN
3091: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_plng_pctg_with_app_id - Planning Percentage series APP ID NOT provided');
3092: END IF;
3093:
3094: x_schema := fnd_profile.value('MSD_DEM_SCHEMA');
3095: IF (x_schema IS NULL)

Line 3097: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_plng_pctg_with_app_id - Unable to find schema name');

3093:
3094: x_schema := fnd_profile.value('MSD_DEM_SCHEMA');
3095: IF (x_schema IS NULL)
3096: THEN
3097: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_plng_pctg_with_app_id - Unable to find schema name');
3098: END IF;
3099:
3100:
3101: /* Get the name of the planning percentage data profile */

Line 3114: raise_application_error (-20005, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find plan pct data profile ' || substr(SQLERRM,1,150));

3110: /* Alter session to demantra schema */
3111: x_small_sql := 'alter session set current_schema = ' || x_schema;
3112: EXECUTE IMMEDIATE x_small_sql;
3113:
3114: raise_application_error (-20005, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find plan pct data profile ' || substr(SQLERRM,1,150));
3115: END;
3116:
3117: /* Get the name of the total demand data profile */
3118: BEGIN

Line 3130: raise_application_error (-20006, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find total demand data profile ' || substr(SQLERRM,1,150));

3126: /* Alter session to demantra schema */
3127: x_small_sql := 'alter session set current_schema = ' || x_schema;
3128: EXECUTE IMMEDIATE x_small_sql;
3129:
3130: raise_application_error (-20006, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find total demand data profile ' || substr(SQLERRM,1,150));
3131: END;
3132:
3133: /* Get the internal name of the planning percentage series */
3134: BEGIN

Line 3146: raise_application_error (-20007, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find plan pct series ' || substr(SQLERRM,1,150));

3142: /* Alter session to demantra schema */
3143: x_small_sql := 'alter session set current_schema = ' || x_schema;
3144: EXECUTE IMMEDIATE x_small_sql;
3145:
3146: raise_application_error (-20007, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find plan pct series ' || substr(SQLERRM,1,150));
3147: END;
3148:
3149: /* Get the internal name of the parent item demand forecast series */
3150: BEGIN

Line 3167: raise_application_error (-20008, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find parent item demand fcst series ' || substr(SQLERRM,1,150));

3163: /* Alter session to demantra schema */
3164: x_small_sql := 'alter session set current_schema = ' || x_schema;
3165: EXECUTE IMMEDIATE x_small_sql;
3166:
3167: raise_application_error (-20008, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find parent item demand fcst series ' || substr(SQLERRM,1,150));
3168: END;
3169:
3170: /* Get the internal name of the option item demand forecast series */
3171: BEGIN

Line 3188: raise_application_error (-20009, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find option item demand fcst series ' || substr(SQLERRM,1,150));

3184: /* Alter session to demantra schema */
3185: x_small_sql := 'alter session set current_schema = ' || x_schema;
3186: EXECUTE IMMEDIATE x_small_sql;
3187:
3188: raise_application_error (-20009, 'Exception: msd_dem_upload_forecast.upload_forecast_with_app_id - Unable to find option item demand fcst series ' || substr(SQLERRM,1,150));
3189: END;
3190: x_upload_pct_by_base_model := NVL(fnd_profile.value('MSD_DEM_PUB_PLAN_PCT_BY_BASE_MODEL'), 'N');
3191: /* Alter session to demantra schema */
3192: x_small_sql := 'alter session set current_schema = ' || x_schema;

Line 3210: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_plng_pctg_with_app_id - ' || substr(SQLERRM,1,150));

3206: /* Alter session to demantra schema */
3207: x_small_sql := 'alter session set current_schema = ' || x_schema;
3208: EXECUTE IMMEDIATE x_small_sql;
3209:
3210: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_plng_pctg_with_app_id - ' || substr(SQLERRM,1,150));
3211:
3212: END UPLOAD_PLNG_PCTG_WITH_APP_ID;
3213:
3214:

Line 3250: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_cto_fcst_with_app_id - All the four input parameters must be specified');

3246: OR p_dep_export_data_profile_wai IS NULL
3247: OR p_ind_fcst_series_wai IS NULL
3248: OR p_dep_fcst_series_wai IS NULL)
3249: THEN
3250: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_cto_fcst_with_app_id - All the four input parameters must be specified');
3251: END IF;
3252:
3253:
3254: x_schema := fnd_profile.value('MSD_DEM_SCHEMA');

Line 3257: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_cto_fcst_with_app_id - Unable to find schema name');

3253:
3254: x_schema := fnd_profile.value('MSD_DEM_SCHEMA');
3255: IF (x_schema IS NULL)
3256: THEN
3257: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_cto_fcst_with_app_id - Unable to find schema name');
3258: END IF;
3259:
3260:
3261: /* Get the name of the independent demand data profile */

Line 3274: raise_application_error (-20003, 'Exception: msd_dem_upload_forecast.upload_cto_fcst_with_app_id - Unable to find independent demand data profile ' || substr(SQLERRM,1,150));

3270: /* Alter session to demantra schema */
3271: x_small_sql := 'alter session set current_schema = ' || x_schema;
3272: EXECUTE IMMEDIATE x_small_sql;
3273:
3274: raise_application_error (-20003, 'Exception: msd_dem_upload_forecast.upload_cto_fcst_with_app_id - Unable to find independent demand data profile ' || substr(SQLERRM,1,150));
3275: END;
3276:
3277: /* Get the name of the dependent demand data profile */
3278: BEGIN

Line 3290: raise_application_error (-20004, 'Exception: msd_dem_upload_forecast.upload_cto_fcst_with_app_id - Unable to find dependent demand data profile ' || substr(SQLERRM,1,150));

3286: /* Alter session to demantra schema */
3287: x_small_sql := 'alter session set current_schema = ' || x_schema;
3288: EXECUTE IMMEDIATE x_small_sql;
3289:
3290: raise_application_error (-20004, 'Exception: msd_dem_upload_forecast.upload_cto_fcst_with_app_id - Unable to find dependent demand data profile ' || substr(SQLERRM,1,150));
3291: END;
3292:
3293: /* Get the internal name of the independent demand forecast series */
3294: BEGIN

Line 3306: raise_application_error (-20005, 'Exception: msd_dem_upload_forecast.upload_cto_fcst_with_app_id - Unable to find independent demand series ' || substr(SQLERRM,1,150));

3302: /* Alter session to demantra schema */
3303: x_small_sql := 'alter session set current_schema = ' || x_schema;
3304: EXECUTE IMMEDIATE x_small_sql;
3305:
3306: raise_application_error (-20005, 'Exception: msd_dem_upload_forecast.upload_cto_fcst_with_app_id - Unable to find independent demand series ' || substr(SQLERRM,1,150));
3307: END;
3308:
3309: /* Get the internal name of the dependent demand forecast series */
3310: BEGIN

Line 3322: raise_application_error (-20005, 'Exception: msd_dem_upload_forecast.upload_cto_fcst_with_app_id - Unable to find dependent demand series ' || substr(SQLERRM,1,150));

3318: /* Alter session to demantra schema */
3319: x_small_sql := 'alter session set current_schema = ' || x_schema;
3320: EXECUTE IMMEDIATE x_small_sql;
3321:
3322: raise_application_error (-20005, 'Exception: msd_dem_upload_forecast.upload_cto_fcst_with_app_id - Unable to find dependent demand series ' || substr(SQLERRM,1,150));
3323: END;
3324:
3325: /* Alter session to demantra schema */
3326: x_small_sql := 'alter session set current_schema = ' || x_schema;

Line 3341: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_cto_fcst_with_app_id - ' || substr(SQLERRM,1,150));

3337: /* Alter session to demantra schema */
3338: x_small_sql := 'alter session set current_schema = ' || x_schema;
3339: EXECUTE IMMEDIATE x_small_sql;
3340:
3341: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_cto_fcst_with_app_id - ' || substr(SQLERRM,1,150));
3342:
3343: END UPLOAD_CTO_FCST_WITH_APP_ID;
3344:
3345: /*

Line 3419: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Unable to find schema name');

3415:
3416: x_schema := fnd_profile.value('MSD_DEM_SCHEMA');
3417: IF (x_schema IS NULL)
3418: THEN
3419: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Unable to find schema name');
3420: END IF;
3421:
3422:
3423: /* Initialize global variables */

Line 3426: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_spf_metrics - No export data profile name provided');

3422:
3423: /* Initialize global variables */
3424: IF (p_dp_metrics_appid IS NULL or p_dp_final_forecast_appid IS NULL )
3425: THEN
3426: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_spf_metrics - No export data profile name provided');
3427: ELSE
3428: x_dp_metrics_appid := upper(p_dp_metrics_appid);
3429: x_dp_final_forecast_appid := upper(p_dp_final_forecast_appid);
3430: END IF;

Line 3484: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Unable to get export data profile id');

3480: /*** Check basic error conditions - BEGIN ***/
3481:
3482: IF (x_metrics_profile_id IS NULL)
3483: THEN
3484: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Unable to get export data profile id');
3485: ELSIF (x_integration_type = C_IMPORT_DATA_PROFILE)
3486: THEN
3487: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_spf_metrics - ' || x_query_name || 'is not an export data profile');
3488: ELSIF (x_export_type = C_EXPORT_TYPE_INCR)

Line 3487: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_spf_metrics - ' || x_query_name || 'is not an export data profile');

3483: THEN
3484: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Unable to get export data profile id');
3485: ELSIF (x_integration_type = C_IMPORT_DATA_PROFILE)
3486: THEN
3487: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_spf_metrics - ' || x_query_name || 'is not an export data profile');
3488: ELSIF (x_export_type = C_EXPORT_TYPE_INCR)
3489: THEN
3490: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Incremental export type is not supported');
3491: ELSIF (x_index_id IS NOT NULL)

Line 3490: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Incremental export type is not supported');

3486: THEN
3487: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_spf_metrics - ' || x_query_name || 'is not an export data profile');
3488: ELSIF (x_export_type = C_EXPORT_TYPE_INCR)
3489: THEN
3490: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Incremental export type is not supported');
3491: ELSIF (x_index_id IS NOT NULL)
3492: THEN
3493: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast amount cannot be uploaded');
3494: ELSIF (x_is_view_present = 0)

Line 3493: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast amount cannot be uploaded');

3489: THEN
3490: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Incremental export type is not supported');
3491: ELSIF (x_index_id IS NOT NULL)
3492: THEN
3493: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast amount cannot be uploaded');
3494: ELSIF (x_is_view_present = 0)
3495: THEN
3496: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast has not yet been exported');
3497: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC)

Line 3496: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast has not yet been exported');

3492: THEN
3493: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast amount cannot be uploaded');
3494: ELSIF (x_is_view_present = 0)
3495: THEN
3496: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast has not yet been exported');
3497: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC)
3498: THEN
3499: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Presentation type must by Code');
3500: END IF;

Line 3499: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Presentation type must by Code');

3495: THEN
3496: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast has not yet been exported');
3497: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC)
3498: THEN
3499: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Presentation type must by Code');
3500: END IF;
3501:
3502: /*** Check basic error conditions - END ***/
3503:

Line 3587: raise_application_error (-20014, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Error in call to custom hook msd_dem_custom_hooks.upload_hook');

3583: VS_MSG_LOADED || ' ' || x_query_name || ''' , ''' || VS_MSG_LOADE_ERROR || ''',''' || x_errbuf || ''' ); END;';
3584:
3585: EXECUTE IMMEDIATE x_small_sql;
3586:
3587: raise_application_error (-20014, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Error in call to custom hook msd_dem_custom_hooks.upload_hook');
3588: END IF;
3589:
3590: x_small_sql := ' BEGIN ' || x_schema || '.dl_log_status(''' || VS_MSG_UPLOAD_FCST || ''' , ''' ||
3591: VS_MSG_LOADED || ' ' || x_query_name || ''' , ''' || VS_MSG_SUCCEEDED || ''' ); END;';

Line 3617: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_spf_metrics - '|| substr(sqlerrm,1,150));

3613:
3614: x_small_sql := 'alter session set current_schema = ' || x_schema;
3615: EXECUTE IMMEDIATE x_small_sql;
3616:
3617: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_spf_metrics - '|| substr(sqlerrm,1,150));
3618:
3619: END UPLOAD_SPF_METRICS;
3620:
3621: /*

Line 3749: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_spf_inc_forecast - Unable to find schema name');

3745:
3746: x_schema := fnd_profile.value('MSD_DEM_SCHEMA');
3747: IF (x_schema IS NULL)
3748: THEN
3749: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_spf_inc_forecast - Unable to find schema name');
3750: END IF;
3751:
3752:
3753: /* Initialize global variables */

Line 3756: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_spf_inc_forecast - No export data profile name provided');

3752:
3753: /* Initialize global variables */
3754: IF (p_dp_final_forecast_appid IS NULL or p_dp_metrics_appid IS NULL )
3755: THEN
3756: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_spf_inc_forecast - No export data profile name provided');
3757: ELSE
3758: x_dp_metrics_appid := upper(p_dp_metrics_appid);
3759: x_dp_final_forecast_appid := upper(p_dp_final_forecast_appid);
3760: END IF;

Line 3833: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Unable to get export data profile id');

3829: /*** Check basic error conditions - BEGIN ***/
3830:
3831: IF (x_metrics_profile_id IS NULL or x_ffcast_profile_id IS NULL)
3832: THEN
3833: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Unable to get export data profile id');
3834: ELSIF (x_metrics_integration_type = C_IMPORT_DATA_PROFILE or x_ffcast_integration_type = C_IMPORT_DATA_PROFILE )
3835: THEN
3836: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_spf_metrics - ' || x_metrics_query_name || ' or ' || x_ffcast_query_name || 'is not an export data profile');
3837: ELSIF (x_metrics_export_type = C_EXPORT_TYPE_INCR or x_ffcast_export_type = C_EXPORT_TYPE_INCR)

Line 3836: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_spf_metrics - ' || x_metrics_query_name || ' or ' || x_ffcast_query_name || 'is not an export data profile');

3832: THEN
3833: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Unable to get export data profile id');
3834: ELSIF (x_metrics_integration_type = C_IMPORT_DATA_PROFILE or x_ffcast_integration_type = C_IMPORT_DATA_PROFILE )
3835: THEN
3836: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_spf_metrics - ' || x_metrics_query_name || ' or ' || x_ffcast_query_name || 'is not an export data profile');
3837: ELSIF (x_metrics_export_type = C_EXPORT_TYPE_INCR or x_ffcast_export_type = C_EXPORT_TYPE_INCR)
3838: THEN
3839: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Incremental export type is not supported');
3840: ELSIF (x_metrics_index_id IS NOT NULL or x_ffcast_index_id IS NOT NULL)

Line 3839: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Incremental export type is not supported');

3835: THEN
3836: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_spf_metrics - ' || x_metrics_query_name || ' or ' || x_ffcast_query_name || 'is not an export data profile');
3837: ELSIF (x_metrics_export_type = C_EXPORT_TYPE_INCR or x_ffcast_export_type = C_EXPORT_TYPE_INCR)
3838: THEN
3839: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Incremental export type is not supported');
3840: ELSIF (x_metrics_index_id IS NOT NULL or x_ffcast_index_id IS NOT NULL)
3841: THEN
3842: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast amount cannot be uploaded');
3843: ELSIF (x_metrics_is_view_present = 0 or x_ffcast_is_view_present = 0 )

Line 3842: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast amount cannot be uploaded');

3838: THEN
3839: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Incremental export type is not supported');
3840: ELSIF (x_metrics_index_id IS NOT NULL or x_ffcast_index_id IS NOT NULL)
3841: THEN
3842: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast amount cannot be uploaded');
3843: ELSIF (x_metrics_is_view_present = 0 or x_ffcast_is_view_present = 0 )
3844: THEN
3845: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast has not yet been exported');
3846: ELSIF (x_metrics_presentation_type = C_PSNT_TYPE_DESC or x_ffcast_presentation_type = C_PSNT_TYPE_DESC)

Line 3845: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast has not yet been exported');

3841: THEN
3842: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast amount cannot be uploaded');
3843: ELSIF (x_metrics_is_view_present = 0 or x_ffcast_is_view_present = 0 )
3844: THEN
3845: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast has not yet been exported');
3846: ELSIF (x_metrics_presentation_type = C_PSNT_TYPE_DESC or x_ffcast_presentation_type = C_PSNT_TYPE_DESC)
3847: THEN
3848: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Presentation type must by Code');
3849: END IF;

Line 3848: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Presentation type must by Code');

3844: THEN
3845: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Forecast has not yet been exported');
3846: ELSIF (x_metrics_presentation_type = C_PSNT_TYPE_DESC or x_ffcast_presentation_type = C_PSNT_TYPE_DESC)
3847: THEN
3848: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_spf_metrics - Presentation type must by Code');
3849: END IF;
3850:
3851: /*** Check basic error conditions - END ***/
3852:

Line 3929: raise_application_error (-20020, 'Error: msd_dem_upload_forecast.upload_spf_inc_forecast - Invalid series application id. ' );

3925: || x_schema || '.safe_division'') from '
3926: || x_schema || '.COMPUTED_FIELDS where application_id = '|| '''' || p_ff_series_appid || '''' ;
3927: EXECUTE IMMEDIATE x_small_sql into x_se_spf_ff ;
3928: EXCEPTION WHEN others THEN
3929: raise_application_error (-20020, 'Error: msd_dem_upload_forecast.upload_spf_inc_forecast - Invalid series application id. ' );
3930: END;
3931:
3932: END IF;
3933:

Line 3948: raise_application_error (-20019, 'Error: msd_dem_upload_forecast.upload_spf_inc_forecast - Unable to find server expression for series - '

3944:
3945:
3946:
3947: IF (x_se_spf_ff is null or x_se_spf_fv is null or x_se_spf_fmout is null or x_se_spf_fmout is null or x_se_spf_ad is null) THEN
3948: raise_application_error (-20019, 'Error: msd_dem_upload_forecast.upload_spf_inc_forecast - Unable to find server expression for series - '
3949: || 'SPF Final Forecast,SPF Forecast Volatility,SPF Forecast MAPE (Out of Sample),'
3950: || 'SPF Forecast MAPE (In Sample),SPF Average Demand' );
3951: END IF;
3952:

Line 3962: raise_application_error (-20019, 'Error: msd_dem_upload_forecast.upload_spf_inc_forecast - Unable to fetch fcst_start_date and fcst_last_date. ');

3958: || ' and EP.APPLICATION_ID = ''ENGINE_PROFILE:121'')' ;
3959: EXECUTE IMMEDIATE x_small_sql into x_fcst_start_date, x_fcst_last_date ;
3960:
3961: IF (x_fcst_start_date is null or x_fcst_last_date is null) THEN
3962: raise_application_error (-20019, 'Error: msd_dem_upload_forecast.upload_spf_inc_forecast - Unable to fetch fcst_start_date and fcst_last_date. ');
3963: END IF;
3964:
3965: /* Fetch the values of the 4 series(metrics) for a given item/org/instance tuple */
3966: x_sql := ' SELECT METRICS_TBL.inventory_item_id, '

Line 4143: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_spf_inc_forecast - '|| substr(sqlerrm,1,150));

4139: /* Alter session to demantra schema */
4140: x_small_sql := ' alter session set current_schema = ' || x_schema ;
4141: EXECUTE IMMEDIATE x_small_sql;
4142:
4143: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_spf_inc_forecast - '|| substr(sqlerrm,1,150));
4144:
4145: END UPLOAD_SPF_INC_FORECAST;
4146:
4147: /*

Line 4172: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.wait_until_upload - Unable to find schema name');

4168: BEGIN
4169: x_dem_schema := trim(fnd_profile.value('MSD_DEM_SCHEMA'));
4170:
4171: IF (x_dem_schema IS NULL) then
4172: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.wait_until_upload - Unable to find schema name');
4173: END IF;
4174:
4175: /* Loop and wait till previously launched workflow instance is running */
4176: WHILE (x_wf_status = 'Running') LOOP

Line 4205: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.wait_until_upload - '|| substr(sqlerrm,1,150));

4201: END LOOP;
4202:
4203: EXCEPTION
4204: WHEN OTHERS THEN
4205: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.wait_until_upload - '|| substr(sqlerrm,1,150));
4206:
4207: END WAIT_UNTIL_UPLOAD;
4208:
4209:

Line 4240: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.check_upload_last_run - Unable to find schema name');

4236:
4237: x_dem_schema := trim(fnd_profile.value('MSD_DEM_SCHEMA'));
4238:
4239: IF (x_dem_schema is NULL) THEN
4240: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.check_upload_last_run - Unable to find schema name');
4241: END IF;
4242:
4243: /* Fetch the data profile name */
4244: x_sql := 'SELECT TRIM(QUERY_NAME) FROM ' ||x_dem_schema

Line 4288: raise_application_error (-20020, 'Error: msd_dem_upload_forecast.check_upload_last_run - Forecast_Install_Base engine is never executed ');

4284: END IF;
4285:
4286: /* If the 'Forecast Install Base' engine is never run */
4287: IF (x_last_eng_time is null) THEN
4288: raise_application_error (-20020, 'Error: msd_dem_upload_forecast.check_upload_last_run - Forecast_Install_Base engine is never executed ');
4289: RETURN NULL;
4290: END IF;
4291:
4292:

Line 4307: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.check_upload_last_run - '|| substr(sqlerrm,1,150));

4303: end if ;
4304:
4305: EXCEPTION
4306: WHEN OTHERS THEN
4307: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.check_upload_last_run - '|| substr(sqlerrm,1,150));
4308: RETURN NULL;
4309:
4310: END CHECK_UPLOAD_LAST_RUN;
4311:

Line 4549: msd_dem_common_utilities.log_debug ('Entering: msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || TO_CHAR(systimestamp, 'DD-MON-YYYY HH24:MI:SS'));

4545:
4546:
4547: BEGIN
4548:
4549: msd_dem_common_utilities.log_debug ('Entering: msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || TO_CHAR(systimestamp, 'DD-MON-YYYY HH24:MI:SS'));
4550: msd_dem_common_utilities.log_debug (' ');
4551:
4552: /* Log the input parameters to the log file */
4553: msd_dem_common_utilities.log_message('----------------------------------Input Parameters - Begin------------------------------------------');

Line 4566: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Unable to find schema name');

4562: msd_dem_common_utilities.log_message ('');
4563:
4564: IF (x_dem_schema IS NULL)
4565: THEN
4566: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Unable to find schema name');
4567: END IF;
4568:
4569: IF (p_export_data_profile IS NULL)
4570: THEN

Line 4571: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Missing data profile application id');

4567: END IF;
4568:
4569: IF (p_export_data_profile IS NULL)
4570: THEN
4571: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Missing data profile application id');
4572: END IF;
4573:
4574: IF (p_workflow_lookup_code IS NULL)
4575: THEN

Line 4576: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Missing workflow lookup code');

4572: END IF;
4573:
4574: IF (p_workflow_lookup_code IS NULL)
4575: THEN
4576: raise_application_error (-20003, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Missing workflow lookup code');
4577: END IF;
4578:
4579:
4580: /*------- START - Get Desination to Source DBlink -------*/

Line 4591: msd_dem_common_utilities.log_message ('ERROR(1) - msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || TO_CHAR(systimestamp, 'DD-MON-YYYY HH24:MI:SS'));

4587: IF (var_retcode = -1)
4588: THEN
4589: retcode := -1;
4590: errbuf := substr(SQLERRM,1,150);
4591: msd_dem_common_utilities.log_message ('ERROR(1) - msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || TO_CHAR(systimestamp, 'DD-MON-YYYY HH24:MI:SS'));
4592: msd_dem_common_utilities.log_message ('Error in call to msd_dem_common_utilities.get_dblink');
4593: msd_dem_common_utilities.log_message (errbuf);
4594: RETURN;
4595: END IF;

Line 4645: msd_dem_common_utilities.log_message ('ERROR(3) - msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || TO_CHAR(systimestamp, 'DD-MON-YYYY HH24:MI:SS'));

4641:
4642: IF (var_retcode = -1) THEN
4643: retcode := -1;
4644: errbuf := var_errbuf;
4645: msd_dem_common_utilities.log_message ('ERROR(3) - msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || TO_CHAR(systimestamp, 'DD-MON-YYYY HH24:MI:SS'));
4646: msd_dem_common_utilities.log_message (errbuf);
4647: RETURN;
4648: END IF;
4649:

Line 4653: msd_dem_common_utilities.log_message ('WARNING(1) - msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || TO_CHAR(systimestamp, 'DD-MON-YYYY HH24:MI:SS'));

4649:
4650: IF (var_retcode = 1) THEN
4651: retcode := 1;
4652: errbuf := var_errbuf;
4653: msd_dem_common_utilities.log_message ('WARNING(1) - msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || TO_CHAR(systimestamp, 'DD-MON-YYYY HH24:MI:SS'));
4654: msd_dem_common_utilities.log_message (errbuf);
4655: END IF;
4656:
4657: EXCEPTION

Line 4661: msd_dem_common_utilities.log_message ('ERROR(4): msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || TO_CHAR(systimestamp, 'DD-MON-YYYY HH24:MI:SS'));

4657: EXCEPTION
4658: WHEN OTHERS THEN
4659: retcode := -1;
4660: errbuf := substr(SQLERRM,1,150);
4661: msd_dem_common_utilities.log_message ('ERROR(4): msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || TO_CHAR(systimestamp, 'DD-MON-YYYY HH24:MI:SS'));
4662: msd_dem_common_utilities.log_message ('Error while launching Demantra Workflow - '|| p_workflow_lookup_code );
4663: msd_dem_common_utilities.log_message (errbuf);
4664: msd_dem_common_utilities.log_message (' ');
4665: RETURN;

Line 4682: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Invalid/Non-existing application id for the data profile.');

4678: msd_dem_common_utilities.log_debug (l_sql);
4679: msd_dem_common_utilities.log_debug (' ');
4680:
4681: IF (x_count = 0) THEN
4682: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Invalid/Non-existing application id for the data profile.');
4683: ELSE
4684: x_count := 0;
4685: END IF;
4686:

Line 4739: raise_application_error (-20012, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Data Profile cannot have more than one series.');

4735: x_small_sql := 'SELECT count(1) FROM ' || x_dem_schema || '.transfer_query_series WHERE id = '|| x_profile_id;
4736: EXECUTE IMMEDIATE x_small_sql INTO x_count;
4737:
4738: IF (x_count > 1) THEN
4739: raise_application_error (-20012, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Data Profile cannot have more than one series.');
4740: END IF;
4741:
4742: l_sql := 'SELECT computed_name FROM ' || x_dem_schema || '.computed_fields cf, ' || x_dem_schema || '.transfer_query_series tqs'
4743: || ' WHERE tqs.id = '|| x_profile_id || ' AND cf.forecast_type_id = tqs.series_id ';

Line 4764: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Unable to get export data profile id');

4760: /*** START - Check basic error conditions ***/
4761:
4762: IF (x_profile_id IS NULL)
4763: THEN
4764: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Unable to get export data profile id');
4765: ELSIF (x_integration_type = C_IMPORT_DATA_PROFILE)
4766: THEN
4767: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || x_query_name || 'is not an export data profile');
4768: ELSIF (x_export_type = C_EXPORT_TYPE_INCR)

Line 4767: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || x_query_name || 'is not an export data profile');

4763: THEN
4764: raise_application_error (-20004, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Unable to get export data profile id');
4765: ELSIF (x_integration_type = C_IMPORT_DATA_PROFILE)
4766: THEN
4767: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || x_query_name || 'is not an export data profile');
4768: ELSIF (x_export_type = C_EXPORT_TYPE_INCR)
4769: THEN
4770: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Incremental export type is not supported');
4771: ELSIF (x_index_id IS NOT NULL)

Line 4770: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Incremental export type is not supported');

4766: THEN
4767: raise_application_error (-20005, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || x_query_name || 'is not an export data profile');
4768: ELSIF (x_export_type = C_EXPORT_TYPE_INCR)
4769: THEN
4770: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Incremental export type is not supported');
4771: ELSIF (x_index_id IS NOT NULL)
4772: THEN
4773: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Forecast amount cannot be uploaded');
4774: ELSIF (x_is_view_present = 0)

Line 4773: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Forecast amount cannot be uploaded');

4769: THEN
4770: raise_application_error (-20006, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Incremental export type is not supported');
4771: ELSIF (x_index_id IS NOT NULL)
4772: THEN
4773: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Forecast amount cannot be uploaded');
4774: ELSIF (x_is_view_present = 0)
4775: THEN
4776: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Forecast has not yet been exported');
4777: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC)

Line 4776: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Forecast has not yet been exported');

4772: THEN
4773: raise_application_error (-20007, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Forecast amount cannot be uploaded');
4774: ELSIF (x_is_view_present = 0)
4775: THEN
4776: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Forecast has not yet been exported');
4777: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC)
4778: THEN
4779: raise_application_error (-20009, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Presentation type must by Code');
4780: END IF;

Line 4779: raise_application_error (-20009, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Presentation type must by Code');

4775: THEN
4776: raise_application_error (-20008, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Forecast has not yet been exported');
4777: ELSIF (x_presentation_type = C_PSNT_TYPE_DESC)
4778: THEN
4779: raise_application_error (-20009, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - Presentation type must by Code');
4780: END IF;
4781:
4782: /*** END - Check basic error conditions ***/
4783:

Line 4798: raise_application_error (-20010, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - "Master Item" level is required in data profile for upload to complete successfully.');

4794: IF (x_MI_level IS NOT NULL)
4795: THEN
4796: x_select_clause := ' SELECT inner_qry.* FROM( SELECT distinct ' || x_MI_level || 'MI, ' ;
4797: ELSE
4798: raise_application_error (-20010, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - "Master Item" level is required in data profile for upload to complete successfully.');
4799: END IF;
4800:
4801: /* get SPF_MAINTENANCE_TYPE level column*/
4802: x_SPF_MT_level := get_level_column (x_profile_id, C_SPF_MAINTENANCE_TYPE);

Line 4807: raise_application_error (-20011, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - "SPF Maintenance Type" level is required in data profile for upload to complete successfully.');

4803: IF (x_SPF_MT_level IS NOT NULL)
4804: THEN
4805: x_select_clause := x_select_clause || ' decode(' || x_SPF_MT_level || ',''0'',NULL,''-777'',NULL,lkup_MT.lookup_code) MT, ' ;
4806: ELSE
4807: raise_application_error (-20011, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - "SPF Maintenance Type" level is required in data profile for upload to complete successfully.');
4808: END IF;
4809:
4810: /* get ASSET_GROUP level column*/
4811: x_AG_level := get_level_column (x_profile_id, C_ASSET_GROUP);

Line 4852: raise_application_error (-20012, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - "SPF Visit Type" level is required in data profile for upload to complete successfully.');

4848: IF (x_SPF_VT_level IS NOT NULL)
4849: THEN
4850: x_select_clause := x_select_clause || 'decode(' || x_SPF_VT_level || ',''0'',NULL,''-777'',NULL,lkup_vt.lookup_code) VT, ' ;
4851: ELSE
4852: raise_application_error (-20012, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - "SPF Visit Type" level is required in data profile for upload to complete successfully.');
4853: END IF;
4854:
4855: /* get SPF_VISIT_STAGE_TYPE level column*/
4856: x_SPF_VST_level := get_level_column (x_profile_id, C_SPF_VISIT_STAGE_TYPE);

Line 4871: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - "Item Type" level is required in data profile for upload to complete successfully.');

4867: THEN
4868: x_select_clause := x_select_clause || 'decode(' || x_IT_level || ',''Material'',''I'',''Product'',''I'',''Resource'',''R'')' || ' IT, ' ;
4869: x_select_clause := REPLACE(x_select_clause, x_MI_level, 'decode(' || x_IT_level || ',''Resource'',' || x_MI_level || ',NULL)');
4870: ELSE
4871: raise_application_error (-20013, 'Error: msd_dem_upload_forecast.upload_cmro_pln_fctrs - "Item Type" level is required in data profile for upload to complete successfully.');
4872: END IF;
4873:
4874: x_select_clause := x_select_clause
4875: || ' msi.sr_inventory_item_id SR_INV_ITEM_ID, '

Line 4972: msd_dem_common_utilities.log_debug ('Exiting: msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || TO_CHAR(systimestamp, 'DD-MON-YYYY HH24:MI:SS'));

4968: msd_dem_common_utilities.log_debug ('Executed insert sql - ' || TO_CHAR(systimestamp, 'DD-MON-YYYY HH24:MI:SS'));
4969: msd_dem_common_utilities.log_debug (' ');
4970: /* END - Inserting into AHL_PLANNING_FACTORS table */
4971:
4972: msd_dem_common_utilities.log_debug ('Exiting: msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || TO_CHAR(systimestamp, 'DD-MON-YYYY HH24:MI:SS'));
4973:
4974: EXCEPTION
4975: WHEN OTHERS THEN
4976: errbuf := substr(SQLERRM,1,150);

Line 4978: msd_dem_common_utilities.log_message ('Exception: msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || TO_CHAR(systimestamp, 'DD-MON-YYYY HH24:MI:SS'));

4974: EXCEPTION
4975: WHEN OTHERS THEN
4976: errbuf := substr(SQLERRM,1,150);
4977: retcode := -1 ;
4978: msd_dem_common_utilities.log_message ('Exception: msd_dem_upload_forecast.upload_cmro_pln_fctrs - ' || TO_CHAR(systimestamp, 'DD-MON-YYYY HH24:MI:SS'));
4979: msd_dem_common_utilities.log_message (errbuf);
4980: msd_dem_common_utilities.log_message (' ');
4981:
4982: END UPLOAD_CMRO_PLN_FCTRS;

Line 5027: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_total_demand_wo - All the four input parameters must be specified');

5023: OR p_wod_export_data_profile_wai IS NULL
5024: OR p_ind_fcst_series_wai IS NULL
5025: OR p_wod_fcst_series_wai IS NULL)
5026: THEN
5027: raise_application_error (-20001, 'Error: msd_dem_upload_forecast.upload_total_demand_wo - All the four input parameters must be specified');
5028: END IF;
5029:
5030:
5031: x_schema := fnd_profile.value('MSD_DEM_SCHEMA');

Line 5034: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_total_demand_wo - Unable to find schema name');

5030:
5031: x_schema := fnd_profile.value('MSD_DEM_SCHEMA');
5032: IF (x_schema IS NULL)
5033: THEN
5034: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_total_demand_wo - Unable to find schema name');
5035: END IF;
5036:
5037:
5038: /* Get the name of the independent demand data profile */

Line 5051: raise_application_error (-20003, 'Exception: msd_dem_upload_forecast.upload_total_demand_wo - Unable to find independent demand data profile ' || substr(SQLERRM,1,150));

5047: /* Alter session to demantra schema */
5048: x_small_sql := 'alter session set current_schema = ' || x_schema;
5049: EXECUTE IMMEDIATE x_small_sql;
5050:
5051: raise_application_error (-20003, 'Exception: msd_dem_upload_forecast.upload_total_demand_wo - Unable to find independent demand data profile ' || substr(SQLERRM,1,150));
5052: END;
5053:
5054:
5055: /* Get the name of the work order demand data profile */

Line 5068: raise_application_error (-20004, 'Exception: msd_dem_upload_forecast.upload_total_demand_wo - Unable to find work order demand data profile ' || substr(SQLERRM,1,150));

5064: /* Alter session to demantra schema */
5065: x_small_sql := 'alter session set current_schema = ' || x_schema;
5066: EXECUTE IMMEDIATE x_small_sql;
5067:
5068: raise_application_error (-20004, 'Exception: msd_dem_upload_forecast.upload_total_demand_wo - Unable to find work order demand data profile ' || substr(SQLERRM,1,150));
5069: END;
5070:
5071:
5072: /* Get the internal name of the independent demand forecast series */

Line 5085: raise_application_error (-20005, 'Exception: msd_dem_upload_forecast.upload_total_demand_wo - Unable to find independent demand series ' || substr(SQLERRM,1,150));

5081: /* Alter session to demantra schema */
5082: x_small_sql := 'alter session set current_schema = ' || x_schema;
5083: EXECUTE IMMEDIATE x_small_sql;
5084:
5085: raise_application_error (-20005, 'Exception: msd_dem_upload_forecast.upload_total_demand_wo - Unable to find independent demand series ' || substr(SQLERRM,1,150));
5086: END;
5087:
5088:
5089: /* Get the internal name of the work order demand forecast series */

Line 5102: raise_application_error (-20006, 'Exception: msd_dem_upload_forecast.upload_total_demand_wo - Unable to find work order demand series ' || substr(SQLERRM,1,150));

5098: /* Alter session to demantra schema */
5099: x_small_sql := 'alter session set current_schema = ' || x_schema;
5100: EXECUTE IMMEDIATE x_small_sql;
5101:
5102: raise_application_error (-20006, 'Exception: msd_dem_upload_forecast.upload_total_demand_wo - Unable to find work order demand series ' || substr(SQLERRM,1,150));
5103: END;
5104:
5105: /* Alter session to demantra schema */
5106: x_small_sql := 'alter session set current_schema = ' || x_schema;

Line 5239: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_total_demand_wo - ' || substr(SQLERRM,1,150));

5235: /* Alter session to demantra schema */
5236: x_small_sql := 'alter session set current_schema = ' || x_schema;
5237: EXECUTE IMMEDIATE x_small_sql;
5238:
5239: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_total_demand_wo - ' || substr(SQLERRM,1,150));
5240:
5241:
5242: END UPLOAD_TOTAL_DEMAND_WO;
5243:

Line 5277: raise_application_error(-20001, 'Error: msd_dem_upload_forecast.upload_spf_forecast_metrics - Export Data Profile Application ID is null');

5273: BEGIN
5274:
5275: IF (p_dp_spf_fcst_metrics_appid IS NULL)
5276: THEN
5277: raise_application_error(-20001, 'Error: msd_dem_upload_forecast.upload_spf_forecast_metrics - Export Data Profile Application ID is null');
5278: END IF;
5279:
5280: x_schema := fnd_profile.value('MSD_DEM_SCHEMA');
5281: IF (x_schema IS NULL)

Line 5283: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_spf_forecast_metrics - Unable to find schema name');

5279:
5280: x_schema := fnd_profile.value('MSD_DEM_SCHEMA');
5281: IF (x_schema IS NULL)
5282: THEN
5283: raise_application_error (-20002, 'Error: msd_dem_upload_forecast.upload_spf_forecast_metrics - Unable to find schema name');
5284: END IF;
5285:
5286: /* Get the name of the data profile */
5287: BEGIN

Line 5295: raise_application_error (-20003, 'Exception: msd_dem_upload_forecast.upload_spf_forecast_metrics - Unable to find data profile ' || substr(SQLERRM,1,150));

5291: USING p_dp_spf_fcst_metrics_appid;
5292:
5293: EXCEPTION
5294: WHEN OTHERS THEN
5295: raise_application_error (-20003, 'Exception: msd_dem_upload_forecast.upload_spf_forecast_metrics - Unable to find data profile ' || substr(SQLERRM,1,150));
5296: END;
5297:
5298: IF (p_acry_series_wai IS NOT NULL)
5299: THEN

Line 5310: raise_application_error (-20003, 'Exception: msd_dem_upload_forecast.upload_spf_forecast_metrics - Unable to get Metrics series internal name with given application id. ' || substr(SQLERRM,1,150));

5306: USING p_acry_series_wai;
5307:
5308: EXCEPTION
5309: WHEN OTHERS THEN
5310: raise_application_error (-20003, 'Exception: msd_dem_upload_forecast.upload_spf_forecast_metrics - Unable to get Metrics series internal name with given application id. ' || substr(SQLERRM,1,150));
5311:
5312: END;
5313:
5314: END IF;

Line 5341: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_spf_forecast_metrics - ' || substr(SQLERRM,1,150));

5337: /* Alter session to demantra schema */
5338: x_small_sql := 'alter session set current_schema = ' || x_schema;
5339: EXECUTE IMMEDIATE x_small_sql;
5340:
5341: raise_application_error (-20015, 'Exception: msd_dem_upload_forecast.upload_spf_forecast_metrics - ' || substr(SQLERRM,1,150));
5342:
5343: END UPLOAD_SPF_FORECAST_METRICS;
5344:
5345:

Line 5348: END MSD_DEM_UPLOAD_FORECAST;

5344:
5345:
5346:
5347:
5348: END MSD_DEM_UPLOAD_FORECAST;