Search Results avg_amount1formula
Overview
APPS.XTR_XTRTMAVG_XMLP_PKG is a server-side PL/SQL package body that supports the Oracle E-Business Suite (EBS) XML Publisher (BI Publisher) concurrent program XTRTMAVG, which produces a weighted-average and average-amount report within the Treasury (ETRM / XTR) module. Treasury transactions, balances, and average rate computations are frequently reported for treasury dealers and product structures, and this package supplies the report's PL/SQL after-report, before-report, and formula logic that cannot be expressed through the XML data template alone. The package is classified as OTHER in the ETRM repository, indicating it is an internally invoked report-support unit rather than a public application programming interface.
The source header identifies the file as XTRTMAVGB.pls 120.1, last updated 2007/12/28, confirming it has been stable across releases including 12.1.1 and 12.2.2. The package does not reference or depend upon any other package according to the metadata, making it a leaf node in the dependency graph.
Key Procedures and Functions
- WAVG_RATE1FORMULA — formula function that returns the weighted-average rate value designated for a report column; the executable logic is commented out, so it returns an empty string and the calculation is delegated to the SQL query of the data model.
- WAVG_RATEFORMULA — companion numeric formula returning NULL, retained as a placeholder for formula binding defined in the XML Publisher report definition.
- AVG_AMOUNT1FORMULA — formula function intended to return the average amount (balance divided by number of transactions); returns an empty string because the calculation is not executed in PL/SQL.
- AVG_AMOUNTFORMULA — numeric counterpart returning NULL for the average-amount formula.
- CF_SET_PARAFORMULA — builds the
CP_PARAvalue by selecting a ten-character substring of the databaseUSERfrom DUAL, typically used to display the effective reporting user or parameter context on the report output. - BEFOREREPORT — before-report trigger that initializes the report run: it retrieves the company name header via
CEP_STANDARD.GET_WINDOW_SESSION_TITLE, reports a lookup error through FND_MESSAGE using message nameXTR_LOOKUP_ERRwhen retrieval fails, checks the debug display flagP_DISPLAY_DEBUG, and loops through XTR_SYS_LANGUAGES_VL to populate localized label variables (Z1AS_AT_DATE, Z1PARAMETERS, Z1PRODUCT_TYPE, Z1SHOW_DETAILS, Z1SUBTYPE, and further Z-named parameters). TheZ1PRODUCT_TYPEvariable searched by the user is populated here. - AFTERREPORT — after-report trigger used to finalize report output, such as releasing session state or setting completion messages.
- AFTERPFORM — post-parameter-form trigger executed after the concurrent program parameter form is submitted.
- BEFOREPFORM — pre-parameter-form trigger executed before the parameter form is displayed, commonly used to set parameter defaults or validate context.
- WAVG_RATE_P — procedure that encapsulates weighted-average rate processing used during the report execution.
- AVG_AMOUNT_P — procedure that encapsulates average-amount processing used during the report execution.
- CP_PARA_P — procedure associated with the concurrent program parameter (
CP_PARA) value, used to set or expose that parameter to the report runtime.
Tables Accessed
- FND_CONCURRENT_REQUESTS — queried to retrieve the identity and status of the concurrent request under which the report package executes.
- FND_NEW_MESSAGES — accessed through the anchored type reference (
FND_NEW_MESSAGES.MESSAGE_TEXT%TYPE) for the localL_MESSAGEvariable, used when surfacing error text after a failed company-name retrieval. - DUAL — used by
CF_SET_PARAFORMULAto derive the ten-character user value and by the commented-out execute-immediate calculations for weighted-average rate and average amount. - XTR_SYS_LANGUAGES_VL — the module-specific language view read in
BEFOREREPORTto load translated label text for report parameters whereMODULE_NAME = 'XTRTMAVG', including the Z1PRODUCT_TYPE label.
Usage Notes
The package is invoked automatically by the XML Publisher concurrent program XTRTMAVG at report runtime; it is not intended for direct call by custom code, and the metadata records zero dependent packages. Its formulas (*FORMULA functions) are bound by name in the report definition and are executed once per report row or once per report, depending on placement. Localization of parameter labels is driven entirely from XTR_SYS_LANGUAGES_VL keyed on MODULE_NAME = 'XTRTMAVG', so adding or renaming a Z-numbered parameter requires a corresponding language row. Because several formula functions return NULL or empty strings by design, troubleshooting should focus on the data model query rather than the PL/SQL for those columns. Any modification should follow Oracle's package customization standards, and the P_DISPLAY_DEBUG parameter provides a diagnostic switch for troubleshooting report execution in 12.1.1 and 12.2.2 environments.