Home › Discussions › Questions & Answers › Dynamically Selecting DFF Columns in Reports

Dynamically Selecting DFF Columns in Reports

Avatar photoCustomer Questions & Answers 9 replies

I want to create an Inventory report that includes all currently enabled Descriptive Flexfields (DFFs) for the MTL_SYSTEM_ITEMS table. Since DFFs can change, I need the column selection to be dynamic. How can I achieve this using a lexical anchor and a built-in function?

9 replies

  • Support Enginatics

    You should use the `&lexical` anchor, placing it directly within your `SELECT` clause (e.g., `select &flexfield_columns from mtl_system_items_vl msiv`) . The parameter associated with this anchor must contain SQL that calls the utility function `xxen_util.dff_columns` . This function automatically queries the `fnd_descr_flex_col_usage_vl` dictionary tables to generate the required comma-separated list of DFF columns and their respective column headers (prompts) , .

  • What parameters does the `xxen_util.dff_columns` function require to correctly generate the column list?

  • Support Enginatics

    The `xxen_util.dff_columns` function requires the `p_table_name` (e.g., ‘mtl_system_items_b’) and the `p_table_alias` (e.g., ‘msiv’) , . By default, if you don’t specify a DFF context code, it generates columns from all contexts, starting with ‘Global Data Elements’ , . Optionally, you can restrict the output by providing the `p_descr_flex_context_code` to show only DFFs for a specific context .

  • If I also need to include a fixed set of standard columns in the SELECT list, how should I format the SQL surrounding the anchor?

  • Support Enginatics

    You should place the `&lexical` anchor within the `SELECT` clause, usually followed or preceded by a comma, to correctly delimit the dynamically generated columns from your fixed column list . For instance, `select fu.user_name, fu.email_address, &columns frv.responsibility_name` allows the lexical anchor to inject columns like `fu.user_name, fu.email_address,` followed by your static column . The utility function ensures that the resulting SQL text is formatted correctly for insertion, often including quotation marks for column aliases (e.g., `msiv.attribute1 “Late Demands Penalty”`) .

  • If the automatically generated column headers are too long for Excel, can I manually shorten them in the report definition?

  • Support Enginatics

    The DFF utility automatically uses the DFF prompt text as the column header . While you cannot directly edit the output of the utility within the parameter definition, you can use the Column Translations feature in Blitz Report Setup to define multi-language headers . If you need a column-specific number format or translation, you should check ‘Columns’ during export to include this data for migration .

  • The overall SQL statement for this report is quite large. If it exceeds 32767 characters, can I still use the standard Forms interface for creation?

  • Support Enginatics

    No, the standard SQL entry field through the Oracle Forms interface is limited to 32767 characters . If your extraction SQL, even with the embedded lexical logic, exceeds this limit, you must utilize the ‘Upload Large SQL’ functionality, which can be accessed from the Tools menu in the Blitz Report Setup window . You should ensure the SQL file is encoded correctly, particularly if non-ANSI characters are present.

  • You must be logged in to reply to this post.