Search Results msc_x_security




Overview

MSC_X_SECURITY is a small but strategically important PL/SQL package owned by the APPS schema in Oracle E-Business Suite. It is classified under the ETRM (E-Business Suite Technical Reference Manual) as an "OTHER" API, meaning it is not a public published interface but an internal utility used by the Advanced Supply Chain Planning (ASCP) and related MSC-family modules. The package is declared with AUTHID CURRENT_USER, so its SQL statements execute under the privileges of the invoking user rather than the defining user.

The sole documented purpose of the package, as stated in its header comment, is to set session-level context variables accessible through SYS_CONTEXT('MSC', 'COMPANY_ID') and SYS_CONTEXT('MSC', 'COMPANY_NAME'). In effect, it establishes the planning "company" (planning entity) identity for the current database session, which downstream MSC security views and rules use to filter data by company. This supports multi-company planning environments where users should only see supply, demand, and plan data belonging to their authorized company.

Key Procedures and Functions

  • SET_CONTEXT — The only documented procedure in the package. Its purpose is to populate the MSC namespace session context, specifically the COMPANY_ID and COMPANY_NAME attributes used by ASCP security rules. The procedure resolves the appropriate company for the current user and issues the necessary DBMS_SESSION.SET_CONTEXT calls so that the context values are available to any subsequent SQL or PL/SQL executed in the same session. No public parameter list is documented, and callers should treat the procedure as taking its inputs implicitly from the session and the security-rule tables.

Tables Accessed

The ETRM metadata identifies the following objects, referenced through APPS synonyms, as being touched by this package:

  • MSC_COMPANIES — the master list of planning companies, used to validate and resolve company identifiers and names.
  • MSC_COMPANY_USERS — the association between application users and the companies they are permitted to view; central to determining which company context should be set for the current session.
  • MSC_X_SECURITY_RULES — the configurable security rule definitions that drive what data a user may access within planning; the package consults these to establish the correct context.
  • MSC_SUP_DEM_ENTRIES — supply/demand entries that are subject to security filtering based on the established company context.
  • DBMS_SESSION — the supplied Oracle package invoked to actually set the context attributes in the session.

The combination of these tables indicates the package both reads security configuration and writes session state, effectively bridging stored security rules and the runtime environment.

Usage Notes

Because it is an "OTHER"-classified, undocumented public API, MSC_X_SECURITY is not intended for direct invocation by customer extensions. It is invoked internally by MSC-family forms, concurrent programs, and related PL/SQL packages immediately after a session is established, so that subsequent planning queries inherit the correct company context. The ETRM records that it is referenced by one other package, confirming its role as a shared internal utility rather than a top-level entry point.

Custom code that needs company-scoped planning data should not call SET_CONTEXT directly; instead it should rely on the standard ASCP login flow to establish context, then read the values via SYS_CONTEXT('MSC', 'COMPANY_ID') or SYS_CONTEXT('MSC', 'COMPANY_NAME'). This preserves security semantics and avoids bypassing the security rules that the package is designed to honor. In both EBS 12.1.1 and 12.2.2 the package behavior is equivalent; the only differences stem from underlying MSC data model and schema changes between releases.