DBA Data[Home] [Help]

APPS.MSC_PHUB_COST_PKG dependencies on MSC_PHUB_COST_PKG

Line 1: package body msc_phub_cost_pkg as

1: package body msc_phub_cost_pkg as
2: /* $Header: MSCHBCTB.pls 120.37.12020000.2 2012/10/11 13:52:34 wexia ship $ */
3:
4: procedure populate_details(errbuf out nocopy varchar2, retcode out nocopy varchar2,
5: p_plan_id number, p_plan_run_id 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 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 718: errbuf := 'msc_phub_cost_pkg.summarize_costs_f: '||sqlerrm;

714:
715: exception
716: when others then
717: retcode := 2;
718: errbuf := 'msc_phub_cost_pkg.summarize_costs_f: '||sqlerrm;
719: raise;
720:
721: end summarize_costs_f;
722:

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 963: errbuf := 'msc_phub_cost_pkg.export_costs_f: '||sqlerrm;

959:
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 (

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 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 1130: errbuf := 'msc_phub_cost_pkg.import_costs_f: '||sqlerrm;

1126:
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

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 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

Line 1329: end msc_phub_cost_pkg;

1325: execute immediate l_sql into l_n2 using 'MSC_COSTS_F', 'COSTS_F_0';
1326: return (case when l_n1=1 and l_n2=0 then 1 else 0 end);
1327: end;
1328:
1329: end msc_phub_cost_pkg;