Search Results get_plan_run_date
Overview
MSC_SCN_UTILS is a utility package in the Oracle E-Business Suite Advanced Supply Chain Planning (ASCP) module, owned by the APPS schema and defined with AUTHID CURRENT_USER. It centralizes reusable helper logic that supports scenario management, planning run introspection, and concurrent request orchestration within the MSC (Supply Chain Planning) schema. The package exposes functions and procedures that retrieve descriptive names, versions, owners, and statuses for plans, scenarios, and processes, and it provides procedures for archiving and purging scenarios and plans. It also supplies parameter-population helpers used by activity and LOV-driven pages, and it underpins scenario creation, copy, and default parameter setup. As noted in the ETRM metadata, the package is referenced by zero other packages, meaning it is primarily consumed directly by forms, concurrent programs, and custom code rather than through internal package dependencies.
Key Procedures and Functions
The package exposes 21 documented routines, which cluster into several functional groups.
- Name and metadata lookups: GET_PLAN_NAME, GET_PROC_ACT_NAME, GET_OWNER_NAME, GET_SCENARIO_NAME, GET_SCENARIO_SET_NAME, GET_SCN_USERS, GET_SCN_VERSION, and GET_PLAN_VERSION return human-readable identifiers and version strings for plans, activities, owners, scenarios, scenario sets, assigned users, and scenario/plan runs.
- Status helpers: SCENARIO_STATUS, PLAN_STATUS, and GET_PROCESS_STATUS return status indicators for a scenario, a plan, and an internal process run sequence, respectively.
- Counting and summation: PLAN_SCNS_COUNT returns the number of scenario associations for a plan, while GET_ACTIVITY_SUMMARY accepts an IN OUT WHERE clause and an IN OUT activity summary string, applying filter and aggregate logic used by summary screens.
- Concurrent maintenance procedures: ARCHIVE_SCN_CONC, PURGE_SCN_CONC, and PURGE_PLAN_CONC are concurrent-program entry points that archive a scenario, purge a scenario, and purge all scenarios associated with a plan. Each returns errbuf and retcode for concurrent manager consumption.
- Parameter helpers: POPULATE_ACT_PARAMS_FOR_LOV, POPULATE_DEFAULT_PARAMS, and GET_PLAN_RUN_DATE support activity parameter lists of values, default parameter population, and plan run date retrieval.
- Scenario copy and creation: COPY_SCN_PLANS copies scenario plans from a source scenario to a destination scenario, and CREATE_SCENARIO is the primary entry point for constructing a new scenario, accepting errbuf and retcode for concurrent invocation.
Tables Accessed
The package reads and writes the following tables through APPS synonyms, reflecting its role in scenario and planning administration.
- Planning entities: MSC_PLANS, MSC_PLAN_RUNS, MSC_SCENARIOS, MSC_SCENARIO_PLANS, MSC_SCENARIO_SETS, MSC_SCENARIO_SET_DETAILS, and MSC_SCENARIO_USERS store plan definitions, run history, scenario definitions, plan-to-scenario mappings, scenario set membership, and user assignments.
- Planning activity configuration: MSC_PLANNING_PROC_ACTIVITIES, MSC_ACTIVITY_PARAMETERS, and MSC_FORM_QUERY support procedure activity lookup, activity parameter defaults, and form query text assembly.
- Scenario revision tracking: MSC_SCN_SCENARIOS_S and MSD_DP_SCENARIO_REVISIONS record scenario revision history and duplicate-planning scenario revisions.
- Concurrent processing and security: FND_CONCURRENT_REQUESTS supplies concurrent request context, and FND_USER resolves user/owner identities. DUAL is used for singleton scalar evaluations.
Usage Notes
MSC_SCN_UTILS is typically invoked in three contexts. First, ASCP planning forms and OAF pages call its lookup functions to render scenario names, plan names, owners, versions, statuses, and user lists on scenario and plan administration screens. Second, its concurrent entry points, ARCHIVE_SCN_CONC, PURGE_SCN_CONC, PURGE_PLAN_CONC, and CREATE_SCENARIO, are registered as concurrent programs and run under the concurrent manager, receiving errbuf and retcode to report success or failure. Third, custom extensions and diagnostics invoke the parameter helpers, POPULATE_ACT_PARAMS_FOR_LOV and POPULATE_DEFAULT_PARAMS, when building activity parameter LOVs or defaulting values. Because the package is declared AUTHID CURRENT_USER, privileges are evaluated against the calling user, so it should be referenced from schemas with appropriate grants on the underlying MSC tables. The presence of create_scenario in the search metadata indicates that users investigating scenario creation will find this package as the principal PL/SQL entry point for building scenarios programmatically or through concurrent submission.