Home Discussions Questions & Answers Dynamically Selecting DFF Columns in Reports

Dynamically Selecting DFF Columns in Reports

Avatar photoCustomer July 19, 2022 at 5:18 am

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?

Viewing 8 reply threads
  • Author
    Replies
    • Support July 19, 2022 at 10:32 pm  

      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) , .

    • Avatar photoCustomer July 20, 2022 at 4:43 am  

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

    • Support July 21, 2022 at 9:21 pm  

      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 .

    • Avatar photoCustomer July 23, 2022 at 4:50 pm  

      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 July 24, 2022 at 10:32 pm  

      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”`) .

    • Avatar photoCustomer July 25, 2022 at 4:29 pm  

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

    • Support July 26, 2022 at 12:54 am  

      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 .

    • Avatar photoCustomer July 27, 2022 at 9:01 am  

      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 July 28, 2022 at 5:28 pm  

      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.

Viewing 8 reply threads
  • You must be logged in to reply to this post.

Login with: