Search Results ap_web_acctg_pkg




Overview

AP_WEB_ACCTG_PKG is an Oracle Application Object Library (AOL) PL/SQL package body owned by the APPS schema. It supports the Oracle Internet Expenses (OIE) self-service expense reporting module, handling the accounting and cost center derivation logic required to build valid General Ledger account combinations for expense report distributions. In Oracle EBS 12.1.1 and 12.2.2, this package acts as the accounting engine behind the expenses workflow, translating the project, expense type, and employee data entered on an expense report into the concatenated accounting flexfield segments that are ultimately posted to the General Ledger. It integrates closely with the Oracle Payables expense report tables and the Flexfields architecture, and is referenced by nine other PL/SQL packages within the AP and OIE module stack. Its dependency list confirms a central role: the package references AP_WEB_UTILITIES_PKG, AP_WEB_CUS_ACCTG_PKG, AP_WEB_PROJECT_PKG, FND_FLEX_APIS, FND_FLEX_KEYVAL, and the AP_EXPENSE_REPORT percentage tables, indicating both standard and customer-specific accounting customization paths.

Key Procedures and Functions

The package exposes twelve documented routines that collectively derive and validate expense accounting segments:

  • GETEMPLOYEECOSTCENTER — Derives the default cost center associated with an employee, typically from HR or system parameter data.
  • GETCOSTCENTER — Returns the cost center segment value relevant to the expense report context.
  • GETCOSTCENTERAPPROVALRULE — Determines the approval routing or rule related to cost center assignment on an expense report.
  • VALIDATECOSTCENTER — Confirms that a supplied cost center value is valid against the accounting flexfield definition.
  • GETEXPENSETYPECOSTCENTER — Resolves the cost center tied to a specific expense type, allowing expense-type-driven accounting defaults.
  • GETCOSTCENTERSEGMENTNAME — Retrieves the descriptive name of the cost center segment for display or verification purposes.
  • GETDISTRIBUTIONSEGMENTS — Returns the accounting segments that make up a distribution line for the expense report.
  • GETCONCATENATEDSEGMENTS — Produces the full concatenated accounting flexfield string from individual segment values.
  • BUILDACCOUNT — Assembles a complete GL account combination from segment inputs.
  • BUILDDISTPROJECTACCOUNT — Builds the accounting combination for a project-related distribution, merging project and expense data.
  • VALIDATEPROJECTACCOUNTING — Validates that a project accounting combination is legitimate before use.
  • GETDEPENDENTSEGMENTVALUE — Returns dependent segment values where flexfield segments are hierarchically dependent.

Tables Accessed

The package reads from and writes to the core Oracle Internet Expenses tables: AP_EXPENSE_REPORT_HEADERS and AP_EXPENSE_REPORT_HEADERS_ALL (header-level accounting defaults), AP_EXPENSE_REPORT_LINES and AP_EXPENSE_REPORT_LINES_ALL (line-level detail), AP_EXPENSE_REPORT_PARAMS and AP_EXPENSE_REPORT_PARAMS_ALL (report parameters), and AP_EXP_REPORT_DISTS (expense report distributions). It consults AP_SYSTEM_PARAMETERS and AP_SYSTEM_PARAMETERS_ALL for Payables configuration, and the Flexfield metadata tables FND_FLEX_VALUE_SETS, FND_ID_FLEX_SEGMENTS, FND_SEGMENT_ATTRIBUTE_TYPES, and FND_SEGMENT_ATTRIBUTE_VALUES to understand the accounting flexfield structure. GL_CODE_COMBINATIONS is referenced to verify valid account combinations, and DBMS_SQL is used for dynamic segment processing.

Usage Notes

AP_WEB_ACCTG_PKG is invoked primarily from the Oracle Internet Expenses self-service pages and the Expense Report workflow, where cost center and accounting segments must be derived, defaulted, and validated as employees enter or submit reports. Because it is not referenced by other database objects at the schema level but is depended upon by nine packages, it functions as a shared accounting utility layer within the OIE stack. Customizations that alter expense accounting behavior, such as customer-specific cost center derivation, are typically implemented through the companion AP_WEB_CUS_ACCTG_PKG rather than by modifying this seeded package. When troubleshooting expense report account generation or cost center validation errors in 12.1.1 or 12.2.2, this package and its dependencies are the primary diagnostic target.