DBA Data[Home] [Help]

APPS.MSC_PHUB_COST_PKG dependencies on MSC_PHUB_UTIL

Line 7: l_owning_currency_code varchar2(20) := msc_phub_util.get_owning_currency_code(p_plan_run_id);

3:
4: procedure populate_details(errbuf out nocopy varchar2, retcode out nocopy varchar2,
5: p_plan_id number, p_plan_run_id number)
6: is
7: l_owning_currency_code varchar2(20) := msc_phub_util.get_owning_currency_code(p_plan_run_id);
8:
9: l_plan_start_date date;
10: l_plan_cutoff_date date;
11: l_plan_type number;

Line 19: msc_phub_util.log('msc_phub_cost_pkg.populate_details:');

15: l_start_time timestamp := systimestamp;
16: l_complete_time timestamp := systimestamp;
17: l_enable_scrm number := nvl(fnd_profile.value('MSC_APCC_ENABLE_SCRM'), 1);
18: begin
19: msc_phub_util.log('msc_phub_cost_pkg.populate_details:');
20: retcode := 0;
21: errbuf := null;
22:
23: select plan_type, sr_instance_id, organization_id, plan_start_date, plan_cutoff_date, temp_transfer_id

Line 30: msc_phub_util.gather_table_stats(msc_phub_util.stats_pds, 'MSC_BIS_INV_DETAIL');

26: where plan_id=p_plan_id
27: and plan_run_id=p_plan_run_id;
28:
29: -- msc_st_costs_f:regular_costs
30: msc_phub_util.gather_table_stats(msc_phub_util.stats_pds, 'MSC_BIS_INV_DETAIL');
31: insert /*+ append nologging */ into msc_st_costs_f (
32: st_transaction_id,
33: error_code,
34: owning_inst_id,

Line 129: msc_phub_util.log('insert into msc_st_costs_f:regular_costs: '||sql%rowcount);

125: decode(sign(mbid.supplier_site_id), 1, mbid.supplier_site_id, -23453),
126: nvl(mbid.ship_method, '-23453'),
127: d.mfg_week_end_date;
128:
129: msc_phub_util.log('insert into msc_st_costs_f:regular_costs: '||sql%rowcount);
130: commit;
131:
132: -- msc_st_costs_f:facility_cost
133: insert /*+ append nologging */ into msc_st_costs_f (

Line 200: msc_phub_util.log('insert into msc_st_costs_f:facility_cost: '||sql%rowcount);

196: mbod.sr_instance_id,
197: mbod.organization_id,
198: d.mfg_week_end_date;
199:
200: msc_phub_util.log('insert into msc_st_costs_f:facility_cost: '||sql%rowcount);
201: commit;
202:
203: if (l_enable_scrm not in (2) and l_plan_type not in (5)) then
204: -- msc_st_costs_f:source_count

Line 294: msc_phub_util.log('insert into msc_st_costs_f:source_count: '||sql%rowcount);

290: where d.calendar_date between l_plan_start_date and l_plan_cutoff_date
291: and d.calendar_date in (d.mfg_week_end_date, l_plan_cutoff_date)
292: and d.calendar_date between nvl(f.effective_date, l_plan_start_date) and nvl(f.disable_date, l_plan_cutoff_date);
293:
294: msc_phub_util.log('insert into msc_st_costs_f:source_count: '||sql%rowcount);
295: commit;
296: end if;
297:
298: -- msc_st_costs_f:RP

Line 401: msc_phub_util.log('insert into msc_st_costs_f:RP: '||sql%rowcount);

397: nvl(mrk.supplier_id, -23453),
398: nvl(mrk.supplier_site_id, -23453),
399: d.mfg_week_end_date;
400:
401: msc_phub_util.log('insert into msc_st_costs_f:RP: '||sql%rowcount);
402: commit;
403:
404: -- msc_costs_f:final
405: msc_phub_util.unusuable_local_index('MSC_COSTS_F', p_plan_run_id, 1);

Line 405: msc_phub_util.unusuable_local_index('MSC_COSTS_F', p_plan_run_id, 1);

401: msc_phub_util.log('insert into msc_st_costs_f:RP: '||sql%rowcount);
402: commit;
403:
404: -- msc_costs_f:final
405: msc_phub_util.unusuable_local_index('MSC_COSTS_F', p_plan_run_id, 1);
406: insert into msc_costs_f (
407: plan_id,
408: plan_run_id,
409: io_plan_flag,

Line 576: msc_phub_util.log('insert into msc_costs_f:final: '||sql%rowcount);

572: where f.currency_code=mcc.from_currency(+)
573: and fnd_profile.value('MSC_HUB_CUR_CODE_RPT')=mcc.to_currency(+)
574: and f.detail_date=mcc.calendar_date(+);
575:
576: msc_phub_util.log('insert into msc_costs_f:final: '||sql%rowcount);
577: commit;
578: msc_phub_util.unusuable_local_index('MSC_COSTS_F', p_plan_run_id, 2);
579: msc_phub_util.gather_table_stats(msc_phub_util.stats_fact, 'MSC_COSTS_F', p_plan_run_id);
580:

Line 578: msc_phub_util.unusuable_local_index('MSC_COSTS_F', p_plan_run_id, 2);

574: and f.detail_date=mcc.calendar_date(+);
575:
576: msc_phub_util.log('insert into msc_costs_f:final: '||sql%rowcount);
577: commit;
578: msc_phub_util.unusuable_local_index('MSC_COSTS_F', p_plan_run_id, 2);
579: msc_phub_util.gather_table_stats(msc_phub_util.stats_fact, 'MSC_COSTS_F', p_plan_run_id);
580:
581: summarize_costs_f(errbuf, retcode, p_plan_id, p_plan_run_id);
582: l_complete_time := systimestamp;

Line 579: msc_phub_util.gather_table_stats(msc_phub_util.stats_fact, 'MSC_COSTS_F', p_plan_run_id);

575:
576: msc_phub_util.log('insert into msc_costs_f:final: '||sql%rowcount);
577: commit;
578: msc_phub_util.unusuable_local_index('MSC_COSTS_F', p_plan_run_id, 2);
579: msc_phub_util.gather_table_stats(msc_phub_util.stats_fact, 'MSC_COSTS_F', p_plan_run_id);
580:
581: summarize_costs_f(errbuf, retcode, p_plan_id, p_plan_run_id);
582: l_complete_time := systimestamp;
583: msc_phub_util.log('msc_phub_cost_pkg.populate_details.complete, duration='||(l_complete_time-l_start_time));

Line 583: msc_phub_util.log('msc_phub_cost_pkg.populate_details.complete, duration='||(l_complete_time-l_start_time));

579: msc_phub_util.gather_table_stats(msc_phub_util.stats_fact, 'MSC_COSTS_F', p_plan_run_id);
580:
581: summarize_costs_f(errbuf, retcode, p_plan_id, p_plan_run_id);
582: l_complete_time := systimestamp;
583: msc_phub_util.log('msc_phub_cost_pkg.populate_details.complete, duration='||(l_complete_time-l_start_time));
584:
585: exception
586: when others then
587: msc_phub_util.log('msc_phub_cost_pkg.populate_details: '||sqlerrm);

Line 587: msc_phub_util.log('msc_phub_cost_pkg.populate_details: '||sqlerrm);

583: msc_phub_util.log('msc_phub_cost_pkg.populate_details.complete, duration='||(l_complete_time-l_start_time));
584:
585: exception
586: when others then
587: msc_phub_util.log('msc_phub_cost_pkg.populate_details: '||sqlerrm);
588: raise;
589:
590: end populate_details;
591:

Line 598: msc_phub_util.log('msc_phub_cost_pkg.summarize_costs_f');

594: p_plan_id number, p_plan_run_id number)
595: is
596: l_category_set_id1 number := fnd_profile.value('MSC_HUB_CAT_SET_ID_1');
597: begin
598: msc_phub_util.log('msc_phub_cost_pkg.summarize_costs_f');
599: retcode := 0;
600: errbuf := '';
601:
602: delete from msc_costs_f

Line 604: msc_phub_util.log('msc_phub_cost_pkg.summarize_costs_f, delete='||sql%rowcount);

600: errbuf := '';
601:
602: delete from msc_costs_f
603: where plan_id=p_plan_id and plan_run_id=p_plan_run_id and aggr_type>0;
604: msc_phub_util.log('msc_phub_cost_pkg.summarize_costs_f, delete='||sql%rowcount);
605: commit;
606:
607: -- level 1
608: insert into msc_costs_f (

Line 712: msc_phub_util.log('msc_phub_cost_pkg.summarize_costs_f, level1='||sql%rowcount);

708: f.supplier_id, f.supplier_site_id,
709: f.io_plan_flag, f.ship_method, f.detail_date,
710: nvl(q.sr_category_id, -23453);
711:
712: msc_phub_util.log('msc_phub_cost_pkg.summarize_costs_f, level1='||sql%rowcount);
713: commit;
714:
715: exception
716: when others then

Line 729: l_suffix varchar2(32) := msc_phub_util.suffix(p_dblink);

725: p_st_transaction_id number, p_plan_run_id number,
726: p_dblink varchar2, p_source_version varchar2)
727: is
728: l_sql varchar2(5000);
729: l_suffix varchar2(32) := msc_phub_util.suffix(p_dblink);
730: l_apps_schema varchar2(30) := msc_phub_util.apps_schema;
731: begin
732: msc_phub_util.log('msc_phub_cost_pkg.export_costs_f');
733: retcode := 0;

Line 730: l_apps_schema varchar2(30) := msc_phub_util.apps_schema;

726: p_dblink varchar2, p_source_version varchar2)
727: is
728: l_sql varchar2(5000);
729: l_suffix varchar2(32) := msc_phub_util.suffix(p_dblink);
730: l_apps_schema varchar2(30) := msc_phub_util.apps_schema;
731: begin
732: msc_phub_util.log('msc_phub_cost_pkg.export_costs_f');
733: retcode := 0;
734: errbuf := null;

Line 732: msc_phub_util.log('msc_phub_cost_pkg.export_costs_f');

728: l_sql varchar2(5000);
729: l_suffix varchar2(32) := msc_phub_util.suffix(p_dblink);
730: l_apps_schema varchar2(30) := msc_phub_util.apps_schema;
731: begin
732: msc_phub_util.log('msc_phub_cost_pkg.export_costs_f');
733: retcode := 0;
734: errbuf := null;
735:
736: delete from msc_st_costs_f where st_transaction_id=p_st_transaction_id;

Line 958: msc_phub_util.log('msc_phub_cost_pkg.export_costs_f: complete, retcode='||retcode);

954: end if;
955:
956: execute immediate l_sql using p_st_transaction_id, p_plan_run_id;
957: commit;
958: msc_phub_util.log('msc_phub_cost_pkg.export_costs_f: complete, retcode='||retcode);
959:
960: exception
961: when others then
962: retcode := 2;

Line 964: msc_phub_util.log(errbuf);

960: exception
961: when others then
962: retcode := 2;
963: errbuf := 'msc_phub_cost_pkg.export_costs_f: '||sqlerrm;
964: msc_phub_util.log(errbuf);
965: end export_costs_f;
966:
967: procedure import_costs_f (
968: errbuf out nocopy varchar2, retcode out nocopy varchar2,

Line 977: msc_phub_util.log('msc_phub_cost_pkg.import_costs_f');

973: l_staging_table varchar2(30) := 'msc_st_costs_f';
974: l_fact_table varchar2(30) := 'msc_costs_f';
975: l_result number := 0;
976: begin
977: msc_phub_util.log('msc_phub_cost_pkg.import_costs_f');
978: retcode := 0;
979: errbuf := null;
980:
981: l_result := l_result + msc_phub_util.prepare_staging_dates(

Line 981: l_result := l_result + msc_phub_util.prepare_staging_dates(

977: msc_phub_util.log('msc_phub_cost_pkg.import_costs_f');
978: retcode := 0;
979: errbuf := null;
980:
981: l_result := l_result + msc_phub_util.prepare_staging_dates(
982: l_staging_table, 'detail_date', p_st_transaction_id,
983: p_upload_mode, p_overwrite_after_date,
984: p_plan_start_date, p_plan_cutoff_date);
985:

Line 986: l_result := l_result + msc_phub_util.prepare_fact_dates(

982: l_staging_table, 'detail_date', p_st_transaction_id,
983: p_upload_mode, p_overwrite_after_date,
984: p_plan_start_date, p_plan_cutoff_date);
985:
986: l_result := l_result + msc_phub_util.prepare_fact_dates(
987: l_fact_table, 1, 'detail_date', p_plan_id, p_plan_run_id,
988: p_upload_mode, p_overwrite_after_date);
989:
990: l_result := l_result + msc_phub_util.decode_organization_key(

Line 990: l_result := l_result + msc_phub_util.decode_organization_key(

986: l_result := l_result + msc_phub_util.prepare_fact_dates(
987: l_fact_table, 1, 'detail_date', p_plan_id, p_plan_run_id,
988: p_upload_mode, p_overwrite_after_date);
989:
990: l_result := l_result + msc_phub_util.decode_organization_key(
991: l_staging_table, p_st_transaction_id, p_def_instance_code,
992: 'owning_inst_id', 'owning_org_id', 'owning_org_code');
993:
994: l_result := l_result + msc_phub_util.decode_organization_key(

Line 994: l_result := l_result + msc_phub_util.decode_organization_key(

990: l_result := l_result + msc_phub_util.decode_organization_key(
991: l_staging_table, p_st_transaction_id, p_def_instance_code,
992: 'owning_inst_id', 'owning_org_id', 'owning_org_code');
993:
994: l_result := l_result + msc_phub_util.decode_organization_key(
995: l_staging_table, p_st_transaction_id, p_def_instance_code,
996: 'sr_instance_id', 'organization_id', 'organization_code');
997:
998: l_result := l_result + msc_phub_util.decode_organization_key(

Line 998: l_result := l_result + msc_phub_util.decode_organization_key(

994: l_result := l_result + msc_phub_util.decode_organization_key(
995: l_staging_table, p_st_transaction_id, p_def_instance_code,
996: 'sr_instance_id', 'organization_id', 'organization_code');
997:
998: l_result := l_result + msc_phub_util.decode_organization_key(
999: l_staging_table, p_st_transaction_id, p_def_instance_code,
1000: 'source_org_instance_id', 'source_organization_id', 'source_org_code');
1001:
1002: l_result := l_result + msc_phub_util.decode_item_key(

Line 1002: l_result := l_result + msc_phub_util.decode_item_key(

998: l_result := l_result + msc_phub_util.decode_organization_key(
999: l_staging_table, p_st_transaction_id, p_def_instance_code,
1000: 'source_org_instance_id', 'source_organization_id', 'source_org_code');
1001:
1002: l_result := l_result + msc_phub_util.decode_item_key(
1003: l_staging_table, p_st_transaction_id, 'inventory_item_id', 'item_name');
1004:
1005: l_result := l_result + msc_phub_util.decode_customer_key(
1006: l_staging_table, p_st_transaction_id,

Line 1005: l_result := l_result + msc_phub_util.decode_customer_key(

1001:
1002: l_result := l_result + msc_phub_util.decode_item_key(
1003: l_staging_table, p_st_transaction_id, 'inventory_item_id', 'item_name');
1004:
1005: l_result := l_result + msc_phub_util.decode_customer_key(
1006: l_staging_table, p_st_transaction_id,
1007: 'customer_id', 'customer_site_id', 'owning_inst_id', 'customer_region_id',
1008: 'customer_name', 'customer_site_code', 'customer_zone');
1009:

Line 1010: l_result := l_result + msc_phub_util.decode_supplier_key(

1006: l_staging_table, p_st_transaction_id,
1007: 'customer_id', 'customer_site_id', 'owning_inst_id', 'customer_region_id',
1008: 'customer_name', 'customer_site_code', 'customer_zone');
1009:
1010: l_result := l_result + msc_phub_util.decode_supplier_key(
1011: l_staging_table, p_st_transaction_id,
1012: 'supplier_id', 'supplier_site_id',
1013: 'supplier_name', 'supplier_site_code');
1014:

Line 1015: msc_phub_util.log('msc_phub_cost_pkg.import_costs_f: insert into msc_costs_f');

1011: l_staging_table, p_st_transaction_id,
1012: 'supplier_id', 'supplier_site_id',
1013: 'supplier_name', 'supplier_site_code');
1014:
1015: msc_phub_util.log('msc_phub_cost_pkg.import_costs_f: insert into msc_costs_f');
1016: insert into msc_costs_f (
1017: plan_id,
1018: plan_run_id,
1019: sr_instance_id,

Line 1116: msc_phub_util.log('msc_phub_cost_pkg.import_costs_f: inserted='||sql%rowcount);

1112: fnd_global.user_id, sysdate, fnd_global.login_id
1113: from msc_st_costs_f
1114: where st_transaction_id=p_st_transaction_id and error_code=0;
1115:
1116: msc_phub_util.log('msc_phub_cost_pkg.import_costs_f: inserted='||sql%rowcount);
1117: commit;
1118:
1119: summarize_costs_f(errbuf, retcode, p_plan_id, p_plan_run_id);
1120:

Line 1125: msc_phub_util.log('msc_phub_cost_pkg.import_costs_f: complete, retcode='||retcode);

1121: if (l_result > 0) then
1122: retcode := -1;
1123: end if;
1124:
1125: msc_phub_util.log('msc_phub_cost_pkg.import_costs_f: complete, retcode='||retcode);
1126:
1127: exception
1128: when others then
1129: retcode := 2;

Line 1131: msc_phub_util.log(errbuf);

1127: exception
1128: when others then
1129: retcode := 2;
1130: errbuf := 'msc_phub_cost_pkg.import_costs_f: '||sqlerrm;
1131: msc_phub_util.log(errbuf);
1132: end import_costs_f;
1133:
1134: procedure migrate
1135: is

Line 1153: msc_phub_util.log('msc_phub_cost_pkg.migrate');

1149: from msc_item_inventory_f f
1150: where not exists (select 1 from msc_costs_f where plan_run_id=f.plan_run_id)
1151: order by plan_run_id;
1152: begin
1153: msc_phub_util.log('msc_phub_cost_pkg.migrate');
1154:
1155: l_need_migrate := need_migrate;
1156: msc_phub_util.log('msc_phub_cost_pkg.migrate, l_need_migrate='||l_need_migrate);
1157: if (l_need_migrate <> 1) then

Line 1156: msc_phub_util.log('msc_phub_cost_pkg.migrate, l_need_migrate='||l_need_migrate);

1152: begin
1153: msc_phub_util.log('msc_phub_cost_pkg.migrate');
1154:
1155: l_need_migrate := need_migrate;
1156: msc_phub_util.log('msc_phub_cost_pkg.migrate, l_need_migrate='||l_need_migrate);
1157: if (l_need_migrate <> 1) then
1158: return;
1159: end if;
1160:

Line 1164: msc_phub_util.log('get_app_info(FND) failed');

1160:
1161:
1162: if (fnd_installation.get_app_info('FND',
1163: dummy1, dummy2, l_applsys_schema) = false) then
1164: msc_phub_util.log('get_app_info(FND) failed');
1165: raise e_migrate;
1166: end if;
1167:
1168: if (fnd_installation.get_app_info('MSC',

Line 1170: msc_phub_util.log('get_app_info(MSC) failed');

1166: end if;
1167:
1168: if (fnd_installation.get_app_info('MSC',
1169: dummy1, dummy2, l_msc_schema) = false) then
1170: msc_phub_util.log('get_app_info(MSC) failed');
1171: raise e_migrate;
1172: end if;
1173:
1174: for r in c2

Line 1187: --msc_phub_util.log(r.plan_run_id||','||l_next_id);

1183:
1184: execute immediate l_sql into l_next_id using 'MSC_COSTS_F', 'MSC_COSTS_F', r.plan_run_id;
1185:
1186:
1187: --msc_phub_util.log(r.plan_run_id||','||l_next_id);
1188: if (l_next_id=-1) then
1189: l_sql := 'alter table '||l_costs_f||
1190: ' add partition '||substr(l_costs_f, 5)||'_'||to_char(r.plan_run_id)||
1191: ' values less than ('||to_char(r.plan_run_id+1)||')';

Line 1195: --msc_phub_util.log(l_sql);

1191: ' values less than ('||to_char(r.plan_run_id+1)||')';
1192:
1193: ad_ddl.do_ddl(l_applsys_schema, l_msc_schema,
1194: ad_ddl.alter_table, l_sql, l_costs_f);
1195: --msc_phub_util.log(l_sql);
1196: end if;
1197:
1198: l_sql :=
1199: ' insert into msc_costs_f ('||

Line 1278: --msc_phub_util.log('insert: plan_run_id='||r.plan_run_id||', rowcount='||sql%rowcount);

1274: ' from msc_item_inventory_f'||
1275: ' where plan_run_id=:p_plan_run_id';
1276:
1277: execute immediate l_sql using r.plan_run_id;
1278: --msc_phub_util.log('insert: plan_run_id='||r.plan_run_id||', rowcount='||sql%rowcount);
1279: commit;
1280:
1281: if (l_next_id>r.plan_run_id) then
1282: l_sql := 'alter table '||l_costs_f||

Line 1290: --msc_phub_util.log(l_sql);

1286: ' partition '||substr(l_costs_f, 5)||'_'||to_char(l_next_id)||')';
1287:
1288: ad_ddl.do_ddl(l_applsys_schema, l_msc_schema,
1289: ad_ddl.alter_table, l_sql, l_costs_f);
1290: --msc_phub_util.log(l_sql);
1291: end if;
1292: end loop;
1293: msc_phub_util.log('msc_phub_cost_pkg.migrate complete');
1294:

Line 1293: msc_phub_util.log('msc_phub_cost_pkg.migrate complete');

1289: ad_ddl.alter_table, l_sql, l_costs_f);
1290: --msc_phub_util.log(l_sql);
1291: end if;
1292: end loop;
1293: msc_phub_util.log('msc_phub_cost_pkg.migrate complete');
1294:
1295: exception
1296: when others then
1297: msc_phub_util.log('msc_phub_cost_pkg.migrate.exception:'||sqlerrm);

Line 1297: msc_phub_util.log('msc_phub_cost_pkg.migrate.exception:'||sqlerrm);

1293: msc_phub_util.log('msc_phub_cost_pkg.migrate complete');
1294:
1295: exception
1296: when others then
1297: msc_phub_util.log('msc_phub_cost_pkg.migrate.exception:'||sqlerrm);
1298: raise;
1299: end migrate;
1300:
1301: function need_migrate return number