DBA Data[Home] [Help]

APPS.MSC_SUPPLY_PKG dependencies on MSC_SUPPLY_PKG

Line 1: package body msc_supply_pkg as

1: package body msc_supply_pkg as
2: /* $Header: MSCHBSUB.pls 120.69.12020000.2 2012/10/11 14:01:48 wexia ship $ */
3:
4:
5: function implement_code (p_source_org_id in number,

Line 45: msc_phub_util.log('msc_supply_pkg.populate_details');

41: l_owning_currency_code varchar2(20) := msc_phub_util.get_owning_currency_code(p_plan_run_id);
42: l_start_time timestamp := systimestamp;
43: begin
44:
45: msc_phub_util.log('msc_supply_pkg.populate_details');
46: retcode :=0; -- this means successfully
47: errbuf :='';
48:
49: -- ODS plan

Line 102: msc_phub_util.log('msc_supply_pkg.populate_details: '||

98: l_pegging_granularity := nvl(fnd_profile.value('MSC_APCC_END_ITEM_ENABLED'), 2);
99: end if;
100:
101:
102: msc_phub_util.log('msc_supply_pkg.populate_details: '||
103: p_plan_id||','||p_plan_run_id||','||l_plan_type||','||
104: l_sr_instance_id||','||l_plan_start_date||','||l_plan_cutoff_date||','||
105: l_refresh_mode||','||l_item_rn_qid||','||l_pegging_granularity);
106:

Line 584: msc_phub_util.log('msc_supply_pkg.populate_details.complete, duration='||(systimestamp-l_start_time));

580: if (l_rowcount2 > 0) then
581: summarize_item_wips_f(errbuf, retcode, p_plan_id, p_plan_run_id);
582: end if;
583:
584: msc_phub_util.log('msc_supply_pkg.populate_details.complete, duration='||(systimestamp-l_start_time));
585:
586: exception
587: when no_data_found then
588: retcode :=2;

Line 590: msc_phub_util.log('msc_supply_pkg.populate_details.exception: '||errbuf);

586: exception
587: when no_data_found then
588: retcode :=2;
589: errbuf := msc_phub_util.get_planning_hub_message('MSC_HUB_DUPLICATE_DATA')||SQLCODE||' -ERROR- '||sqlerrm;
590: msc_phub_util.log('msc_supply_pkg.populate_details.exception: '||errbuf);
591:
592:
593: when dup_val_on_index then
594: retcode :=2;

Line 596: msc_phub_util.log('msc_supply_pkg.populate_details.exception: '||errbuf);

592:
593: when dup_val_on_index then
594: retcode :=2;
595: errbuf := msc_phub_util.get_planning_hub_message('MSC_HUB_DUPLICATE_DATA')||SQLCODE||' -ERROR- '||sqlerrm;
596: msc_phub_util.log('msc_supply_pkg.populate_details.exception: '||errbuf);
597:
598: when others then
599: retcode :=2;
600: errbuf := msc_phub_util.get_planning_hub_message('MSC_HUB_POPULATE_ERROR')||SQLCODE||' -ERROR- '||sqlerrm;

Line 601: msc_phub_util.log('msc_supply_pkg.populate_details.exception: '||errbuf);

597:
598: when others then
599: retcode :=2;
600: errbuf := msc_phub_util.get_planning_hub_message('MSC_HUB_POPULATE_ERROR')||SQLCODE||' -ERROR- '||sqlerrm;
601: msc_phub_util.log('msc_supply_pkg.populate_details.exception: '||errbuf);
602:
603:
604: end populate_details;
605:

Line 612: msc_phub_util.log('msc_supply_pkg.summarize_supplies_f');

608: p_plan_id number, p_plan_run_id number)
609: is
610: l_category_set_id1 number := fnd_profile.value('MSC_HUB_CAT_SET_ID_1');
611: begin
612: msc_phub_util.log('msc_supply_pkg.summarize_supplies_f');
613: retcode := 0;
614: errbuf := '';
615:
616: delete from msc_supplies_f

Line 618: msc_phub_util.log('msc_supply_pkg.summarize_supplies_f, delete='||sql%rowcount);

614: errbuf := '';
615:
616: delete from msc_supplies_f
617: where plan_id=p_plan_id and plan_run_id=p_plan_run_id and aggr_type>0;
618: msc_phub_util.log('msc_supply_pkg.summarize_supplies_f, delete='||sql%rowcount);
619: commit;
620:
621: -- level 1
622: insert into msc_supplies_f (

Line 735: msc_phub_util.log('msc_supply_pkg.summarize_supplies_f, level1='||sql%rowcount);

731: nvl(ic2.sr_category_id, -23453),
732: nvl(ic3.sr_category_id, -23453),
733: f.supply_type, f.vmi_flag;
734:
735: msc_phub_util.log('msc_supply_pkg.summarize_supplies_f, level1='||sql%rowcount);
736: commit;
737:
738: -- level 2
739: insert into msc_supplies_f (

Line 908: msc_phub_util.log('msc_supply_pkg.summarize_supplies_f, level2='||sql%rowcount);

904: f.end_item_cat_id,
905: f.parent_model_cat_id,
906: f.supply_type, f.vmi_flag;
907:
908: msc_phub_util.log('msc_supply_pkg.summarize_supplies_f, level2='||sql%rowcount);
909: commit;
910:
911: exception
912: when others then

Line 914: errbuf := 'msc_supply_pkg.summarize_supplies_f: '||sqlerrm;

910:
911: exception
912: when others then
913: retcode := 2;
914: errbuf := 'msc_supply_pkg.summarize_supplies_f: '||sqlerrm;
915: raise;
916: end summarize_supplies_f;
917:
918: procedure summarize_item_wips_f(errbuf out nocopy varchar2, retcode out nocopy varchar2,

Line 923: msc_phub_util.log('msc_supply_pkg.summarize_item_wips_f');

919: p_plan_id number, p_plan_run_id number)
920: is
921: l_category_set_id1 number := fnd_profile.value('MSC_HUB_CAT_SET_ID_1');
922: begin
923: msc_phub_util.log('msc_supply_pkg.summarize_item_wips_f');
924: retcode := 0;
925: errbuf := '';
926:
927: delete from msc_item_wips_f

Line 929: msc_phub_util.log('msc_supply_pkg.summarize_item_wips_f, delete='||sql%rowcount);

925: errbuf := '';
926:
927: delete from msc_item_wips_f
928: where plan_id=p_plan_id and plan_run_id=p_plan_run_id and aggr_type>0;
929: msc_phub_util.log('msc_supply_pkg.summarize_item_wips_f, delete='||sql%rowcount);
930: commit;
931:
932: -- level 1
933: insert into msc_item_wips_f (

Line 972: msc_phub_util.log('msc_supply_pkg.summarize_item_wips_f, level1='||sql%rowcount);

968: f.sr_instance_id, f.organization_id,
969: f.vmi_flag, f.wip_start_date,
970: nvl(q.sr_category_id, -23453);
971:
972: msc_phub_util.log('msc_supply_pkg.summarize_item_wips_f, level1='||sql%rowcount);
973: commit;
974:
975: -- level 2
976: insert into msc_item_wips_f (

Line 1042: msc_phub_util.log('msc_supply_pkg.summarize_item_wips_f, level2='||sql%rowcount);

1038: d.fis_period_start_date,
1039: decode(f.aggr_type, 42, 1019, 43, 1020, 1021),
1040: f.category_set_id, f.sr_category_id;
1041:
1042: msc_phub_util.log('msc_supply_pkg.summarize_item_wips_f, level2='||sql%rowcount);
1043: commit;
1044:
1045: exception
1046: when others then

Line 1048: errbuf := 'msc_supply_pkg.summarize_item_wips_f: '||sqlerrm;

1044:
1045: exception
1046: when others then
1047: retcode := 2;
1048: errbuf := 'msc_supply_pkg.summarize_item_wips_f: '||sqlerrm;
1049: raise;
1050: end summarize_item_wips_f;
1051:
1052: procedure export_supplies_f (

Line 1061: msc_phub_util.log('msc_supply_pkg.export_supplies_f');

1057: l_sql varchar2(5000);
1058: l_suffix varchar2(32) := msc_phub_util.suffix(p_dblink);
1059: l_apps_schema varchar2(30) := msc_phub_util.apps_schema;
1060: begin
1061: msc_phub_util.log('msc_supply_pkg.export_supplies_f');
1062: retcode := 0;
1063: errbuf := null;
1064:
1065: delete from msc_st_supplies_f where st_transaction_id=p_st_transaction_id;

Line 1262: msc_phub_util.log('msc_supply_pkg.export_supplies_f: inserted='||sql%rowcount);

1258: ' and proj.sr_instance_id(+)=f.sr_instance_id'||
1259: ' and proj.organization_id(+)=f.organization_id';
1260:
1261: execute immediate l_sql using p_st_transaction_id, p_plan_run_id;
1262: msc_phub_util.log('msc_supply_pkg.export_supplies_f: inserted='||sql%rowcount);
1263: commit;
1264: msc_phub_util.log('msc_supply_pkg.export_supplies_f: complete, retcode='||retcode);
1265:
1266: exception

Line 1264: msc_phub_util.log('msc_supply_pkg.export_supplies_f: complete, retcode='||retcode);

1260:
1261: execute immediate l_sql using p_st_transaction_id, p_plan_run_id;
1262: msc_phub_util.log('msc_supply_pkg.export_supplies_f: inserted='||sql%rowcount);
1263: commit;
1264: msc_phub_util.log('msc_supply_pkg.export_supplies_f: complete, retcode='||retcode);
1265:
1266: exception
1267: when others then
1268: retcode := 2;

Line 1269: errbuf := 'msc_supply_pkg.export_supplies_f: '||sqlerrm;

1265:
1266: exception
1267: when others then
1268: retcode := 2;
1269: errbuf := 'msc_supply_pkg.export_supplies_f: '||sqlerrm;
1270: msc_phub_util.log(errbuf);
1271: end export_supplies_f;
1272:
1273: procedure export_item_wips_f (

Line 1282: msc_phub_util.log('msc_supply_pkg.export_item_wips_f');

1278: l_sql varchar2(5000);
1279: l_suffix varchar2(32) := msc_phub_util.suffix(p_dblink);
1280: l_apps_schema varchar2(30) := msc_phub_util.apps_schema;
1281: begin
1282: msc_phub_util.log('msc_supply_pkg.export_item_wips_f');
1283: retcode := 0;
1284: errbuf := null;
1285:
1286: delete from msc_st_item_wips_f where st_transaction_id=p_st_transaction_id;

Line 1329: msc_phub_util.log('msc_supply_pkg.export_item_wips_f: inserted='||sql%rowcount);

1325: ' and mtp.sr_tp_id(+)=f.organization_id'||
1326: ' and mi.inventory_item_id(+)=f.inventory_item_id';
1327:
1328: execute immediate l_sql using p_st_transaction_id, p_plan_run_id;
1329: msc_phub_util.log('msc_supply_pkg.export_item_wips_f: inserted='||sql%rowcount);
1330: commit;
1331: msc_phub_util.log('msc_supply_pkg.export_item_wips_f: complete, retcode='||retcode);
1332:
1333: exception

Line 1331: msc_phub_util.log('msc_supply_pkg.export_item_wips_f: complete, retcode='||retcode);

1327:
1328: execute immediate l_sql using p_st_transaction_id, p_plan_run_id;
1329: msc_phub_util.log('msc_supply_pkg.export_item_wips_f: inserted='||sql%rowcount);
1330: commit;
1331: msc_phub_util.log('msc_supply_pkg.export_item_wips_f: complete, retcode='||retcode);
1332:
1333: exception
1334: when others then
1335: retcode := 2;

Line 1336: errbuf := 'msc_supply_pkg.export_item_wips_f: '||sqlerrm;

1332:
1333: exception
1334: when others then
1335: retcode := 2;
1336: errbuf := 'msc_supply_pkg.export_item_wips_f: '||sqlerrm;
1337: msc_phub_util.log(errbuf);
1338: end export_item_wips_f;
1339:
1340: procedure import_supplies_f (

Line 1350: msc_phub_util.log('msc_supply_pkg.import_supplies_f');

1346: l_staging_table varchar2(30) := 'msc_st_supplies_f';
1347: l_fact_table varchar2(30) := 'msc_supplies_f';
1348: l_result number := 0;
1349: begin
1350: msc_phub_util.log('msc_supply_pkg.import_supplies_f');
1351: retcode := 0;
1352: errbuf := null;
1353:
1354: l_result := l_result + msc_phub_util.prepare_staging_dates(

Line 1401: msc_phub_util.log('msc_supply_pkg.import_supplies_f: insert into msc_supplies_f');

1397:
1398: l_result := l_result + msc_phub_util.decode_item_key(
1399: l_staging_table, p_st_transaction_id, 'parent_model_item_id', 'parent_model_item_name');
1400:
1401: msc_phub_util.log('msc_supply_pkg.import_supplies_f: insert into msc_supplies_f');
1402: insert into msc_supplies_f (
1403: plan_id,
1404: plan_run_id,
1405: sr_instance_id,

Line 1502: msc_phub_util.log('msc_supply_pkg.import_supplies_f: inserted='||sql%rowcount);

1498: fnd_global.user_id, sysdate, fnd_global.login_id
1499: from msc_st_supplies_f
1500: where st_transaction_id=p_st_transaction_id and error_code=0;
1501:
1502: msc_phub_util.log('msc_supply_pkg.import_supplies_f: inserted='||sql%rowcount);
1503: commit;
1504:
1505: summarize_supplies_f(errbuf, retcode, p_plan_id, p_plan_run_id);
1506:

Line 1511: msc_phub_util.log('msc_supply_pkg.import_supplies_f: complete, retcode='||retcode);

1507: if (l_result > 0) then
1508: retcode := -1;
1509: end if;
1510:
1511: msc_phub_util.log('msc_supply_pkg.import_supplies_f: complete, retcode='||retcode);
1512:
1513: exception
1514: when others then
1515: retcode := 2;

Line 1516: errbuf := 'msc_supply_pkg.import_supplies_f: '||sqlerrm;

1512:
1513: exception
1514: when others then
1515: retcode := 2;
1516: errbuf := 'msc_supply_pkg.import_supplies_f: '||sqlerrm;
1517: raise;
1518: end import_supplies_f;
1519:
1520: procedure import_item_wips_f (

Line 1530: msc_phub_util.log('msc_supply_pkg.import_item_wips_f');

1526: l_staging_table varchar2(30) := 'msc_st_item_wips_f';
1527: l_fact_table varchar2(30) := 'msc_item_wips_f';
1528: l_result number := 0;
1529: begin
1530: msc_phub_util.log('msc_supply_pkg.import_item_wips_f');
1531: retcode := 0;
1532: errbuf := null;
1533:
1534: l_result := l_result + msc_phub_util.prepare_staging_dates(

Line 1550: msc_phub_util.log('msc_supply_pkg.import_item_wips_f: insert into msc_item_wips_f');

1546:
1547: l_result := l_result + msc_phub_util.decode_item_key(
1548: l_staging_table, p_st_transaction_id, 'inventory_item_id', 'item_name');
1549:
1550: msc_phub_util.log('msc_supply_pkg.import_item_wips_f: insert into msc_item_wips_f');
1551: insert into msc_item_wips_f (
1552: plan_id,
1553: plan_run_id,
1554: sr_instance_id,

Line 1579: msc_phub_util.log('msc_supply_pkg.import_item_wips_f: inserted='||sql%rowcount);

1575: fnd_global.user_id, sysdate, fnd_global.login_id
1576: from msc_st_item_wips_f
1577: where st_transaction_id=p_st_transaction_id and error_code=0;
1578:
1579: msc_phub_util.log('msc_supply_pkg.import_item_wips_f: inserted='||sql%rowcount);
1580: commit;
1581:
1582: summarize_item_wips_f(errbuf, retcode, p_plan_id, p_plan_run_id);
1583:

Line 1588: msc_phub_util.log('msc_supply_pkg.import_item_wips_f: complete, retcode='||retcode);

1584: if (l_result > 0) then
1585: retcode := -1;
1586: end if;
1587:
1588: msc_phub_util.log('msc_supply_pkg.import_item_wips_f: complete, retcode='||retcode);
1589:
1590: exception
1591: when others then
1592: retcode := 2;

Line 1593: errbuf := 'msc_supply_pkg.import_item_wips_f: '||sqlerrm;

1589:
1590: exception
1591: when others then
1592: retcode := 2;
1593: errbuf := 'msc_supply_pkg.import_item_wips_f: '||sqlerrm;
1594: raise;
1595: end import_item_wips_f;
1596:
1597: end msc_supply_pkg;

Line 1597: end msc_supply_pkg;

1593: errbuf := 'msc_supply_pkg.import_item_wips_f: '||sqlerrm;
1594: raise;
1595: end import_item_wips_f;
1596:
1597: end msc_supply_pkg;