503: msc_phub_util.log('msc_phub_file_pkg.prepare_context: l_include_ods');
504: return;
505: else
506: retcode := 2;
507: fnd_message.set_name('MSC', 'MSC_APCC_MISSING_PLAN_INFO');
508: errbuf := fnd_message.get;
509: raise e_prepare_context;
510: end if;
511: end if;
504: return;
505: else
506: retcode := 2;
507: fnd_message.set_name('MSC', 'MSC_APCC_MISSING_PLAN_INFO');
508: errbuf := fnd_message.get;
509: raise e_prepare_context;
510: end if;
511: end if;
512:
529: ||'l_plan_run_id='||l_plan_run_id);
530: if (l_plan_run_id is not null) then
531: if (l_plan_type2 <> l_pi.plan_type) then
532: retcode := 1;
533: fnd_message.set_name('MSC', 'MSC_APCC_PLAN_INFO_E03');
534: fnd_message.set_token('PLAN', l_pi.plan_name);
535: fnd_message.set_token('PLAN_TYPE', msc_phub_pkg.get_plan_type_meaning(l_plan_type2));
536: errbuf := fnd_message.get;
537: raise e_prepare_context;
530: if (l_plan_run_id is not null) then
531: if (l_plan_type2 <> l_pi.plan_type) then
532: retcode := 1;
533: fnd_message.set_name('MSC', 'MSC_APCC_PLAN_INFO_E03');
534: fnd_message.set_token('PLAN', l_pi.plan_name);
535: fnd_message.set_token('PLAN_TYPE', msc_phub_pkg.get_plan_type_meaning(l_plan_type2));
536: errbuf := fnd_message.get;
537: raise e_prepare_context;
538: end if;
531: if (l_plan_type2 <> l_pi.plan_type) then
532: retcode := 1;
533: fnd_message.set_name('MSC', 'MSC_APCC_PLAN_INFO_E03');
534: fnd_message.set_token('PLAN', l_pi.plan_name);
535: fnd_message.set_token('PLAN_TYPE', msc_phub_pkg.get_plan_type_meaning(l_plan_type2));
536: errbuf := fnd_message.get;
537: raise e_prepare_context;
538: end if;
539:
532: retcode := 1;
533: fnd_message.set_name('MSC', 'MSC_APCC_PLAN_INFO_E03');
534: fnd_message.set_token('PLAN', l_pi.plan_name);
535: fnd_message.set_token('PLAN_TYPE', msc_phub_pkg.get_plan_type_meaning(l_plan_type2));
536: errbuf := fnd_message.get;
537: raise e_prepare_context;
538: end if;
539:
540: if (l_local_archive_flag <> 2) then
538: end if;
539:
540: if (l_local_archive_flag <> 2) then
541: retcode := 2;
542: fnd_message.set_name('MSC', 'MSC_APCC_PLAN_INFO_E02');
543: fnd_message.set_token('PLAN', l_pi.plan_name);
544: errbuf := fnd_message.get;
545: raise e_prepare_context;
546: end if;
539:
540: if (l_local_archive_flag <> 2) then
541: retcode := 2;
542: fnd_message.set_name('MSC', 'MSC_APCC_PLAN_INFO_E02');
543: fnd_message.set_token('PLAN', l_pi.plan_name);
544: errbuf := fnd_message.get;
545: raise e_prepare_context;
546: end if;
547:
540: if (l_local_archive_flag <> 2) then
541: retcode := 2;
542: fnd_message.set_name('MSC', 'MSC_APCC_PLAN_INFO_E02');
543: fnd_message.set_token('PLAN', l_pi.plan_name);
544: errbuf := fnd_message.get;
545: raise e_prepare_context;
546: end if;
547:
548: if (nvl(p_validate_only, msc_phub_pkg.sys_yes) = msc_phub_pkg.sys_yes) then
601:
602: if (l_pi.plan_id is not null) then
603: if (l_plan_type2 <> l_pi.plan_type) then
604: retcode := 1;
605: fnd_message.set_name('MSC', 'MSC_APCC_PLAN_INFO_E03');
606: fnd_message.set_token('PLAN', l_pi.plan_name);
607: fnd_message.set_token('PLAN_TYPE', msc_phub_pkg.get_plan_type_meaning(l_plan_type2));
608: errbuf := fnd_message.get;
609: raise e_prepare_context;
602: if (l_pi.plan_id is not null) then
603: if (l_plan_type2 <> l_pi.plan_type) then
604: retcode := 1;
605: fnd_message.set_name('MSC', 'MSC_APCC_PLAN_INFO_E03');
606: fnd_message.set_token('PLAN', l_pi.plan_name);
607: fnd_message.set_token('PLAN_TYPE', msc_phub_pkg.get_plan_type_meaning(l_plan_type2));
608: errbuf := fnd_message.get;
609: raise e_prepare_context;
610: end if;
603: if (l_plan_type2 <> l_pi.plan_type) then
604: retcode := 1;
605: fnd_message.set_name('MSC', 'MSC_APCC_PLAN_INFO_E03');
606: fnd_message.set_token('PLAN', l_pi.plan_name);
607: fnd_message.set_token('PLAN_TYPE', msc_phub_pkg.get_plan_type_meaning(l_plan_type2));
608: errbuf := fnd_message.get;
609: raise e_prepare_context;
610: end if;
611:
604: retcode := 1;
605: fnd_message.set_name('MSC', 'MSC_APCC_PLAN_INFO_E03');
606: fnd_message.set_token('PLAN', l_pi.plan_name);
607: fnd_message.set_token('PLAN_TYPE', msc_phub_pkg.get_plan_type_meaning(l_plan_type2));
608: errbuf := fnd_message.get;
609: raise e_prepare_context;
610: end if;
611:
612: select count(*) into n
617: and p.organization_id=d.organization_id;
618:
619: if (n > 0) then
620: retcode := 2;
621: fnd_message.set_name('MSC', 'MSC_APCC_PLAN_INFO_E02');
622: fnd_message.set_token('PLAN', l_pi.plan_name);
623: errbuf := fnd_message.get;
624: raise e_prepare_context;
625: end if;
618:
619: if (n > 0) then
620: retcode := 2;
621: fnd_message.set_name('MSC', 'MSC_APCC_PLAN_INFO_E02');
622: fnd_message.set_token('PLAN', l_pi.plan_name);
623: errbuf := fnd_message.get;
624: raise e_prepare_context;
625: end if;
626: end if;
619: if (n > 0) then
620: retcode := 2;
621: fnd_message.set_name('MSC', 'MSC_APCC_PLAN_INFO_E02');
622: fnd_message.set_token('PLAN', l_pi.plan_name);
623: errbuf := fnd_message.get;
624: raise e_prepare_context;
625: end if;
626: end if;
627:
641: where transfer_id=p_transfer_id;
642: commit;
643: else
644: retcode := 2;
645: fnd_message.set_name('MSC', 'MSC_APCC_UPLOAD_MODE_E01');
646: fnd_message.set_token('PLAN', l_pi.plan_name);
647: errbuf := fnd_message.get;
648: msc_phub_util.log(errbuf);
649: return;
642: commit;
643: else
644: retcode := 2;
645: fnd_message.set_name('MSC', 'MSC_APCC_UPLOAD_MODE_E01');
646: fnd_message.set_token('PLAN', l_pi.plan_name);
647: errbuf := fnd_message.get;
648: msc_phub_util.log(errbuf);
649: return;
650: end if;
643: else
644: retcode := 2;
645: fnd_message.set_name('MSC', 'MSC_APCC_UPLOAD_MODE_E01');
646: fnd_message.set_token('PLAN', l_pi.plan_name);
647: errbuf := fnd_message.get;
648: msc_phub_util.log(errbuf);
649: return;
650: end if;
651: end if;
729: l_upload_mode <> msc_phub_util.upload_replace and
730: l_upload_mode <> msc_phub_util.upload_create and
731: l_upload_mode <> msc_phub_util.upload_create_purge_prev) then
732: retcode := 2;
733: fnd_message.set_name('MSC', 'MSC_APCC_MISSING_PARAMETER');
734: fnd_message.set_token('PARAM', 'Upload Mode');
735: errbuf := fnd_message.get;
736: raise e_import_table;
737: end if;
730: l_upload_mode <> msc_phub_util.upload_create and
731: l_upload_mode <> msc_phub_util.upload_create_purge_prev) then
732: retcode := 2;
733: fnd_message.set_name('MSC', 'MSC_APCC_MISSING_PARAMETER');
734: fnd_message.set_token('PARAM', 'Upload Mode');
735: errbuf := fnd_message.get;
736: raise e_import_table;
737: end if;
738:
731: l_upload_mode <> msc_phub_util.upload_create_purge_prev) then
732: retcode := 2;
733: fnd_message.set_name('MSC', 'MSC_APCC_MISSING_PARAMETER');
734: fnd_message.set_token('PARAM', 'Upload Mode');
735: errbuf := fnd_message.get;
736: raise e_import_table;
737: end if;
738:
739: l_package := l_meta_info(p_fact_type).package_name;
888: from msc_apcc_upload
889: where transfer_status=status_purging;
890:
891: begin
892: msc_phub_util.log(fnd_message.get_string('MSC','MSC_HUB_PURGE_STARTS'));
893: msc_phub_util.log('msc_phub_file_pkg.purge_plan_summary('||p_plan_name||','||p_plan_run_id||')');
894: retcode := 0;
895: errbuf := null;
896:
922: delete from msc_apcc_upload where transfer_status=status_purging;
923: commit;
924:
925: msc_phub_pkg.purge_details(p_plan_name, p_plan_run_id);
926: msc_phub_util.log(fnd_message.get_string('MSC','MSC_HUB_PURGE_ENDS'));
927:
928: exception
929: when others then
930: fnd_message.set_name('MSC', 'MSC_HUB_PURGE_ERROR');
926: msc_phub_util.log(fnd_message.get_string('MSC','MSC_HUB_PURGE_ENDS'));
927:
928: exception
929: when others then
930: fnd_message.set_name('MSC', 'MSC_HUB_PURGE_ERROR');
931: retcode := 2;
932: errbuf := fnd_message.get;
933: msc_phub_util.log(errbuf);
934: end purge_plan_summary;
928: exception
929: when others then
930: fnd_message.set_name('MSC', 'MSC_HUB_PURGE_ERROR');
931: retcode := 2;
932: errbuf := fnd_message.get;
933: msc_phub_util.log(errbuf);
934: end purge_plan_summary;
935:
936: end msc_phub_file_pkg;