Search Results get_main_local_unit_id
Overview
PAY_FI_RULES is a public PL/SQL package owned by APPS and classified under ETRM as an OTHER API within the Oracle E-Business Suite Payroll (PAY) product family. Its declared purpose, as stated in the package header, is to fetch the Legal Employer Id of the Local Unit associated with a given Assignment Id. In the Oracle EBS legislative framework, a "Local Unit" represents the legal employer entity for a specific assignment, and this package resolves that relationship for downstream payroll and statutory reporting processes. The package is declared with AUTHID CURRENT_USER, meaning executing privileges are evaluated against the calling schema rather than the defining schema, a common practice for shared APPS code that must respect the caller's security context.
The header comments describe the core contract: given a required assignment identifier and effective date, the package locates the Legal Employer Id of the Local Unit and populates an output parameter (p_tax_unit_id). On failure, the output is left unset. The package is referenced by one other package, indicating it serves as a shared utility within the payroll processing stack rather than a standalone entry point.
Key Procedures and Functions
ETRM documents eight procedures and functions for this package. Their purposes are described below; parameter signatures are not reproduced here.
- GET_MAIN_LOCAL_UNIT_ID — Corresponds to the primary documented behavior: returns the Legal Employer Id of the Local Unit for a specified assignment and effective date.
- GET_MAIN_TAX_UNIT_ID — Resolves the Tax Unit Id associated with an assignment, functioning as the tax-reporting counterpart to the local unit lookup.
- GET_THIRD_PARTY_ORG_CONTEXT — Retrieves organization context for third-party (payroll interface) processing, supporting the FI (Future Interface / third-party payroll) area implied by the package name.
- GET_SOURCE_TEXT_CONTEXT and GET_SOURCE_TEXT2_CONTEXT — Return source text context values, likely for populating descriptive or legislative text used during interface file generation.
- ADD_CUSTOM_XML — Appends custom XML fragments, suggesting this package contributes to XML-based payroll interface payloads.
- LOAD_XML — Loads or assembles XML content, reinforcing the package's role in generating structured interface output.
- FLEX_SEG_ENABLED — Tests whether a key flexfield segment is enabled, a common guard used when deciding which segments to include in output.
Tables Accessed
The package reads and writes a broad set of payroll and HR tables through APPS synonyms:
- PER_ALL_ASSIGNMENTS_F — The assignment repository, used to resolve the assignment and its effective-dated attributes.
- HR_ORGANIZATION_INFORMATION and HR_SOFT_CODING_KEYFLEX — Provide organization-level legal employer and key flexfield data for the local unit.
- PAY_ACTION_INFORMATION, PAY_ACTION_INTERLOCKS, PAY_PAYROLL_ACTIONS, PAY_ASSIGNMENT_ACTIONS — Track payroll action lifecycle and interlock status, reflecting the package's interaction with payroll runs.
- PAY_ELEMENT_ENTRIES_F, PAY_ELEMENT_ENTRY_VALUES_F, PAY_ELEMENT_LINKS_F, PAY_ELEMENT_TYPES_F, PAY_INPUT_VALUES_F — Element and entry data, used to derive legislative and calculation context.
- PAY_LEGISLATION_RULES — Legislative rule definitions that govern how local and tax units are determined by country.
- FND_ID_FLEX_STRUCTURES and DUAL — Flexfield structure metadata and simple selection scaffolding.
Usage Notes
PAY_FI_RULES is typically invoked from payroll legislative code, third-party payroll interface programs, and custom PL/SQL that needs to resolve legal employer or tax unit context for an assignment. It is not a user-facing form entry point; rather, it is called programmatically by other packages — the one documented dependent package confirms this internal usage pattern. Custom code should call GET_MAIN_LOCAL_UNIT_ID (and its tax unit counterpart) with a valid assignment id and effective date, and must handle the documented failure case where the output parameter remains unset. As with any AUTHID CURRENT_USER API, callers must ensure the execution schema holds appropriate privileges on the underlying APPS synonyms and uses the correct effective date to avoid incorrect effective-dated resolution.
-
PACKAGE: APPS.PAY_FI_RULES
12.2.2
-
PACKAGE: APPS.PAY_FI_RULES
12.1.1
-
PACKAGE: APPS.PAY_SE_RULES
12.2.2
-
PACKAGE: APPS.PAY_NO_RULES
12.1.1
-
PACKAGE: APPS.PAY_NO_RULES
12.2.2
-
PACKAGE: APPS.PAY_SE_RULES
12.1.1
-
PACKAGE BODY: APPS.PAY_SE_RULES
12.2.2
-
PACKAGE BODY: APPS.PAY_SE_RULES
12.1.1
-
PACKAGE BODY: APPS.PAY_FI_RULES
12.1.1
-
PACKAGE BODY: APPS.PAY_FI_RULES
12.2.2
-
PACKAGE BODY: APPS.PAY_NO_RULES
12.1.1
-
PACKAGE BODY: APPS.PAY_NO_RULES
12.2.2
-
APPS.PAY_SE_RULES dependencies on PAY_SE_RULES
12.2.2
-
APPS.PAY_SE_RULES dependencies on PAY_SE_RULES
12.1.1
-
APPS.PAY_NO_RULES dependencies on HR_UTILITY
12.2.2
-
APPS.PAY_NO_RULES dependencies on HR_UTILITY
12.1.1
-
APPS.PAY_NO_RULES dependencies on PAY_NO_RULES
12.1.1
-
APPS.PAY_NO_RULES dependencies on PAY_NO_RULES
12.2.2