Search Results copy_structure




Overview

PA_COPY_STRUCTURE_PKG is a PL/SQL package body owned by the APPS schema in Oracle E-Business Suite, classified in the ETRM repository under the API classification OTHER. Its business function is to duplicate cost structure definitions within Oracle Projects. A cost structure in Oracle Projects pairs a cost base with the cost codes and expenditure types that are valid for that base, forming the foundation for burdening, costing, and cost-plus processing. Rather than requiring a consultant or administrator to re-key these definitions manually when a new structure is needed, PA_COPY_STRUCTURE_PKG provides a programmatic copy routine that reads an existing structure's configuration and writes an equivalent new configuration. The package is documented as VALID and depends on FND_GLOBAL, PA_COST_BASE_COST_CODES, PA_COST_BASE_COST_CODES_S, PA_COST_BASE_EXP_TYPES, PA_COST_PLUS_STRUCTURES, DUAL, and STANDARD. The presence of PA_COST_PLUS_STRUCTURES among its dependencies indicates the copy operation extends to cost-plus structure definitions as well as base cost code assignments. The package is not referenced by any other database object, so it functions as a top-level utility rather than as a component of a larger internal call chain.

Key Procedures and Functions

The ETRM metadata documents three procedures or functions within the package body:

  • CHECK_STRUCTURE — Validates a cost structure definition before or during the copy operation. This routine is used to confirm that the source or target structure satisfies the structural rules enforced by Oracle Projects, such as the presence of a valid cost base and consistent cost code assignments.
  • CHECK_EXISTENCE — Determines whether a given structure, cost code assignment, or expenditure type mapping already exists. This guards the copy process against duplicate inserts and allows callers to detect collisions before committing changes.
  • COPY_STRUCTURE — Performs the actual duplication. It reads the source structure's rows from the cost base, cost code, expenditure type, and cost-plus structure tables, and inserts the corresponding rows for the new structure, typically assigning a new structure identifier.

The documented metadata does not expose parameter lists for these routines; callers should obtain signature details from the package specification in the target instance rather than assuming argument order or datatypes.

Tables Accessed

The package references four application tables through APPS synonyms:

  • PA_COST_BASE_COST_CODES — Stores the association between a cost base and the cost codes valid for it. COPY_STRUCTURE reads existing rows here and inserts the duplicates for the new structure.
  • PA_COST_BASE_COST_CODES_S — The sequence or surrogate-key companion used to generate identifiers for the rows inserted into PA_COST_BASE_COST_CODES. This is the object the user searched for, and its inclusion confirms the package inserts rather than merely reads cost code assignments.
  • PA_COST_BASE_EXP_TYPES — Holds the expenditure types permitted for a cost base. These mappings are copied alongside the cost codes so the duplicated structure is functionally complete.
  • PA_COST_PLUS_STRUCTURES — Defines cost-plus burden structures. Its inclusion extends the copy operation beyond simple base cost codes to cost-plus definitions.

FND_GLOBAL is used to obtain the session's user identifier and related context for audit columns, and DUAL and STANDARD support routine PL/SQL constructs.

Usage Notes

Because PA_COPY_STRUCTURE_PKG is not referenced by any other database object, it is not part of Oracle Projects' internal runtime call graph. It is intended to be invoked explicitly — from a concurrent program wrapper, from Oracle Forms customization code, or from custom PL/SQL that needs to seed a new cost structure from an existing one. Typical use cases include setting up a new operating unit or project template that mirrors an established cost structure, or bulk-creating structures during implementation rather than entering each definition through the Projects setup forms. When invoking COPY_STRUCTURE, callers should first call CHECK_STRUCTURE and CHECK_EXISTENCE to validate the source definition and detect duplicate targets, then rely on the package to insert rows into the cost base cost code, expenditure type, and cost-plus structure tables. Multi-org and MOAC considerations apply in 12.1.1 and 12.2.2; ensure the correct operating unit context is set via FND_GLOBAL before invoking the copy so that the correct rows are selected and audit columns are populated.