Search Results c_order_byformula




Overview

INV_INVTRCLS_XMLP_PKG is the PL/SQL package body that supports the Oracle E-Business Suite Inventory transaction classification report, distributed in XML Publisher (BI Publisher) format. The package is owned by APPS and is classified under the ETRM metadata as OTHER, indicating that it is not published as a reusable public API but instead serves as the server-side logic layer bound to a specific concurrent program report definition. The "XMLP_PKG" naming convention identifies it as a report package generated for a XML Publisher template, where the procedural logic drives report parameters, formatting, and query control before the data model is executed. The header comment indicates the source file is INVTRCLSB.pls, version 120.1, dated 2007, and marked "noship," confirming it is shipped as part of the standard Inventory product code line and is not intended for customer modification. The package operates within both Oracle EBS 12.1.1 and 12.2.2, where XML Publisher report packages retain the same general structure across these releases.

Key Procedures and Functions

The ETRM metadata documents four program units in this package body:

  • BEFOREREPORT — Executed before the report data model runs. It captures the concurrent request identifier via FND_GLOBAL.CONC_REQUEST_ID into the package variable P_CONC_REQUEST_ID and derives a formatted close date string (P_CLOSE_DATE_T) from the P_CLOSE_DATE parameter using the DD-MON-YY mask. The legacy SRW.USER_EXIT('FND SRWINIT') scaffolding is present but commented out, reflecting migration from the older Reports runtime to XML Publisher.
  • AFTERREPORT — Executed after the report completes. Its only remaining body is the commented-out SRW.USER_EXIT('FND SRWEXIT') call, so it effectively performs no active work but remains as a structural placeholder for report teardown logic.
  • C_CURRENCY_CODEFORMULA — Accepts the report's R_CURRENCY_CODE value and returns it enclosed in parentheses, providing consistent currency-code formatting in the report output.
  • C_ORDER_BYFORMULA — Returns the ORDER BY clause string used by the report query based on the P_SORT_ID parameter. This is the function relevant to the search term "c_order_byformula." It maps sort selections to explicit ordering: when P_SORT_ID is 1 the report orders by columns 1 and 3; when 2, by column 3 ascending then 1; when 3, by column 3 descending then 1; for any other value it returns NULL, applying no explicit ordering.

Tables Accessed

The metadata excerpt documents no direct table references. Rather than issuing SQL against base tables, this package operates on report parameters and package-level variables, generating dynamic SQL fragments (the ORDER BY clause and the currency-code formatting) that are consumed by the XML Publisher data template. Functional table access associated with the Inventory transaction classification report is therefore defined in the report's data model and query, not within this PL/SQL layer.

Usage Notes

INV_INVTRCLS_XMLP_PKG is invoked implicitly by the Oracle EBS concurrent manager when the associated Inventory transaction classification report concurrent program is submitted with an XML Publisher template. Report consumers never call it directly; instead, the report engine calls BEFOREREPORT, evaluates C_ORDER_BYFORMULA and C_CURRENCY_CODEFORMULA during data retrieval and formatting, then calls AFTERREPORT at completion. The P_SORT_ID parameter, referenced by C_ORDER_BYFORMULA, drives the report's sort behavior as exposed on the concurrent program's parameter form. Because the package is APPS-owned and marked OTHER with no dependent packages and no public API classification, it should not be treated as a supported extension point. Customizations to sort logic or currency formatting are more appropriately delivered through a cloned report definition or a custom XML Publisher template, preserving the original object for patch compatibility across 12.1.1 and 12.2.2.