Search Results flex_select_seg
Overview
GL_GLXRLCOA_XMLP_PKG is the Oracle Application Object Library supporting package for the GLXRLCOA Oracle XML Publisher (BI Publisher) concurrent program, "Chart of Accounts Listing" or a closely related General Ledger flexfield reporting report. Its primary purpose is to provide helper procedures that a GL chart of accounts XML report invokes to resolve report parameters, build dynamic SQL fragments, and control output behavior. The package declaration is defined with AUTHID CURRENT_USER and carries a header dating to 2007, indicating it has been stable across Release 11i and the 12.1.1 and 12.2.2 codelines.
The package exposes package-level parameters that mirror the concurrent program's input parameters and internal report variables. These include P_CONC_REQUEST_ID, P_STRUCT_NUM (the accounting flexfield structure number), P_FLEX_HIGH and P_FLEX_LOW (the high and low accounting flexfield ranges), and P_ORDERBY_SEG, which controls the sort segment for the report output. The remaining variables, FLEX_SELECT_ALL, FLEX_SELECT_BAL, and FLEX_SELECT_SEG, are dynamically constructed SQL fragments that concatenate the expanded SEGMENT1 through SEGMENT30 columns of the accounting flexfield structure.
Key Procedures and Functions
The package documents ten procedures. BEFOREREPORT executes prior to report data retrieval, typically to initialize parameters, derive flexfield structure context, and prepare bind values. AFTERREPORT executes after report completion, commonly used to reset state or write post-run information.
The flex selection procedures build column projection lists. FLEX_SELECT_ALL_P constructs the SELECT expression returning all enabled segments of the accounting flexfield concatenated with newline separators through SEGMENT30. FLEX_SELECT_BAL_P builds a reduced selection, historically limited to the balancing segments (segment11 and segment12 in the US accounting flexfield example shown in the source). FLEX_SELECT_SEG_P produces a segment-oriented selection consistent with the segment listing layout.
The ordering procedures parallel the selection logic. FLEX_ORDERBY_ALL_P returns an ORDER BY clause covering all segments, while FLEX_ORDERBY_BAL_P and FLEX_ORDERBY_SEG_P return ordering clauses scoped to the balancing or segment views respectively. These maintain deterministic sort order in the report output.
The WHERE-clause helpers complete the dynamic SQL construction. FLEX_WHERE_ALL_P generates the filter predicate for the all-segments query. FLEX_NODATA_SELECT_ALL_P is the sibling routine associated with the user's search term; its name indicates it produces the projection used when the report is configured to return no rows (a "no data" placeholder query) for the all-segments layout, allowing the report to complete cleanly when no flexfield values satisfy the criteria.
Tables Accessed
The ETRM metadata for this package does not document explicit table references through APPS synonyms. The dynamic SQL fragments it generates reference the SEGMENT1 through SEGMENT30 columns characteristic of the GL_CODE_COMBINATIONS table, or a report-specific view over the accounting flexfield. No direct DML is implied by the documented interface; the package supplies SQL text consumed by the XML Publisher data template.
Usage Notes
GL_GLXRLCOA_XMLP_PKG is invoked automatically by the XML Publisher concurrent program data template at runtime and is not intended for direct interactive use. It is classified as OTHER rather than a public API, and ETRM records zero dependent packages, so other code does not call it. Customizations should avoid modifying this package; instead, use standard flexfield configuration or a custom report template. Because the segment lists assume a full 30-segment definition, deployments with fewer enabled segments rely on the runtime structure context set by P_STRUCT_NUM.