**TITLE**: Bubble Chart Card (fiori-elements-framework)

**INTRODUCTION**: Use a Bubble Chart Card to present up to three measures and one or two dimensions. Measures map to x-axis, y-axis, and bubble size; dimensions map to color and/or shape. This document summarizes the feed/role mappings, fallback rules, and provides ready-to-use XML, ABAP CDS, and CAP CDS annotation examples.

**TAGS**: fiori-elements, UI.Chart, bubble, chart, annotation, CDS, ABAP, XML, CAP, semantic-color

**STEP**: Define required roles and feed mappings

**DESCRIPTION**: Assign three measures and one or two dimensions. Follow these mapping rules so the generated card maps annotations to chart feeds:
- Measures:
  - The measure whose Role is Axis1 (or Axis2 if no Axis1, or Axis3 if no Axis2) is mapped to the valueAxis feed and becomes the x-axis (UID = valueAxis).
  - The measure whose Role is Axis2 (or Axis1 of the second measure if no Axis2, or Axis3 of the first measure if no Axis1 for the second) is mapped to the valueAxis2 feed and becomes the y-axis (UID = valueAxis2).
  - The remaining measure is mapped to the bubbleWidth feed (UID = bubbleWidth) and controls bubble size.
- Dimensions:
  - Dimensions with Role Series are mapped to the color feed (UID = color). If multiple dimensions assigned Role Series, color is determined by each combination of members (e.g., Country/Year combinations get unique colors).
  - Dimensions with Role Category are mapped to the shape feed (UID = shape). If multiple dimensions are assigned Category, only the first is considered.
  - If a dimension has no role, members share the same color by default.
- Recommendation: Avoid using Category (shape) for bubble charts; prefer Series (color).

**LANGUAGE**: Text

**CODE**:
```text
Feeds used: valueAxis (x-axis), valueAxis2 (y-axis), bubbleWidth (size), color (dimension series), shape (dimension category)
```

**STEP**: Note fallback rules for measure role assignment

**DESCRIPTION**: Use these explicit fallback rules when assigning roles so automated tools choose correct axes when some roles are missing:
- First measure assigned an axis -> valueAxis (x-axis). Role selection order: Axis1; if absent then Axis2 (if Axis1 missing); if Axis2 missing then Axis3.
- Second measure assigned an axis -> valueAxis2 (y-axis). Role selection for this feed:
  - Prefer Axis2 of a measure.
  - If no Axis2 exists on the first measure, use Axis1 of the second measure.
  - If no Axis1 on the second measure, use Axis3 of the first measure.

**LANGUAGE**: Text

**CODE**:
```text
Fallback mapping summary:
- valueAxis (x): first measure with Role=Axis1; if missing Axis1 -> Axis2; if missing Axis2 -> Axis3
- valueAxis2 (y): first measure with Role=Axis2; if missing -> Axis1 of second measure; else -> Axis3 of first measure
- bubbleWidth (size): the remaining measure (Axis3 or unassigned axis measure)
```

**STEP**: XML Annotation example

**DESCRIPTION**: Copy this XML annotation into your OData service metadata annotations to create a Bubble Chart Card. It defines three measures (Axis1, Axis2, Axis3) and one dimension (Series). Keep the Qualifier for binding.

**LANGUAGE**: XML

**CODE**:
```xml
<Annotation Term="UI.Chart" Qualifier="Qualifier_ID_1">
    <Record Type="UI.ChartDefinitionType">
        <PropertyValue Property="Title" String="View1" />
        <PropertyValue Property="ChartType" EnumMember="UI.ChartType/Bubble"/>
        <PropertyValue Property="MeasureAttributes">
            <Collection>
                <Record Type="UI.ChartMeasureAttributeType">
                    <PropertyValue Property="Measure" PropertyPath="SalesShare" />
                    <PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis1" />
                </Record>
                <Record Type="UI.ChartMeasureAttributeType">
                    <PropertyValue Property="Measure" PropertyPath="TotalSales" />
                    <PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis2" />
                </Record>
                <Record Type="UI.ChartMeasureAttributeType">
                    <PropertyValue Property="Measure" PropertyPath="Sales" />
                    <PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis3" />
                </Record>
            </Collection>
        </PropertyValue>
        <PropertyValue Property="DimensionAttributes">
            <Collection>
                <Record Type="UI.ChartDimensionAttributeType">
                    <PropertyValue Property="Dimension" PropertyPath="Product" />
                    <PropertyValue Property="Role" EnumMember="UI.ChartDimensionRoleType/Series" />
                </Record>
            </Collection>
        </PropertyValue>
    </Record>
</Annotation>
```

**STEP**: ABAP CDS Annotation example

**DESCRIPTION**: Use this ABAP CDS snippet to annotate a view. It defines the same Bubble Chart configuration in ABAP CDS style. Keep the qualifier and include the annotation on the view via "annotate view VIEWNAME with { }" pattern as necessary.

**LANGUAGE**: ABAP

**CODE**:
```
@UI.Chart: [
  {
    title: 'View1',
    chartType: #BUBBLE,
    measureAttributes: [
      {
        measure: 'SalesShare',
        role: #AXIS_1
      },
      {
        measure: 'TotalSales',
        role: #AXIS_2
      },
      {
        measure: 'Sales',
        role: #AXIS_3
      }
    ],
    dimensionAttributes: [
      {
        dimension: 'Product',
        role: #SERIES
      }
    ],
    qualifier: 'Qualifier_ID_1'
  }
]
annotate view VIEWNAME with { }
```

**STEP**: CAP CDS Annotation example

**DESCRIPTION**: Use this CAP CDS snippet inside your .cds file annotations. It uses CAP CDS syntax to define the Bubble Chart. Keep the qualifier name to reference the chart.

**LANGUAGE**: CDS

**CODE**:
```
UI.Chart #Qualifier_ID_1 : {
    $Type : 'UI.ChartDefinitionType',
    Title : 'View1',
    ChartType : #Bubble,
    MeasureAttributes : [
        {
            $Type : 'UI.ChartMeasureAttributeType',
            Measure : SalesShare,
            Role : #Axis1
        },
        {
            $Type : 'UI.ChartMeasureAttributeType',
            Measure : TotalSales,
            Role : #Axis2
        },
        {
            $Type : 'UI.ChartMeasureAttributeType',
            Measure : Sales,
            Role : #Axis3
        }
    ],
    DimensionAttributes : [
        {
            $Type : 'UI.ChartDimensionAttributeType',
            Dimension : Product,
            Role : #Series
        }
    ]
}
```

**STEP**: Semantic coloring and best practices

**DESCRIPTION**: Bubble charts support semantic color palettes. Use Role=Series for semantic coloring. Best practices:
- Always provide three measures (explicit roles) and at least one dimension for color differentiation.
- If using two dimensions with Role=Series, expect color combinations (cartesian of members).
- Avoid using Category/shape for bubble charts unless needed; shapes can reduce readability.
- Ensure qualifiers are unique and referenced correctly in card manifests or binding logic.

**LANGUAGE**: Text

**CODE**:
```text
Notes:
- Color palette: supported for semantic coloring via Series role.
- Prefer Series for distinct groups; Category leads to shape differences (not recommended).
- Ensure three measures exist to map x, y, and size reliably.
```

fiori-elements UI.Chart bubble chart annotation CDS ABAP XML CAP semantic-color


**TITLE**: Building an App with SAP Fiori elements (using SAP Fiori tools)

**INTRODUCTION**: Short actionable guide for scaffolding, building, and running SAP Fiori elements UI applications using SAP Fiori tools (extensions for SAP Business Application Studio and Visual Studio Code). Use this as a concise checklist for automation or code-generation agents to produce required project files and run common local build commands.

**TAGS**: fiori-elements-framework, sap-fiori-tools, sap-fiori, business-application-studio, visual-studio-code, ui5, build, scaffold

**STEP**: 1 — Verify local prerequisites

**DESCRIPTION**: Ensure Node.js and npm are installed and available on the build agent or developer machine. These commands check versions; adjust required minimum versions per your project guidelines.

**LANGUAGE**: Shell

**CODE**:
```shell
# check Node.js and npm
node -v
npm -v

# (optional) check git availability if scaffolding requires cloning templates
git --version
```

**STEP**: 2 — Install SAP Fiori tools extensions (BAS or VS Code)

**DESCRIPTION**: Install the SAP Fiori tools extension set into Visual Studio Code or use the preconfigured environment in SAP Business Application Studio. These extensions provide the Application Generator and templates for creating SAP Fiori elements projects. Open the Extensions view in VS Code (or the BAS extension manager) and install "SAP Fiori tools". For reference and latest docs, use the official SAP Fiori tools page.

**LANGUAGE**: Plain

**CODE**:
```text
Reference: https://help.sap.com/viewer/product/SAP_FIORI_tools/Latest/en-US
# Manual step: In VS Code -> Extensions -> search "SAP Fiori tools" -> Install
# Or use SAP Business Application Studio with Fiori tools pre-installed.
```

**STEP**: 3 — Scaffold a new SAP Fiori elements app (using the Application Generator)

**DESCRIPTION**: Use the SAP Fiori tools Application Generator to scaffold a new app. In VS Code or BAS, invoke the command palette and run the Fiori generator (e.g., "Fiori: Open Application Generator" or "Fiori: New Project"). Select the SAP Fiori elements floorplan required (for example, List Report/Object Page), provide the OData service URL and annotation files, and accept or customize the generated manifest.json, webapp structure, and package.json.

**LANGUAGE**: Plain

**CODE**:
```text
# In VS Code or BAS:
# 1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
# 2. Run: "Fiori: Open Application Generator" or "Fiori: New Project"
# 3. Follow prompts:
#    - Project name
#    - Template: "SAP Fiori elements" -> "List Report Object Page" (or other)
#    - OData service URL (EDMX) and annotation file(s)
#    - Namespace and app id
# 4. Generator outputs project folder with webapp/, manifest.json, xs-app.json (if applicable), package.json
```

**STEP**: 4 — Install dependencies and run locally

**DESCRIPTION**: After scaffolding, install NPM dependencies and run the local UI5 dev server or the configured start script in package.json. This step uses standard npm commands; adjust to project-specific scripts if different (e.g., ui5 serve, npm run start).

**LANGUAGE**: Shell

**CODE**:
```shell
# from the generated project root
cd <your-project-folder>

# install dependencies
npm install

# run the app locally (uses project start script or ui5 tooling)
npm start
# or explicit ui5 command if configured
# npx ui5 serve --config=ui5.yaml
```

**STEP**: 5 — Connect to OData backend and test end-to-end

**DESCRIPTION**: Ensure the app connects to the provided OData service and annotations. Validate navigation (List Report -> Object Page) and UI behavior. If CORS or proxy is required during local testing, configure the local dev server (xs-app.json or ui5.yaml) to route backend requests.

**LANGUAGE**: JSON

**CODE**:
```json
// Example xs-app.json route snippet for local proxy to backend OData service
[
  {
    "source": "^/sap/opu/odata/(.*)$",
    "target": "/sap/opu/odata/$1",
    "destination": "your-backend-destination",
    "authenticationType": "none",
    "csrfProtection": false
  }
]
```

**STEP**: 6 — Prepare for deployment to SAP BTP (optional)

**DESCRIPTION**: When ready to deploy, package the app according to your target environment (SAP BTP / Cloud Foundry or Neo). Common options include creating an MTA (multi-target app) or deploying the built static app to an app router or HTML5 Application Repository. Use platform-specific CLI tools for pushing the build artifacts.

**LANGUAGE**: Shell

**CODE**:
```shell
# Example: build production artifacts (if project defines a build step)
npm run build

# Example: Cloud Foundry deploy (ensure cf CLI and target org/space are set)
# cf push <app-name> -p ./dist

# Example: deploy to SAP BTP HTML5 Repository via SAP CLI or CI pipeline
# Use platform tools or CI tasks (not shown here)
```

**NOTE**: For detailed step-by-step procedures, templates, and latest generator options, consult the official SAP Fiori tools documentation: https://help.sap.com/viewer/product/SAP_FIORI_tools/Latest/en-US

fiori-elements-framework sap-fiori-tools sap-fiori business-application-studio visual-studio-code ui5 build scaffold


**TITLE**: Building Blocks (SAP Fiori elements — OData V4)

**INTRODUCTION**: Short reference for using SAP Fiori elements building blocks (templating instructions that generate control trees at runtime). Focuses on the Field building block example, configuration precedence, runtime behavior, and requirements for dynamically loaded fragments.

**TAGS**: fiori-elements, odata-v4, building-blocks, macros, sap.fe.macros, fragments, loadFragment, extension-api, manifest

**STEP**: 1 — Applicability and purpose

**DESCRIPTION**: Building blocks are template-like instructions (not SAPUI5 controls) used by Fiori elements to generate control trees based on bound data and attributes. This topic applies only to SAP Fiori elements for OData V4. Use building blocks to create UI representations without directly constructing SAPUI5 controls; the framework decides the resulting control(s) based on metadata and attributes.

**LANGUAGE**: XML

**CODE**:
```xml
<!-- Building blocks are templating instructions that generate control trees at runtime.
     Applicable only to SAP Fiori elements for OData V4. -->
```

**STEP**: 2 — Invoke the Field building block (example)

**DESCRIPTION**: Use the Field building block in XML fragments or custom sections to declare UI fields by metaPath. The framework transforms Field usage into appropriate controls depending on the target property's type (example: string -> Text, Edm.Date -> DatePicker). Keep the code snippet exact when copying into your fragment.

**LANGUAGE**: XML

**CODE**:
```xml
<!-- Usage of the `Field` building block in a custom section -->
<macros:Field xmlns:macro="sap.fe.macros" metaPath="MyStringProperty" readOnly="true"/>
<macros:Field xmlns:macro="sap.fe.macros" metaPath="MyDateProperty" readOnly="true"/>

<!-- Result (control tree created by the framework at runtime) -->
<m:Text xmlns:m="sap.m" value="{MyStringProperty}"/>
<m:DatePicker xmlns:m="sap.m" value="{MyDateProperty}"/>
```

**STEP**: 3 — Configuration sources and precedence

**DESCRIPTION**: Building block behavior is configured by annotations, building-block-specific XML entries, and the manifest. If the same setting is defined in multiple places, manifest configuration overrides XML and annotation definitions. Always verify manifest entries when unexpected behavior occurs.

**LANGUAGE**: XML

**CODE**:
```xml
<!-- Configuration precedence (highest -> lowest):
     1) Manifest configuration (overrides others)
     2) XML-specific entries
     3) Annotations -->
```

**STEP**: 4 — Runtime behavior and API access

**DESCRIPTION**: Building blocks do not exist as controls at runtime; they produce controls. The framework exposes a restricted Extension API object to inspect or manipulate the generated controls. Use the exposed API methods (see ExtensionAPI documentation) rather than attempting to access non-existent building block instances.

**LANGUAGE**: XML

**CODE**:
```xml
<!-- At runtime the framework creates control trees. Use the extension API to interact
     with the generated controls via the supported (restricted) API methods. -->
```

**STEP**: 5 — Using building blocks in dynamically loaded fragments

**DESCRIPTION**: When using building blocks inside fragments that are loaded dynamically, always load the fragment via the sap.fe.core.ExtensionAPI.loadFragment method. This ensures the framework can process building blocks correctly during dynamic fragment instantiation.

**LANGUAGE**: XML

**CODE**:
```xml
<!-- IMPORTANT: For fragments that load dynamically and contain building blocks,
     ensure the fragment is loaded using sap.fe.core.ExtensionAPI.loadFragment. -->
```

**STEP**: 6 — References and live examples

**DESCRIPTION**: Use the SAP Fiori development portal and the ExtensionAPI Demo Kit for live examples and API details.

**LANGUAGE**: Text

**CODE**:
```text
Live examples: https://ui5.sap.com/test-resources/sap/fe/core/fpmExplorer/index.html#/topic/introduction
ExtensionAPI (loadFragment): https://ui5.sap.com/#/api/sap.fe.core.ExtensionAPI%23overview
```

fiori-elements odata-v4 building-blocks macros sap.fe.macros fragments loadFragment extension-api manifest


**TITLE**: Bullet Micro Chart — UI.Chart and UI.DataPoint Annotations (XML, ABAP CDS, CAP CDS)

**INTRODUCTION**: This document provides actionable annotation examples and required fields to implement a Bullet Micro Chart in SAP Fiori elements. It includes XML, ABAP CDS, and CAP CDS annotation samples for UI.Chart and UI.DataPoint, and lists mandatory annotations and semantic coloring behavior for code generation.

**TAGS**: fiori-elements-framework, ui.chart, ui.datapoint, bullet-chart, sapui5, annotations, abap-cds, cap-cds, xml

**STEP**: 1 — Define UI.Chart (XML)

**DESCRIPTION**: Use the UI.Chart annotation to configure the bullet chart: set Title and Description (subtitle), ChartType to Bullet, define Measures and MeasureAttributes. Ensure MeasureAttributes includes a DataPoint reference via AnnotationPath.

**LANGUAGE**: XML

**CODE**:
```xml
<Annotation Term="UI.Chart">
    <Record Type="UI.ChartDefinitionType">
        <PropertyValue Property="Title" String="Sales Revenue" />
        <PropertyValue Property="Description" String="Bullet Micro Chart" />
        <PropertyValue Property="ChartType" EnumMember="UI.ChartType/Bullet" />
        <PropertyValue Property="Measures">
            <Collection>
                <PropertyPath>BulletChartRevenue</PropertyPath>
            </Collection>
        </PropertyValue>
        <PropertyValue Property="MeasureAttributes">
            <Collection>
                <Record Type="UI.ChartMeasureAttributeType">
                    <PropertyValue Property="Measure" PropertyPath="BulletChartRevenue" />
                    <PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis1" />
                    <PropertyValue Property="DataPoint" AnnotationPath="@UI.DataPoint#BulletChartRevenue" />
                </Record>
            </Collection>
        </PropertyValue>
    </Record>
</Annotation>
```

**STEP**: 2 — Define UI.Chart (ABAP CDS)

**DESCRIPTION**: ABAP CDS syntax for the same UI.Chart configuration. Use chartType #BULLET and set measureAttributes with asDataPoint true if mapping to a UI.DataPoint.

**LANGUAGE**: ABAP CDS

**CODE**:
```
@UI.Chart: [
  {
    title: 'Sales Revenue',
    description: 'Bullet Micro Chart',
    chartType: #BULLET,
    measures: [
      'BULLETCHARTREVENUE'
    ],
    measureAttributes: [
      {
        measure: 'BulletChartRevenue',
        role: #AXIS_1,
        asDataPoint: true
      }
    ]
  }
]
annotate view STTA_C_MP_PRODUCT with {

}
```

**STEP**: 3 — Define UI.Chart (CAP CDS)

**DESCRIPTION**: CAP CDS syntax for UI.Chart. Use ChartType #Bullet and reference DataPoint via '@UI.DataPoint#BulletChartRevenue' inside MeasureAttributes.

**LANGUAGE**: CAP CDS

**CODE**:
```
UI.Chart : {
    $Type : 'UI.ChartDefinitionType',
    Title : 'Sales Revenue',
    Description : 'Bullet Micro Chart',
    ChartType : #Bullet,
    Measures : [
        BulletChartRevenue
    ],
    MeasureAttributes : [
        {
            $Type : 'UI.ChartMeasureAttributeType',
            Measure : BulletChartRevenue,
            Role : #Axis1,
            DataPoint : '@UI.DataPoint#BulletChartRevenue'
        }
    ]
}
```

**STEP**: 4 — Define UI.DataPoint (XML)

**DESCRIPTION**: Map the DataPoint qualifier referenced in MeasureAttributes. Include Value, TargetValue, ForecastValue, MinimumValue, MaximumValue, and Criticality (or CriticalityCalculation). Use Decimal values for min/max if needed.

**LANGUAGE**: XML

**CODE**:
```xml
<Annotation Term="UI.DataPoint" Qualifier="BulletChartRevenue">
    <Record>
        <PropertyValue Property="Value" Path="BulletChartRevenue" />
        <PropertyValue Property="TargetValue" Path="TargetRevenue" />
        <PropertyValue Property="ForecastValue" Path="ForecastRevenue" />
        <PropertyValue Property="MinimumValue" Decimal="100" />
        <PropertyValue Property="MaximumValue" Decimal="300" />
        <PropertyValue Property="Criticality" Path="Criticality" />
    </Record>
</Annotation>
```

**STEP**: 5 — Define UI.DataPoint (ABAP CDS)

**DESCRIPTION**: ABAP CDS mapping for the DataPoint. Attach DataPoint annotation to the measure element (BulletChartRevenue). Include targetValueElement, forecastValue, minimumValue, maximumValue, and criticality fields.

**LANGUAGE**: ABAP CDS

**CODE**:
```
@UI.dataPoint: {
  targetValueElement: 'TargetRevenue',
  forecastValue: 'ForecastRevenue',
  minimumValue: 100,
  maximumValue: 300,
  criticality: 'Criticality'
}
BulletChartRevenue;
```

**STEP**: 6 — Define UI.DataPoint (CAP CDS)

**DESCRIPTION**: CAP CDS syntax for UI.DataPoint with qualifier #BulletChartRevenue. Include Value, TargetValue, ForecastValue, MinimumValue, MaximumValue, and Criticality.

**LANGUAGE**: CAP CDS

**CODE**:
```
UI.DataPoint #BulletChartRevenue : {
    Value : BulletChartRevenue,
    TargetValue : TargetRevenue,
    ForecastValue : ForecastRevenue,
    MinimumValue : 100,
    MaximumValue : 300,
    Criticality : Criticality
}
```

**STEP**: 7 — Semantic Coloring and Mandatory Annotations

**DESCRIPTION**: Notes required for semantic coloring and mandatory fields to generate a valid Bullet Micro Chart. Criticality annotation overrides CriticalityCalculation when both are present. If using CriticalityCalculation, include ImprovementDirection.

**LANGUAGE**: Text

**CODE**:
```
Semantic coloring:
- Both UI.DataPoint → Criticality and UI.DataPoint → CriticalityCalculation are supported.
- UI.DataPoint → Criticality overrides UI.DataPoint → CriticalityCalculation.

Mandatory annotations for Bullet Micro Chart:
- UI.Chart → ChartType: "Bullet"         (e.g., EnumMember="UI.ChartType/Bullet" or chartType: #BULLET)
- UI.Chart → Measures                    (list of measure property paths)
- UI.Chart → MeasureAttributes → DataPoint (AnnotationPath to a UI.DataPoint qualifier)
- UI.DataPoint → Value                   (value path for the measure)

If using CriticalityCalculation for semantic coloring, additionally include:
- UI.DataPoint → CriticalityCalculation
- UI.DataPoint → CriticalityCalculation/ImprovementDirection
```

fiori-elements-framework ui.chart ui.datapoint bullet-chart sapui5 annotations abap-cds cap-cds xml


**TITLE**: Caching the Last Executed Request for Fiori elements List Report (OData V4)

**INTRODUCTION**: Describe how the List Report (SAP Fiori elements for OData V4 in SAP S/4HANA Cloud Public Edition) caches the last executed request parameters on the client to improve load performance. Explain when caching applies, when it is disabled, and how to explicitly enable it when a controller extension is present.

**TAGS**: fiori-elements-framework, request-cache, last-request, odata-v4, s4hana-cloud, list-report, manifest.json, security, PersonalData.IsPotentiallySensitive

**STEP**: Applicability and purpose

**DESCRIPTION**: State the feature scope and purpose. This request-parameter caching mechanism is available only for apps that use SAP Fiori elements for OData V4 in SAP S/4HANA Cloud Public Edition. The cache stores request parameters (not backend responses) so the app can re-trigger the last request on load and reduce end-to-end response time.

**LANGUAGE**: Text

**CODE**:
```Text
Applicable to: SAP Fiori elements for OData V4 in SAP S/4HANA Cloud Public Edition
Behavior: Stores the last executed request parameters on the client (not the backend response)
Purpose: Enables triggering the last request automatically on app load to reduce latency
```

**STEP**: Conditions that disable request caching

**DESCRIPTION**: Request caching is automatically disabled if any of the following conditions are true. Detect these conditions and do not rely on the cache when they apply.

- The request contains a filter on properties annotated with PersonalData.IsPotentiallySensitive. (See: https://github.com/SAP/odata-vocabularies/blob/main/vocabularies/PersonalData.xml#L234)
- A controller extension is defined in the List Report (because extensions can add filters on sensitive data).

For code generation, include checks that:
- Inspect filters for IsPotentiallySensitive annotations before enabling caching.
- Detect presence of controller extensions for the List Report and treat caching as disabled unless explicitly overridden.

**LANGUAGE**: Text

**CODE**:
```Text
Disabled when:
- Filters include properties annotated with PersonalData.IsPotentiallySensitive
  (reference: https://github.com/SAP/odata-vocabularies/blob/main/vocabularies/PersonalData.xml#L234)
- A controller extension exists for the List Report (possible addition of sensitive filters)
```

**STEP**: Override when a controller extension exists (enable caching explicitly)

**DESCRIPTION**: If a controller extension is present but you know no filters on sensitive data are added, you can explicitly enable request caching by setting disableRequestCache to false in the manifest.json controlConfiguration.tableSettings of the List Report target. Ensure you audit extensions to confirm no sensitive filters are introduced before enabling.

- File: manifest.json
- Location: under routing.targets.<YourListTarget>.options.settings.controlConfiguration.@com.sap.vocabularies.UI.v1.LineItem.tableSettings.disableRequestCache

Include the following manifest.json snippet exactly as shown to enable the cache for the list report component target.

**LANGUAGE**: JSON

**CODE**:
```json
"routing": {
    "targets": {
        "RootEntityList": {
            "type": "Component",
            "name": "sap.fe.templates.ListReport",
            "id": "RootEntityList",
            "options": {
                "settings": {
                    "entitySet": "RootEntity",
                    "controlConfiguration": {
                        "@com.sap.vocabularies.UI.v1.LineItem": {
                            "tableSettings": {
                                "disableRequestCache": false
                            }
                        }
                    }
                }
            }
        }
    }
}
```

**STEP**: Security note when overriding disableRequestCache

**DESCRIPTION**: When you set disableRequestCache to false while a controller extension exists, you must ensure that no filters on sensitive properties (annotated with PersonalData.IsPotentiallySensitive) are added by the extension. Failing to verify this can cause sensitive data to be cached (request parameters), which may violate security or privacy policies.

**LANGUAGE**: Text

**CODE**:
```Text
Security requirement: If override disableRequestCache = false while controller extensions exist, validate that:
- No filters target properties annotated with PersonalData.IsPotentiallySensitive
- All extension code has been audited for sensitive filter usage
```

**STEP**: End-user control of cache expiration and clearing

**DESCRIPTION**: Inform that end users can control cache expiration and manually clear the cached last request via the SAP Fiori launchpad (FLP) settings. Include reference to the FLP settings UI image path for documentation or UI automation.

**LANGUAGE**: Text

**CODE**:
```Text
End-user control:
- Users can manage cache expiration and clear the cached last request in SAP Fiori launchpad settings.
- Reference image path: images/FLP_Settings-User_Activities_10345fb.png
```


**TITLE**: Changing Default Titles of New and Unnamed Objects (SAP Fiori elements)

**INTRODUCTION**: How to replace SAP Fiori elements default titles for newly created or saved unnamed objects by providing application-specific strings in the i18n.properties file. Covers OData V2 and OData V4 behavior, required i18n keys, placement, and important caveats for non-draft apps and missing HeaderInfo.

**TAGS**: fiori-elements-framework, odata-v2, odata-v4, localization, i18n, titles, webapp/i18n

**STEP**: 1 — OData V2: Replace default titles

**DESCRIPTION**: For OData V2 list reports and object pages, default titles are "New Object" (for newly created) and "Unnamed Object" (for saved unnamed items). Provide application-specific values by adding the NEW_OBJECT and UNNAMED_OBJECT keys to your i18n.properties file. Notes:
- NEW_OBJECT and UNNAMED_OBJECT are not supported for list reports in non-draft applications.
- On object pages Fiori elements does not provide a default title for saved objects; to define one for saved unnamed objects you must override UNNAMED_OBJECT.

Place the keys in webapp/i18n/i18n.properties (or your configured i18n file).

**LANGUAGE**: properties

**CODE**:
```properties
# webapp/i18n/i18n.properties (OData V2)
# Example: replace generic titles with application-specific names
NEW_OBJECT=New Contract
UNNAMED_OBJECT=Unnamed Contract
```

**STEP**: 2 — OData V4: Replace default titles and handle HeaderInfo

**DESCRIPTION**: For OData V4 list reports and object pages, newly created objects in tables default to "New Object". If saved without modification the title becomes "Unnamed Object". Titles are editable by users; clearing the title will revert it to the default "Unnamed Object" (unless specific HeaderInfo is missing—see note). Provide application-specific values by adding T_NEW_OBJECT and T_ANNOTATION_HELPER_DEFAULT_HEADER_TITLE_NO_HEADER_INFO to your i18n.properties file.

Note:
- If UI.HeaderInfo.Typename is undefined, when the end user clears the title or saves a newly created item without changing the default "New Object", the title will be set to an empty string (""). Use T_ANNOTATION_HELPER_DEFAULT_HEADER_TITLE_NO_HEADER_INFO to define a fallback title in that scenario.

**LANGUAGE**: properties

**CODE**:
```properties
# webapp/i18n/i18n.properties (OData V4)
# Example: replace generic titles with application-specific names
T_NEW_OBJECT=New Contract
T_ANNOTATION_HELPER_DEFAULT_HEADER_TITLE_NO_HEADER_INFO=Unnamed Contract
```

**STEP**: 3 — References and placement

**DESCRIPTION**: Ensure the keys are added to the i18n file used by the application (commonly webapp/i18n/i18n.properties). For localization best practices and additional UI text keys, refer to the localization documentation.

**LANGUAGE**: text

**CODE**:
```text
File path (typical):
webapp/i18n/i18n.properties

See documentation:
Localization of UI Texts: localization-of-ui-texts-b8cb649.md
```


**TITLE**: Change Navigation from List Report to Object Page (Disable or Replace with External Navigation)

**INTRODUCTION**: Instructions and manifest.json examples to disable internal List Report -> Object Page navigation or replace it with intent-based external navigation for SAP Fiori Elements (OData V2 and V4). Use these manifest edits to remove nested object page targets or to point navigation to an outbound target defined under sap.app > crossNavigation > outbounds.

**TAGS**: fiori-elements-framework, manifest.json, navigation, OData V2, OData V4, intent-based-navigation, crossNavigation, routing

STEP: Disable internal navigation (OData V2)

DESCRIPTION: Remove the nested ObjectPage "pages" block under sap.ui.generic.app.pages for the ListReport entry in manifest.json to disable navigation from the list report to the object page in the same app. Delete the nested "pages" block (shown in the example) entirely if no internal navigation is required.

LANGUAGE: JSON

CODE:
```json
"sap.ui.generic.app": {
			"pages":[{
				"entitySet": "Zfarvd_Bs_Hd_Bo",
				"component": {
					"name": "sap.suite.ui.generic.template.ListReport",
					"list": true,
					"settings": {
						"gridTable": false,
						"hideTableVariantManagement": false
					}
				},
//Navigation to detail page: eliminate this block if no navigation is needed
				"pages": [{
					"entitySet": "Zfarvd_Bs_Hd_Bo",
					"component": {
						"name": "sap.suite.ui.generic.template.ObjectPage"
					},
```

STEP: Disable internal navigation (OData V4)

DESCRIPTION: Remove the "navigation" section from the corresponding target in the manifest.json routing/targets to disable navigation to an object page or subobject page. Ensure the target definition remains but with no "navigation" entry if you want to prevent internal outbound navigation.

LANGUAGE: JSON

CODE:
```json
{
  "sap.ui5": {
    "routing": {
      "targets": {
        "ArtistList": {
          "options": {
            "settings": {
              "contextPath": "/Artists"
              // "navigation": { ... }  <-- Remove this navigation section to disable internal navigation
            }
          }
        }
      }
    }
  }
}
```

STEP: Replace internal navigation with external intent-based navigation (OData V2)

DESCRIPTION: Define an outbound target under sap.app.crossNavigation.outbounds and reference it from sap.ui.generic.app.pages -> pages -> navigation -> display.path and display.target. Ensure sap.ui.generic.app->_version matches (example shows 1.2.0) and that the display path/target points to an existing outbounds entry.

LANGUAGE: JSON

CODE:
```json
    "sap.app": {
        "_version": "1.2.0",
        ...
        "crossNavigation": {
            "inbounds": {},
            "outbounds": {
                "ExampleNavigationTarget":
                {
                    "semanticObject": "EPMProduct",
                    "action": "manage_st"
                }
            }
        }
    ...
...
    "sap.ui.generic.app": {
        "_version": "1.2.0",
        "pages": [{
            "entitySet": "STTA_C_MP_Product",
            "component": {
                "name": "sap.suite.ui.generic.template.ListReport",
                "list": true
            },
            "pages": [{
                "entitySet": "STTA_C_MP_Product",
                "component": {
                    "name": "sap.suite.ui.generic.template.ObjectPage"
                },
// Navigation to an external target instead of a detail page: Add this block to set up external navigation.
                "navigation": {
                    "display": {
                        "path": "sap.apps.crossNavigation.outbounds",
                        "target": "ExampleNavigationTarget"

```

STEP: Replace internal navigation with external intent-based navigation (OData V4 — routing + outbound using detail -> outbound)

DESCRIPTION: For SAP Fiori Elements OData V4 (sap.ui5 routing), define outbounds under sap.app.crossNavigation.outbounds and reference the outbound from the object page target using navigation -> <association> -> detail -> outbound to trigger external navigation instead of the default internal subobject route. This sample shows routing, targets, and use of "outbound": "ProductDetails".

LANGUAGE: JSON

CODE:
```json
{
…
…
 "sap.app": {
        "crossNavigation": {
            "outbounds": {
                "ProductDetails": {
                    "semanticObject": "ProductDetails",
                    "action": "manage"
                }
            }
        }
 },
"sap.ui5": {
    ....
    ....
    ....
    "routing": {
…
…
        "routes": [{
            "pattern": ":?query:",
            "name": "ArtistList",
            "target": "ArtistList"
        }, {
            "pattern": "Artists({key}):?query:",
            "name": "ArtistDetail",
            "target": "ArtistObjectPage"
        }],
        "targets":{
            "ArtistList": {
                "type": "Component",
                "id": "ArtistList",
                "name": "sap.fe.templates.ListReport",
                "options": {
                    "settings" :{
                        "contextPath": "/Artists",
                        "navigation": {
                            "Artists": {
                                "detail": {
                                    "route": "ArtistObjectPage" // This triggers the regular internal navigation to OP from LR table record
                                }
                            }
                        }
                    }
                }
            }, // End of ArtistList
            "ArtistObjectPage": {
                "type": "Component",
                "id":  "ArtistDetail",
                "name": "sap.fe.templates.ObjectPage",
                "options": {
                    "settings" : {
                        "contextPath": "/Artists",
                        "_tableType" : "Table",
                        "navigation": {
                            "_Publication": {
                                "detail": {
                                    "outbound": "ProductDetails" // This triggers the external navigation to "ProductDetails" instead of the regular internal navigation to the sub-object page
                                }
                            }
                        }
                    }
                }
            } // End of ArtistObjectPage
        } // End of Targets
     }, // End of routing
    .....
    .....
    .....
  } // End of sap.ui
…
…
}
```

STEP: Replace internal navigation with external intent-based navigation (OData V4 — navigation.display using crossNavigation.outbounds)

DESCRIPTION: Alternative to using detail->outbound: use navigation -> <association> -> display with a path to sap.apps.crossNavigation.outbounds and a target name. When both display and detail are present, display takes priority. Ensure the target name matches an outbound entry under sap.app.crossNavigation.outbounds.

LANGUAGE: JSON

CODE:
```json
"navigation": {
    "_Publication": {
        "display":{
            "path":"sap.apps.crossNavigation.outbounds",
            "target":"ProductDetails"
        }
    }
}
```

fiori-elements-framework
manifest.json
navigation
OData V2
OData V4
intent-based-navigation
crossNavigation
routing


**TITLE**: Analytical Chart Cards for Overview Pages

**INTRODUCTION**: Short reference for using analytical (chart) cards in overview pages. Explains behavior and requirements so AI agents can generate configuration and UI code that places analytical charts into overview pages and handles visual behavior.

**TAGS**: fiori-elements-framework, overview-page, analytical-card, chart-card, SAP Fiori, UI

**STEP**: 1 — Purpose and Use Case

**DESCRIPTION**: Analytical chart cards are the chart widgets used in overview pages to present measures and dimensions visually. Use them when you need an at-a-glance analytical visualization inside an overview page. Ensure the card definition supplies the required measures and dimensions (data points) so the framework can render the visualization.

**LANGUAGE**: Plain English

**CODE**:
```text
No code example provided in source.
```

**STEP**: 2 — Visual Behavior and Layout Rules

**DESCRIPTION**: Analytical cards do not have a fixed height. The runtime automatically adjusts a card's height to fit:
- The number of data points visible
- Any legends that are created
Legends are auto-generated based on the measures and dimensions defined in the card configuration. Do not hard-code a card height expecting a fixed chart size — rely on the framework's automatic sizing.

**LANGUAGE**: Plain English

**CODE**:
```text
No code example provided in source.
```

**STEP**: 3 — Implementation Guidance (Actionable Checklist for Code Generation)

**DESCRIPTION**: When generating code or manifest entries for overview pages that include analytical cards, ensure these items are satisfied:
- Declare the card as an analytical/chart type appropriate for the overview page.
- Provide measures and dimensions in the card's data definition so legends can be derived.
- Avoid setting a fixed height for the card; allow automatic layout.
- Verify the data source and mapping of measures/dimensions so the chart renders correctly.

**LANGUAGE**: Plain English

**CODE**:
```text
No code example provided in source.
```

fiori-elements-framework
overview-page
analytical-card
chart-card
SAP Fiori
UI


**TITLE**: Chart Extensions (onBeforeRebindChartExtension for Analytical List Page)

**INTRODUCTION**: Add a controller extension to an Analytical List Page (ALP) to customize chart behavior before rebinding (for example, to supply custom filters or query parameters). This extension uses the onBeforeRebindChartExtension hook provided by the ALP controller. Applicable to SAP Fiori elements for OData V2 only.

**TAGS**: fiori-elements, analytical-list-page, ALP, chart-extension, controller-extension, onBeforeRebindChartExtension, manifest.json, OData V2

**STEP**: 1 — Declare controller extension in manifest.json

**DESCRIPTION**: In your application's manifest.json, declare a controller extension for the ALP base controller (sap.suite.ui.generic.template.AnalyticalListPage.view.AnalyticalListPage). Set the controllerName to the fully qualified name of your extension controller. Place this declaration under the "sap.ui5" section and the "extends" -> "extensions" -> "sap.ui.controllerExtensions" path.

**LANGUAGE**: JSON

**CODE**:
```json
"sap.ui5": {
    "_version": "1.1.0",
	…
	…
"extends": {
		"extensions": {
		"sap.ui.controllerExtensions": {
			"sap.suite.ui.generic.template.AnalyticalListPage.view.AnalyticalListPage": {
				"controllerName": "sap.poc.ftu.apps.alr.ext.controller.AnalyticalListPageExt",
				"sap.ui.generic.app": {
					…
					…
```

**STEP**: 2 — Implement onBeforeRebindChartExtension in the extension controller

**DESCRIPTION**: Create the extension controller with the name specified in manifest.json (for example: sap/poc/ftu/apps/alr/ext/controller/AnalyticalListPageExt.controller.js). Implement the onBeforeRebindChartExtension method to receive the ALP event object (oEvent) and add custom logic—e.g., add filters or modify binding parameters. The sample below shows a minimal implementation that confirms invocation.

**LANGUAGE**: JavaScript

**CODE**:
```javascript
sap.ui.define([], function() {
    return {
        onBeforeRebindChartExtension: function(oEvent) {
            alert('onBeforeRebindChartExtension called!');
        }
    }
})
```

**STEP**: 3 — Usage notes and behavior

**DESCRIPTION**: The ALP framework will call onBeforeRebindChartExtension and pass a chart rebind event object (oEvent). Use oEvent.getSource(), oEvent.getParameter(...) or oEvent.getParameters() as required to extract chart controls, binding contexts, or to add filters/parameters to the rebind. Implement your custom logic inside the onBeforeRebindChartExtension function to modify the chart's binding before the framework issues the request.

fiori-elements
analytical-list-page
ALP
chart-extension
controller-extension
onBeforeRebindChartExtension
manifest.json
OData V2


**TITLE**: Verify Generated SAP Fiori elements (OData V2) Project Structure and Artifacts

**INTRODUCTION**: Quick, action-oriented checklist to validate the generated SAP Fiori elements (OData V2) application after scaffolding and npm install. Use this to confirm the folder layout, key artifact files (Component.js, manifest.json, local annotation files), preview destinations, and run configurations for local testing.

**TAGS**: fiori-elements-framework, sapui5, odata-v2, manifest.json, Component.js, ui5, annotations, localService, i18n, run-config

STEP: 1 — Inspect folder structure and expected artifacts

DESCRIPTION: Verify that the generator created the app skeleton and standard folders/files for a List Report + Object Page app. Confirm presence of app descriptor, component, localService, i18n, and UI5 configuration files. If available, open the folder structure image referenced by the generator docs.

LANGUAGE: FilePaths

CODE:
```text
Expected top-level files and folders:
- webapp/
  - Component.js
  - manifest.json
  - index.html
  - localService/
    - metadata.xml
    - SEPMRA_PROD_MAN_ANNO_MDL.xml
  - i18n/
    - i18n.properties
  - view/     (views reused from sap.suite.ui.generic.template)
  - controller/
  - images/
- ui5*.yaml   (UI5 tooling preview/destination configuration)
- package.json
```

STEP: 2 — Verify Component.js (do not edit)

DESCRIPTION: Confirm Component.js exists at webapp/Component.js. This SAPUI5 component bootstraps the app and links to manifest.json for routing, templates, and OData/annotation references. Do not modify this file unless you understand the framework implications.

LANGUAGE: JavaScript

CODE:
```javascript
// File: webapp/Component.js
// This file is generated. Do not edit unless required.
// It initializes the component and reads configuration from manifest.json
sap.ui.define([
  "sap/ui/core/UIComponent"
], function (UIComponent) {
  "use strict";
  return UIComponent.extend("your.namespace.Component", {
    metadata: {
      manifest: "json"
    }
  });
});
```

STEP: 3 — Inspect manifest.json for service and annotation links

DESCRIPTION: Open webapp/manifest.json and confirm the OData service and annotations are configured under "sap.app" / "sap.ui5" -> "models" and "dataSources". Local annotation files (localService/...) should be listed if generator created them. Local annotations (annotations.xml) take precedence over backend annotation links.

LANGUAGE: JSON

CODE:
```json
// File: webapp/manifest.json (relevant sections)
{
  "sap.app": {
    "id": "your.namespace",
    "applicationVersion": { "version": "1.0.0" }
  },
  "sap.ui5": {
    "models": {
      "": {
        "dataSource": "mainService"
      },
      "annotations": {
        "dataSource": "annotations"
      }
    },
    "dataSources": {
      "mainService": {
        "uri": "/sap/opu/odata/sap/SEPMRA_PROD_MAN_SRV/",
        "type": "OData",
        "settings": { "odataVersion": "2.0" }
      },
      "annotations": {
        "uri": "localService/SEPMRA_PROD_MAN_ANNO_MDL.xml",
        "type": "ODataAnnotation"
      }
    }
  }
}
```

STEP: 4 — Check localService and annotation precedence

DESCRIPTION: Ensure the generated localService files exist for local testing. If a local annotations file (annotations.xml) is present in the project, it will override annotations provided by the backend/catalog service when running locally.

LANGUAGE: FilePaths / XML

CODE:
```text
Local test files (webapp/localService/):
- webapp/localService/metadata.xml
- webapp/localService/SEPMRA_PROD_MAN_ANNO_MDL.xml

Annotation precedence:
- If webapp/annotations.xml exists -> used for preview/local test
- Else -> annotations are fetched from backend/catalog (as configured in manifest.json)
```

STEP: 5 — Verify ui5 preview destination configuration (ui5*.yaml)

DESCRIPTION: Open any ui5*.yaml files at project root to adapt preview destinations used by the Fiori Tools Run Configurations. Adjust these destination entries to point to the correct backend/annotation locations for local preview.

LANGUAGE: YAML

CODE:
```yaml
# File: ui5-deploy.yaml or ui5.yaml (example structure)
specVersion: '2.1'
metadata:
  name: your-app
server:
  customMiddleware: []
connectivity:
  destinations:
    - name: backend
      url: https://example-backend.example.com
    - name: annotations
      url: https://example-backend.example.com/annotations
```

STEP: 6 — Use Run Configurations for preview (Fiori Tools)

DESCRIPTION: Use the VS Code command palette to open and adapt run configurations (destinations, launch options). This launches the UI5 preview using the destinations defined in ui5*.yaml or workspace settings.

LANGUAGE: Command

CODE:
```text
Command Palette:
- Execute: Fiori: Open Run Configurations
Actions:
- Select a run configuration
- Edit destinations for preview (backend, annotations)
- Start Preview to run the generated app locally
```

STEP: 7 — Localization and shell bar metadata

DESCRIPTION: Check i18n resource files for UI texts and the manifest for app subtitle and shell icon configuration. Maintain UI texts in i18n properties and reference them from manifest.json and views.

LANGUAGE: FilePaths / JSON

CODE:
```text
Localization files:
- webapp/i18n/i18n.properties

Manifest entries:
- webapp/manifest.json -> sap.app (title, description), sap.ui (icon, shell parameters)
```


**TITLE**: Choosing Filter Modes for Analytical List Page (ALP)

**INTRODUCTION**: Describes visual and compact filter modes in the Analytical List Page (ALP), how they synchronize, how to customize which fields/charts appear on the filter bar, and extra visual-filter capabilities available in SAP Fiori Elements for OData V2.

**TAGS**: fiori-elements-framework, analytical-list-page, ALP, visual-filter, compact-filter, filter-bar, annotations, ODataV2, value-help

**STEP**: 1 — Filter modes overview

**DESCRIPTION**: Understand the two ALP filter modes and their interaction. The ALP provides:
- Visual filter mode (chart-based visual selectors).
- Compact filter mode (regular filter fields).
- Toggling between modes is supported while filters are applied; values synchronize between modes.
- Filter fields that do not have a visual-filter annotation appear only in compact mode.
- Every field configured for the visual filter also appears in compact mode.

**LANGUAGE**: text

**CODE**:
```text
Visual filter <-> Compact filter synchronization:
- Toggling modes preserves and syncs filter values.
- Fields without visual-filter configuration are visible only in Compact filter.
- Fields with visual-filter configuration appear in both Visual and Compact filters.
```

**STEP**: 2 — Customize which filters and visual charts appear on the filter bar

**DESCRIPTION**: Use the UI adaptation to select which fields and charts appear in either filter mode. This affects both visual and compact filters.

- Use "Adapt Filters (<number>)" in the ALP header area to add/remove filter fields and visual filters.
- The number in parentheses is the count of selected filter fields (explained in Step 4).

**LANGUAGE**: text

**CODE**:
```text
UI action: Header > Adapt Filters (<number>)
- Open Adapt Filters to add/remove filter fields and visual filter charts.
- Changes apply to both Visual and Compact filter modes.
```

**STEP**: 3 — Filter selection count behavior

**DESCRIPTION**: The filter selection count shown in the header indicates the number of filter fields that currently have selections applied. Important details:
- The count is based on the number of fields with set filter conditions, not the number of filter values.
- The count includes filters applied from the filter dialog even if those fields are not visible on the filter bar.

**LANGUAGE**: text

**CODE**:
```text
Filter count rules:
- Count = number of fields with active filter conditions.
- Not based on number of values within a field.
- Includes filters set via filter dialog, including those not visible on the filter bar.
```

**STEP**: 4 — Behavior when using Visual Filter mode

**DESCRIPTION**: When the user is in visual filter mode:
- All filter values from the regular (compact) filter bar are applied to the main content area, including compact-only fields (fields without visual-filter configuration).
- Visual filter supports switching chart type, sort order, and measure (OData V2 only).
- Supported visual chart types: bar, donut, line.

**LANGUAGE**: text

**CODE**:
```text
Visual Filter behaviors (OData V2):
- Visual filter applies all compact filter values to the main content area.
- User can change: chart type (bar, donut, line), sort order, and measure for visual filters.
- Fields lacking visual-filter annotation: not shown as visual charts, but their filter values still apply.
```

**STEP**: 5 — Annotation configuration guidance (high-level)

**DESCRIPTION**: The presence of a field in visual or compact filter mode is determined by the annotation configuration for that field. When preparing annotations or CDS for ALP:
- Configure visual-filter related annotations for dimensions you want charted/visualized.
- Ensure selection fields are exposed so they appear on the compact filter bar.
- ValueList annotations (value help) are used to map main-entity fields to value help entities; these support visual filters where applicable.

Preserve links to detailed annotation guidance:
- Configuring the Title Area
- Managing Variants
- Enhancing ValueList Annotations for Visual Filters

**LANGUAGE**: text

**CODE**:
```text
Annotation guidance:
- Use selection field annotations to expose fields in compact filters.
- Use visual-filter annotations (per your project annotation mechanism) to expose fields as visual filters.
- Use ValueList annotations to connect fields to value helps used by filters.

Related documents:
- configuring-the-title-area-ebdb5da.md
- managing-variants-8ce658e.md
- enhancing-valuelist-annotations-for-visual-filters-16d43eb.md
```

fiori-elements-framework analytical-list-page ALP visual-filter compact-filter filter-bar annotations ODataV2 value-help


**TITLE**: Coloring Column Chart Cards by Threshold Values (Fiori Elements - Overview Pages)

**INTRODUCTION**: Use semantic coloring for column-chart cards on Fiori overview pages by associating a data point annotation (ThresholdValues & ImprovementDirection) with the measure used in the analytic card. Recommended for single-measure charts. This document describes required conditions, legend behavior, and precise threshold-to-color mappings for target, maximizing, and minimizing measures.

**TAGS**: fiori-elements-framework, overview-page, semantic-coloring, threshold, KPI, annotation, data-point

**STEP**: 1 — Preconditions and Recommended Setup

**DESCRIPTION**: Ensure your measure and its associated data point satisfy the required conditions before enabling semantic coloring on a column chart card. Prefer using a single measure per chart for meaningful legends and coloring.

- Required conditions for a measure to support semantic coloring:
  - The measure must have a data point annotation that provides the improvement direction (ImprovementDirection). Typical directions:
    - Maximizing (higher values are better)
    - Minimizing (lower values are better)
    - Target (preferred within a range)
  - The data point must include the threshold values described below (ToleranceRangeLowValue, ToleranceRangeHighValue, DeviationRangeLowValue, DeviationRangeHighValue).

- Legend behavior:
  - If a single measure satisfies the conditions, legend displays the threshold values and semantic labels.
  - If multiple measures satisfy the conditions, each measure is semantically colored according to its thresholds but the legend becomes less meaningful.
  - If some measures lack the required data point/thresholds, those measures are colored black; the ones with thresholds are semantically colored.

**LANGUAGE**: TEXT

**CODE**:
```text
Required data point annotation elements:
- ImprovementDirection (e.g. Maximize, Minimize, Target)
- ThresholdValues:
    - ToleranceRangeLowValue
    - ToleranceRangeHighValue
    - DeviationRangeLowValue
    - DeviationRangeHighValue
```

**STEP**: 2 — Target Measure (example: temperature) — Threshold-to-Color Mapping

**DESCRIPTION**: For a "Target" improvement direction, define thresholds so the chart segments are colored according to ranges around a preferred target zone. Use the following comparisons against the measure value to map "From -> To" semantic segments.

Keep the exact threshold property names in your data point annotation: ThresholdValues.DeviationRangeLowValue, ThresholdValues.ToleranceRangeLowValue, ThresholdValues.ToleranceRangeHighValue, ThresholdValues.DeviationRangeHighValue.

**LANGUAGE**: TEXT

**CODE**:
```text
Target Measure (improvement direction = Target)
Mapping (From -> To) and condition on Measure Value:

From      -> To        : Measure Value condition
Negative  -> Critical  : >= ThresholdValues.DeviationRangeLowValue
Critical  -> Positive  : >= ThresholdValues.ToleranceRangeLowValue
Positive  -> Critical  : >  ThresholdValues.ToleranceRangeHighValue
Critical  -> Negative  : >  ThresholdValues.DeviationRangeHighValue
```

(Images illustrating Target measure examples: images/Target_Measure_9329c7a.png, images/ovp_semanticcolor_target_b57af63.png)

**STEP**: 3 — Maximizing Measure (example: sales) — Threshold-to-Color Mapping

**DESCRIPTION**: For a "Maximize" improvement direction, map thresholds so larger values are better. Use the specified ThresholdValues properties in the data point annotation.

**LANGUAGE**: TEXT

**CODE**:
```text
Maximizing Measure (improvement direction = Maximize)
Mapping (From -> To) and condition on Measure Value:

From      -> To        : Measure Value condition
Negative  -> Critical  : >= ThresholdValues.DeviationRangeLowValue
Critical  -> Positive  : >= ThresholdValues.ToleranceRangeLowValue
```

(Images illustrating Maximizing measure examples: images/Maximizing_Measure_0f242d3.png, images/ovp_semanticcolor_max_c16efec.png)

**STEP**: 4 — Minimizing Measure (example: cost) — Threshold-to-Color Mapping

**DESCRIPTION**: For a "Minimize" improvement direction, map thresholds so smaller values are better. Use the specified ThresholdValues properties in the data point annotation.

**LANGUAGE**: TEXT

**CODE**:
```text
Minimizing Measure (improvement direction = Minimize)
Mapping (From -> To) and condition on Measure Value:

From      -> To        : Measure Value condition
Positive  -> Critical  : > ThresholdValues.ToleranceRangeHighValue
Critical  -> Negative  : > ThresholdValues.DeviationRangeHighValue
```

**STEP**: 5 — Implementation Notes for Developers

**DESCRIPTION**: Actionable guidance when implementing semantic coloring in your Fiori Elements overview page:

- Attach a DataPoint annotation to the measure used by the analytic card. Ensure ImprovementDirection and ThresholdValues are present.
- Prefer a single measure per chart card for clear legend/threshold display.
- If multiple measures are used and all have thresholds, charts will still color each measure by its own thresholds, but legends may not be useful.
- If some measures lack thresholds, those measures will render in default (black) color.

**LANGUAGE**: TEXT

**CODE**:
```text
Developer checklist:
- Confirm dataPoint/ImprovementDirection is set for the measure.
- Confirm ThresholdValues (ToleranceRangeLow/High, DeviationRangeLow/High) exist.
- Test chart rendering with single measure first to verify legend shows threshold values.
- When multiple measures are present, validate expected coloring and legend behavior.
```

fiori-elements-framework overview-page semantic-coloring threshold KPI annotation data-point


**TITLE**: Column Chart Card (OVP / Fiori Elements)

**INTRODUCTION**: Use a Column Chart Card to display categorical data as vertical bars (columns), e.g., total product sales per year. This doc gives the implementation checklist and concrete annotation + manifest examples required to render a Column Chart Card in an OVP/Fiori Elements app.

**TAGS**: fiori-elements-framework, OVP, column-chart, annotations, manifest, measures, dimensions

STEP: 1 - Requirements and behavior
DESCRIPTION: Ensure your entity/annotation contains at least one measure and one dimension. Implementation rules (enforced at runtime):
- The chart must have >= 1 measure and >= 1 dimension.
- The number of columns equals the number of measures defined in the chart annotation.
- Every measure is rendered as a separate column regardless of its annotation role.
- Every dimension is placed on the x-axis (axis category) regardless of its annotation role.
LANGUAGE: Plain text
CODE:
```text
Requirements:
- >= 1 measure (each measure => one column)
- >= 1 dimension (used for x-axis)
- Measures and dimensions are taken from the chart annotation
```

STEP: 2 - Example Chart Annotation (XML)
DESCRIPTION: Create a Chart annotation on the target entity type. Set ChartType="Column" and list your measures and dimensions. Adjust property names, annotation target, and qualifier to match your service model.
LANGUAGE: XML
CODE:
```xml
<!-- Example annotation: adjust Target and property names to your model -->
<Annotations Target="YourService.YourEntityType">
  <Annotation Term="UI.Chart" Qualifier="ColumnChart">
    <Record Type="UI.Chart">
      <PropertyValue Property="ChartType" String="Column" />
      <PropertyValue Property="Measures">
        <Collection>
          <PropertyPath>SalesAmount</PropertyPath>
          <PropertyPath>Profit</PropertyPath>
        </Collection>
      </PropertyValue>
      <PropertyValue Property="Dimensions">
        <Collection>
          <PropertyPath>Year</PropertyPath>
        </Collection>
      </PropertyValue>
    </Record>
  </Annotation>
</Annotations>
```

STEP: 3 - OVP Card Configuration in manifest.json
DESCRIPTION: Configure the OVP card to use the charts template and point to the Chart annotation via annotationPath. Replace entitySet and annotationPath values for your application.
LANGUAGE: JSON
CODE:
```json
"cards": {
  "salesColumnChart": {
    "template": "sap.ovp.cards.charts",
    "settings": {
      "title": "Product Sales by Year",
      "entitySet": "SalesSet",
      "annotationPath": "com.sap.vocabularies.UI.v1.Chart#ColumnChart"
    }
  }
}
```

STEP: 4 - Troubleshooting and validation
DESCRIPTION: Validate these points when the column chart does not render:
- Confirm the Chart annotation qualifier in the annotationPath matches the qualifier in the annotation (case-sensitive).
- Verify the entitySet has the properties referenced in Measures and Dimensions.
- Ensure at least one measure and one dimension are present.
LANGUAGE: Plain text
CODE:
```text
Troubleshooting checklist:
- annotationPath qualifier matches annotation qualifier
- properties exist on the entity type
- chart has >=1 measure and >=1 dimension
```

STEP: 5 - Example image reference
DESCRIPTION: Reference example image for UI expectation (relative image path kept from original docs).
LANGUAGE: Markdown
CODE:
```markdown
![](../01_Whats-New/images/WhatsNew_138_OVP_ColumnChart_d3b0ca9.png "Example of a Column Chart Card")
```

fiori-elements-framework OVP column-chart annotations manifest measures dimensions


**TITLE**: Column Micro Chart — UI.Chart and UI.DataPoint Annotations

**INTRODUCTION**: Provide the annotations required to render a Column Micro Chart in Fiori Elements. Includes XML, ABAP CDS, and CAP CDS examples for UI.Chart (chart definition) and UI.DataPoint (value and criticality). Use these directly when generating code or annotation files. Note: chart dimensions and measures must come from a 1:n navigation entity (cannot be from the same entity).

**TAGS**: fiori-elements-framework, column-chart, microchart, annotations, UI.Chart, UI.DataPoint, ABAP, CAP, XML, CDS

**STEP**: 1 — Overview and mapping

**DESCRIPTION**: Key annotation mapping and chart semantics you must implement:
- UI.Chart Title → Title property (chart title).
- UI.Chart Description → Description property (subtitle).
- ChartType must be Column for a column micro chart.
- Measures and Dimensions must be specified (dimensions/measures from a 1:n navigation entity).
- Each measured series must reference a DataPoint via MeasureAttributes → DataPoint.
- UI.DataPoint must provide Value (path) and optional Criticality or CriticalityCalculation.
- If both Criticality and CriticalityCalculation exist, Criticality overrides CriticalityCalculation.
- For CriticalityCalculation, also include ImprovementDirection.

**LANGUAGE**: Text

**CODE**:
```text
Mapping summary:
- UI.Chart Title -> Title
- UI.Chart Description -> Description
- UI.Chart ChartType = Column
- UI.Chart Measures -> list of measure property paths
- UI.Chart Dimensions -> list of dimension property paths
- UI.Chart MeasureAttributes -> each must include Measure, Role, DataPoint (annotation path)
- UI.DataPoint -> must include Value (path); may include Criticality or CriticalityCalculation
- Criticality overrides CriticalityCalculation; if using CriticalityCalculation include ImprovementDirection
Requirement: Measures and Dimensions cannot be from the same entity; use a 1:n navigation entity.
```

**STEP**: 2 — UI.Chart XML Annotation (Column chart)

**DESCRIPTION**: Copy this XML annotation to define a Column micro chart. Set ChartType to Column, define Measures and Dimensions, and include MeasureAttributes with DataPoint annotation path.

**LANGUAGE**: XML

**CODE**:
```xml
<Annotation Term="UI.Chart" Qualifier="SpecificationWidthColumnChart">
    <Record Type="UI.ChartDefinitionType">
        <PropertyValue Property="Title" String="Product Width Specification Column Chart"/>
        <PropertyValue Property="Description" String="Describe Column Chart"/>
        <PropertyValue Property="ChartType" EnumMember="UI.ChartType/Column"/>
        <PropertyValue Property="Measures">
            <Collection>
                <PropertyPath>Width</PropertyPath>
            </Collection>
        </PropertyValue>
        <PropertyValue Property="Dimensions">
            <Collection>
                <PropertyPath>Day</PropertyPath>
            </Collection>
        </PropertyValue>
        <PropertyValue Property="MeasureAttributes">
            <Collection>
                <Record Type="UI.ChartMeasureAttributeType">
                    <PropertyValue Property="Measure" PropertyPath="Width"/>
                    <PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis1"/>
                    <PropertyValue Property="DataPoint" AnnotationPath="@UI.DataPoint#Width"/>
                </Record>
            </Collection>
        </PropertyValue>
    </Record>
</Annotation>
```

**STEP**: 3 — UI.Chart ABAP CDS Annotation (Column chart)

**DESCRIPTION**: Use this ABAP CDS fragment inside an annotation file or view annotation section. It defines the same Column chart — measures, dimensions, measureAttributes with qualifier.

**LANGUAGE**: ABAP CDS

**CODE**:
```
@UI.Chart: [
  {
    title: 'Product Width Specification Column Chart',
    description: 'Describe Column Chart',
    chartType: #COLUMN,
    measures: [
      'WIDTH'
    ],
    dimensions: [
      'DAY'
    ],
    measureAttributes: [
      {
        measure: 'Width',
        role: #AXIS_1,
        asDataPoint: true
      }
    ],
    qualifier: 'SpecificationWidthColumnChart'
  }
]
annotate view STTA_C_MP_PRODUCT with {

}
```

**STEP**: 4 — UI.Chart CAP CDS Annotation (Column chart)

**DESCRIPTION**: CAP CDS syntax equivalent for the UI.Chart definition. Include qualifier and DataPoint reference in MeasureAttributes.

**LANGUAGE**: CAP CDS

**CODE**:
```
UI.Chart #SpecificationWidthColumnChart : {
    $Type : 'UI.ChartDefinitionType',
    Title : 'Product Width Specification Column Chart',
    Description : 'Describe Column Chart',
    ChartType : #Column,
    Measures : [
        Width
    ],
    Dimensions : [
        Day
    ],
    MeasureAttributes : [
        {
            $Type : 'UI.ChartMeasureAttributeType',
            Measure : Width,
            Role : #Axis1,
            DataPoint : '@UI.DataPoint#Width',
        }
    ]
}
```

**STEP**: 5 — UI.DataPoint XML Annotation (Value + Criticality)

**DESCRIPTION**: Use this XML DataPoint annotation to bind the measure value and criticality for semantic coloring. Attach this DataPoint via MeasureAttributes → DataPoint.

**LANGUAGE**: XML

**CODE**:
```xml
<Annotation Term="UI.DataPoint" Qualifier="Width">
    <Record>
        <PropertyValue Property="Value" Path="Width"/>
        <PropertyValue Property="Criticality" Path="criticalityValue"/>
    </Record>
</Annotation>
```

**STEP**: 6 — UI.DataPoint ABAP CDS Annotation (Value + Criticality)

**DESCRIPTION**: ABAP CDS fragment showing DataPoint annotation with target value and criticality path. Use in CDS field definition or annotations block.

**LANGUAGE**: ABAP CDS

**CODE**:
```
@UI.dataPoint: {
  targetValueElement: 'Weight',
  criticality: 'criticalityValue'
}
Width;
```

**STEP**: 7 — UI.DataPoint CAP CDS Annotation (Value + Criticality)

**DESCRIPTION**: CAP CDS syntax for DataPoint annotation. Use qualifier to reference from MeasureAttributes.

**LANGUAGE**: CAP CDS

**CODE**:
```
UI.DataPoint #Width : {
    Value : Width,    Criticality : criticalityValue
}
```

**STEP**: 8 — Mandatory annotations and criticality rules (Checklist)

**DESCRIPTION**: Checklist to validate before code generation or deployment. Ensure each mandatory annotation exists and criticality rules are implemented properly.

**LANGUAGE**: Text

**CODE**:
```text
Mandatory annotations checklist:
- UI.Chart -> ChartType = "Column" (required)
- UI.Chart -> Measures (required)
- UI.Chart -> MeasureAttributes -> DataPoint (must reference a UI.DataPoint qualifier)
- UI.DataPoint -> Value (required)
- If using CriticalityCalculation for semantic coloring:
  - UI.DataPoint -> CriticalityCalculation (required)
  - UI.DataPoint -> CriticalityCalculation/ImprovementDirection (required)
Notes:
- Both Criticality and CriticalityCalculation are supported; Criticality overrides CriticalityCalculation.
- Measures and Dimensions must come from a 1:n navigation entity (cannot be from the same entity).
```

fiori-elements-framework column-chart microchart annotations UI.Chart UI.DataPoint ABAP CAP XML CDS


**TITLE**: Combination Chart Card - Annotation Examples and Implementation Rules

**INTRODUCTION**: This document explains how to define a Combination Chart Card (column + line) using UI.Chart annotations. It lists actionable rules and provides XML, ABAP CDS, and CAP CDS code examples that can be copied into Fiori Elements/OData service annotations to render combination charts. Use these examples to implement charts that combine multiple measure types (columns and lines) and map dimensions to category/series roles.

**TAGS**: fiori-elements-framework, UI.Chart, combination-chart, annotations, CDS, ABAP, CAP, XML, chart

**STEP**: 1 - Rules and Implementation Guidelines

**DESCRIPTION**: Follow these actionable rules when creating a combination chart card:
- The chart type must be set to Combination (UI.ChartType/Combination or #COMBINATION / #Combination depending on annotation syntax).
- You must have at least two measures. The first measure is rendered as columns; subsequent measures are rendered as lines.
- Use one time-based dimension for the category axis where applicable (recommended).
- All measures are assigned to the feed's UID value axis; ensure measures are declared in MeasureAttributes.
- At least one category role must be defined in DimensionAttributes to map a dimension to the category axis.
- Use Series role to enable color-coded grouping (each series member is displayed with its own color combination).
- Qualifier is optional but useful for multiple charts on the same entity/view; keep the qualifier consistent between annotation definition and usage.

**LANGUAGE**: Text

**CODE**:
```text
- First measure: column format
- Subsequent measures: line format
- At least two measures required
- At least one category dimension required
- Use qualifier to distinguish multiple chart annotations
```

**STEP**: 2 - XML Annotation Example

**DESCRIPTION**: Copy this XML UI.Chart annotation into your annotation file (e.g., annotations.xml). It defines a combination chart titled "Sales and Total Sales", using 'sales' and 'totalsales' measures on Axis1 and 'quarter_1' as the category dimension. Keep the Qualifier to reference this chart where needed.

**LANGUAGE**: XML

**CODE**:
```xml
<Annotation Term="UI.Chart" Qualifier="Eval_by_Currency_Combination">
    <Record Type="UI.ChartDefinitionType">
        <PropertyValue Property="Title" String="Sales and Total Sales" />
        <PropertyValue Property="ChartType" EnumMember="UI.ChartType/Combination"/>
        <PropertyValue Property="MeasureAttributes">
            <Collection>
                <Record Type="UI.ChartMeasureAttributeType">
                        <PropertyValue Property="Measure" PropertyPath="sales" />
                        <PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis1" />
                </Record>
                <Record Type="UI.ChartMeasureAttributeType">
                    <PropertyValue Property="Measure" PropertyPath="totalsales" />
                    <PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis1" />
                </Record>
            </Collection>
        </PropertyValue>
        <PropertyValue Property="DimensionAttributes">
            <Collection>
                <Record Type="UI.ChartDimensionAttributeType">
                    <PropertyValue Property="Dimension" PropertyPath="quarter_1" />
                    <PropertyValue Property="Role" EnumMember="UI.ChartDimensionRoleType/Category" />
                </Record>
            </Collection>
        </PropertyValue>
    </Record>
</Annotation>
```

**STEP**: 3 - ABAP CDS Annotation Example

**DESCRIPTION**: Use this ABAP CDS annotation snippet inside your CDS view annotations section. It produces the same chart definition (qualifier: Eval_by_Currency_Combination). Insert the annotation above the view or in a dedicated annotation include file and reference it from the Fiori Elements app manifest or OData metadata.

**LANGUAGE**: ABAP

**CODE**:
```
@UI.Chart: [
  {
    title: 'Sales and Total Sales',
    chartType: #COMBINATION,
    measureAttributes: [
      {
        measure: 'sales',
        role: #AXIS_1
      },
      {
        measure: 'totalsales',
        role: #AXIS_1
      }
    ],
    dimensionAttributes: [
      {
        dimension: 'quarter_1',
        role: #CATEGORY
      }
    ],
    qualifier: 'Eval_by_Currency_Combination'
  }
]
annotate view VIEWNAME with { }
```

**STEP**: 4 - CAP CDS Annotation Example

**DESCRIPTION**: For CAP-based services, add this UI.Chart annotation to your CDS service definitions (e.g., in srv/ or annotations.cds). It defines the same combination chart and qualifier. Ensure measure and dimension names match your entity model.

**LANGUAGE**: CDS

**CODE**:
```
UI.Chart #Eval_by_Currency_Combination : {
    $Type : 'UI.ChartDefinitionType',
    Title : 'Sales and Total Sales',
    ChartType : #Combination,
    MeasureAttributes : [
        {
            $Type : 'UI.ChartMeasureAttributeType',
            Measure : sales,
            Role : #Axis1
        },
        {
            $Type : 'UI.ChartMeasureAttributeType',
            Measure : totalsales,
            Role : #Axis1
        }
    ],
    DimensionAttributes : [
        {
            $Type : 'UI.ChartDimensionAttributeType',
            Dimension : quarter_1,
            Role : #Category
        }
    ]
}
```

fiori-elements-framework UI.Chart combination-chart annotations CDS ABAP CAP XML chart


**TITLE**: Comparison Micro Chart Annotations for SAP Fiori elements (OData V4)

**INTRODUCTION**: This document shows the exact annotations required to implement a Comparison Micro Chart in SAP Fiori elements for OData V4. It includes required constraints, behavior rules, and full example annotations in XML, ABAP CDS, and CAP CDS for UI.Chart and UI.DataPoint.

**TAGS**: fiori-elements-framework, OData V4, UI.Chart, UI.DataPoint, ComparisonMicroChart, CDS, XML, ABAP, CAP, microchart

**STEP**: 1 — Requirements and constraints

**DESCRIPTION**: Mandatory annotations, chart constraints, display behavior, and semantic coloring rules you must follow when implementing the Comparison Micro Chart.

- Applicable only for SAP Fiori elements for OData V4.
- Chart shows a single measure value against a maximum value. Only the first three backend values are shown.
- Dimensions on the chart must be from a 1:n navigation entity; dimensions and measures cannot be from the same entity.
- Unit of measure must be consistent across all data points.
- Display value rules:
  - If UI.DataPoint Value has no @Common.Text annotation, the numeric Value is displayed.
  - If the DataPoint has an associated text via @com.sap.vocabularies.Common.v1.Text, the TextValue is displayed instead.
- Semantic coloring: only the Criticality annotation is supported.
- Mandatory annotations to include:
  - UI.Chart → ChartType: "Bar"
  - UI.Chart → Dimensions
  - UI.Chart → Measures
  - UI.Chart → MeasureAttributes → DataPoint
  - UI.DataPoint → Value

**LANGUAGE**: TEXT

**CODE**:
```text
Applicable: SAP Fiori elements for OData V4
Mandatory: UI.Chart ChartType=Bar, Dimensions, Measures, MeasureAttributes->DataPoint, UI.DataPoint->Value
Constraints: Dimensions and Measures must not be from the same entity (use 1:n navigation entity)
Unit consistency required across data points
Semantic coloring: only Criticality supported
Display rule: If DataPoint has Text via @com.sap.vocabularies.Common.v1.Text, show TextValue; otherwise show Value
```

**STEP**: 2 — UI.Chart Annotation (XML example)

**DESCRIPTION**: Chart definition using XML annotations. Sets ChartType to Bar, defines dimension SalesOrderItem, assigns NetAmount as Measure and attaches a DataPoint via AnnotationPath. Title and Description are demonstrated.

**LANGUAGE**: XML

**CODE**:
```xml
<Annotation Term="UI.Chart" Qualifier="ComparisonPath">
    <Record Type="UI.ChartDefinitionType">
        <PropertyValue Property="ChartType" EnumMember="UI.ChartType/Bar"/>
        <PropertyValue Property="Description" String="Testing Comparison Chart"/>
        <PropertyValue Property="Dimensions">
            <Collection>
                <PropertyPath>SalesOrderItem</PropertyPath>
            </Collection>
        </PropertyValue>
        <PropertyValue Property="MeasureAttributes">
            <Collection>
                <Record Type="UI.ChartMeasureAttributeType">
                    <PropertyValue Property="Measure" PropertyPath="NetAmount"/>
                    <PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis1"/>
                    <PropertyValue Property="DataPoint" AnnotationPath="@UI.DataPoint#ComparisonPath"/>
                </Record>
            </Collection>
        </PropertyValue>
        <PropertyValue Property="Measures">
            <Collection>
                <PropertyPath>NetAmount</PropertyPath>
            </Collection>
        </PropertyValue>
        <PropertyValue Property="Title" String="Items Comparison Chart"/>
    </Record>
</Annotation>
```

**STEP**: 3 — UI.Chart Annotation (ABAP CDS example)

**DESCRIPTION**: Equivalent chart definition for ABAP CDS. Declares chartType BAR, dimensions, measureAttributes with asDataPoint true and qualifier ComparisonPath.

**LANGUAGE**: ABAP CDS

**CODE**:
```
@UI.Chart: [
  {
    chartType: #BAR,
    description: 'Testing Comparison Chart',
    dimensions: [
      'SALESORDERITEM'
    ],
    measureAttributes: [
      {
        measure: 'NetAmount',
        role: #AXIS_1,
        asDataPoint: true
      }
    ],
    measures: [
      'NETAMOUNT'
    ],
    title: 'Items Comparison Chart',
    qualifier: 'ComparisonPath'
  }
]
annotate view STTA_C_MP_PRODUCT with {

}
```

**STEP**: 4 — UI.Chart Annotation (CAP CDS example)

**DESCRIPTION**: CAP CDS variant of the UI.Chart annotation. Uses qualifier ComparisonPath and references DataPoint via '@UI.DataPoint#ComparisonPath'.

**LANGUAGE**: CAP CDS

**CODE**:
```
UI.Chart #ComparisonPath : {
    $Type : 'UI.ChartDefinitionType',
    ChartType : #Bar,
    Description : 'Testing Comparison Chart',
    Dimensions : [
        SalesOrderItem
    ],
    MeasureAttributes : [
        {
            $Type : 'UI.ChartMeasureAttributeType',
            Measure : NetAmount,
            Role : #Axis1,
            DataPoint : '@UI.DataPoint#ComparisonPath'
        },
    ],
    Measures : [
        NetAmount
    ],
    Title : 'Items Comparison Chart'
}
```

**STEP**: 5 — UI.DataPoint Annotation (XML example)

**DESCRIPTION**: Defines DataPoint for the measure including Value path, Criticality, MaximumValue, and MinimumValue. This configures criticality-based coloring and scale.

**LANGUAGE**: XML

**CODE**:
```xml
<Annotation Term="UI.DataPoint" Qualifier="NetAmount">
      <Record Type="UI.DataPointType">
            <PropertyValue Property="Value" Path="NetAmount"/>
            <PropertyValue Property="Criticality" Path="Criticality"/>
            <PropertyValue Property="MaximumValue" Decimal="100"/>
            <PropertyValue Property="MinimumValue" Decimal="0"/>
      </Record>
</Annotation>
```

**STEP**: 6 — UI.DataPoint Annotation (ABAP CDS example)

**DESCRIPTION**: ABAP CDS example for attaching criticality and min/max values to the measure NetAmount.

**LANGUAGE**: ABAP CDS

**CODE**:
```
@UI.dataPoint: {
  criticality: 'Criticality'
  maximumValue: 100,
  minimumValue: 0
}
NetAmount;
```

**STEP**: 7 — UI.DataPoint Annotation (CAP CDS example)

**DESCRIPTION**: CAP CDS example defining a DataPoint with Value, Criticality, MaximumValue, and MinimumValue. Use qualifier name as required in your Chart MeasureAttributes.

**LANGUAGE**: CAP CDS

**CODE**:
```
UI.DataPoint #NetAmount              : {
            Value       : NetAmount,
            Criticality : Criticality,
            MaximumValue : 100,
            MinimumValue : 0,
        }
```

fiori-elements-framework
OData V4
UI.Chart
UI.DataPoint
ComparisonMicroChart
CDS
XML
ABAP
CAP
microchart


**TITLE**: Configure EntitySet Input Parameters using com.sap.vocabularies.UI.v1.SelectionVariant

**INTRODUCTION**: Demonstrates how to configure input parameters for an EntitySet using the SelectionVariant annotation (com.sap.vocabularies.UI.v1.SelectionVariant) for SAP Fiori elements (OData V2). Use this to provide parameters for parameter entity sets (sap:semantics="parameters"), associate them with result entity sets, and wire the selection variant into OVP cards via manifest settings.

**TAGS**: fiori-elements-framework, OData V2, SelectionVariant, annotations, com.sap.vocabularies.UI.v1.SelectionVariant, CDS, manifest, sap.ovp, parameters, entityset

**STEP**: 1 — Applicability and overview
**DESCRIPTION**: This approach applies only to SAP Fiori elements for OData V2. Use SelectionVariant annotations to declare Parameters that will be applied at runtime to query an EntitySet that exposes a parameter-typed navigation association. Typical pattern: a parameter entity (sap:semantics="parameters") defines parameters and a navigation property "Results" points to the result EntityType (e.g., SalesShare). The SelectionVariant record (annotated on the result EntityType) supplies concrete parameter values.
**LANGUAGE**: text
**CODE**:
```text
Applicability: SAP Fiori elements for OData V2 only.
Pattern: Parameter EntityType (sap:semantics="parameters") -> NavigationProperty Results -> Result EntityType.
SelectionVariant with Parameters: Annotate the Result EntityType with com.sap.vocabularies.UI.v1.SelectionVariant and include the Parameters collection.
```

**STEP**: 2 — OData metadata: EntityTypes, parameters type, association and EntityContainer
**DESCRIPTION**: Add two EntityTypes: SalesShareType (result, sap:semantics="aggregate") and SalesShareParametersType (parameters, sap:semantics="parameters"). Define the NavigationProperty Results on the parameters type with an Association to the result type. Expose both EntitySets in the EntityContainer, mark parameters entitySet as non-addressable if appropriate (sap:addressable="false").
**LANGUAGE**: XML
**CODE**:
```xml
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:sap="http://www.sap.com/Protocols/SAPData">
    <edmx:DataServices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:DataServiceVersion="2.0">
        <Schema Namespace="sap.smartbusinessdemo.services" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
            <EntityType Name="SalesShareType" sap:semantics="aggregate">
                <Key>
                    <PropertyRef Name="ID" />
                </Key>
                <Property Name="ID" Type="Edm.String" Nullable="false" MaxLength="2147483647" sap:filterable="false" />
                <Property Name="Country" Type="Edm.String" MaxLength="3" sap:label="Country" sap:aggregation-role="dimension" />
                <Property Name="Region" Type="Edm.String" MaxLength="4" sap:label="Region" sap:aggregation-role="dimension" />
                <Property Name="ProductID" Type="Edm.String" MaxLength="10" sap:label="Product ID" sap:aggregation-role="dimension" />
                <Property Name="Currency" Type="Edm.String" MaxLength="5" sap:label="Currency" sap:aggregation-role="dimension" />
                <Property Name="Product" Type="Edm.String" MaxLength="1024" sap:label="Product" sap:aggregation-role="dimension" />
                <Property Name="SupplierCompany" Type="Edm.String" MaxLength="80" sap:label="Supplier Company" sap:aggregation-role="dimension" />
                <Property Name="BuyerCompany" Type="Edm.String" MaxLength="80" sap:label="Buyer Company" sap:aggregation-role="dimension" />
                <Property Name="Year" Type="Edm.String" MaxLength="4" sap:label="Year" sap:aggregation-role="dimension" />
                <Property Name="Quarter" Type="Edm.String" MaxLength="2" sap:label="Quarter" sap:aggregation-role="dimension" />
                <Property Name="Month" Type="Edm.String" MaxLength="2" sap:label="Month" sap:aggregation-role="dimension" />
                <Property Name="TotalSales_CURRENCY" Type="Edm.String" MaxLength="5" sap:semantics="currency-code" />
                <Property Name="Sales_CURRENCY" Type="Edm.String" MaxLength="5" sap:semantics="currency-code" />
                <Property Name="TotalSales" Type="Edm.Decimal" Precision="15" Scale="2" sap:filterable="false" sap:label="Total Sales" sap:aggregation-role="measure" sap:unit="TotalSales_CURRENCY" />
                <Property Name="Sales" Type="Edm.Decimal" Precision="15" Scale="2" sap:filterable="false" sap:label="Sales" sap:aggregation-role="measure" sap:unit="Sales_CURRENCY" />
                <Property Name="SalesShare" Type="Edm.Decimal" Precision="12" Scale="5" sap:filterable="false" sap:label="Sales Share" sap:aggregation-role="measure" />
            </EntityType>
            <EntityType Name="SalesShareParametersType" sap:semantics="parameters">
                <Key>
                    <PropertyRef Name="P_Currency"/>
                    <PropertyRef Name="P_Country"/>
                </Key>
                <Property Name="P_Currency" Type="Edm.String" Nullable="false" MaxLength="5" sap:label="Currency" sap:parameter="mandatory"/>
                <Property Name="P_Country" Type="Edm.String" Nullable="false" DefaultValue="3" MaxLength="20" sap:label="CountryCode" sap:parameter="mandatory"/>
                <NavigationProperty Name="Results" Relationship="sap.smartbusinessdemo.services.SalesShareParameters_SalesShareType" FromRole="SalesShareParametersPrincipal" ToRole="SalesShareDependent"/>
            </EntityType>

            <Association Name="SalesShareParameters_SalesShareType">
                <End Type="sap.smartbusinessdemo.services.SalesShareParametersType" Role="SalesShareParametersPrincipal" Multiplicity="*"/>
                <End Type="sap.smartbusinessdemo.services.SalesShareType" Role="SalesShareDependent" Multiplicity="*"/>
            </Association>

            <EntityContainer Name="SalesShare" m:IsDefaultEntityContainer="true">
                <EntitySet Name="SalesShare" EntityType="sap.smartbusinessdemo.services.SalesShareType"/>
                <EntitySet Name="SalesShareParameters" EntityType="sap.smartbusinessdemo.services.SalesShareParametersType" sap:addressable="false"/>
                <AssociationSet Name="SalesShareParameters_SalesShare" Association="sap.smartbusinessdemo.services.SalesShareParameters_SalesShareType">
                    <End Role="SalesShareParametersPrincipal" EntitySet="SalesShareParameters"/>
                    <End Role="SalesShareDependent" EntitySet="SalesShare"/>
                </AssociationSet>
            </EntityContainer>
        </Schema>
    </edmx:DataServices>
</edmx:Edmx>
```

**STEP**: 3 — Annotation: SelectionVariant with Parameters (XML)
**DESCRIPTION**: Annotate the result EntityType (SalesShareType) with com.sap.vocabularies.UI.v1.SelectionVariant. Provide the Parameters collection containing UI.Parameter records. Use a Qualifier (e.g., #params) and reference this qualifier from the card manifest (selectionAnnotationPath).
**LANGUAGE**: XML
**CODE**:
```xml
<Annotations Target="sap.smartbusinessdemo.services.SalesShareType">
    <Annotation Term="com.sap.vocabularies.UI.v1.SelectionVariant" Qualifier="params">
        <Record>
            <PropertyValue Property="SelectOptions">
                <Collection>
                </Collection>
            </PropertyValue>
            <PropertyValue Property="Parameters">
                <Collection>
                    <Record Type="com.sap.vocabularies.UI.v1.Parameter">
                        <PropertyValue Property="PropertyName" PropertyPath="P_Currency" />
                        <PropertyValue Property="PropertyValue" String="EUR" />
                    </Record>
                    <Record Type="com.sap.vocabularies.UI.v1.Parameter">
                        <PropertyValue Property="PropertyName" PropertyPath="P_Country" />
                        <PropertyValue Property="PropertyValue" String="IN" />
                    </Record>
                </Collection>
            </PropertyValue>
        </Record>
    </Annotation>
    ...
</Annotations>
```

**STEP**: 4 — Annotation: SelectionVariant with Parameters (CAP CDS)
**DESCRIPTION**: Equivalent SelectionVariant declaration in CAP CDS syntax. Annotate the result entity type with UI.SelectionVariant and list UI.Parameter objects. Use the same qualifier name and property names.
**LANGUAGE**: CDS
**CODE**:
```cds
annotate sap.smartbusinessdemo.services.SalesShareType @(
  UI.SelectionVariant #params : {
    SelectOptions : [
    ],
    Parameters : [
        {
            $Type : 'UI.Parameter',
            PropertyName : P_Currency,
            PropertyValue : 'EUR'
        },
        {
            $Type : 'UI.Parameter',
            PropertyName : P_Country,
            PropertyValue : 'IN'
        }
    ]
  }
);
```

**STEP**: 5 — Card configuration in manifest.json (sap.ovp)
**DESCRIPTION**: Configure the OVP card to use the SelectionVariant qualifier via selectionAnnotationPath and point to the result entitySet. The selectionAnnotationPath value must match the Annotation Qualifier defined earlier (com.sap.vocabularies.UI.v1.SelectionVariant#params).
**LANGUAGE**: JSON
**CODE**:
```json
{
  "sap.ovp": {
    "cards": {
      "card04": {
        "model": "salesShare",
        "template": "sap.ovp.cards.list",
        "settings": {
          "selectionAnnotationPath": "com.sap.vocabularies.UI.v1.SelectionVariant#params",
          "entitySet": "SalesShare"
        }
      }
    }
  }
}
```

**STEP**: 6 — EntityType with Optional Input Parameter (XML)
**DESCRIPTION**: If an EntitySet contains optional parameters, the SelectionVariant does not need to define that optional parameter. When an optional parameter is not supplied in the SelectionVariant, an empty string is used by default. Current support for optional parameters is only for Edm.String.
**LANGUAGE**: XML
**CODE**:
```xml
<EntityType Name="SalesShareParametersType" sap:semantics="parameters">
    <Key>
        <PropertyRef Name="P_Currency"/>
        <PropertyRef Name="P_Country"/>
        <PropertyRef Name="P_Optional"/>
    </Key>
    <Property Name="P_Currency" Type="Edm.String" Nullable="false" MaxLength="5" sap:label="Currency" sap:parameter="mandatory"/>
    <Property Name="P_Country" Type="Edm.String" Nullable="false" DefaultValue="3" MaxLength="20" sap:label="CountryCode" sap:parameter="mandatory"/>
    <Property Name="P_Optional" Type="Edm.String" Nullable="false" MaxLength="5" sap:label="Optional" sap:parameter="optional"/>
    <NavigationProperty Name="Results" Relationship="sap.smartbusinessdemo.services.SalesShareParameters_SalesShareType" FromRole="SalesShareParametersPrincipal" ToRole="SalesShareDependent"/>
</EntityType>
```

**STEP**: 7 — Multiple cards with analytical parameters
**DESCRIPTION**: For multiple cards to respond to analytical/filter bar parameters, define a SelectionVariant annotation per card (distinguishable by Qualifier). When a user applies parameters in the filter bar, cards whose SelectionVariant Parameters include matching parameter names receive the applied values. Ensure each card's selectionAnnotationPath references the correct qualifier.
**LANGUAGE**: JSON
**CODE**:
```json
{
  "sap.ovp": {
    "cards": {
      "cardA": {
        "settings": {
          "selectionAnnotationPath": "com.sap.vocabularies.UI.v1.SelectionVariant#paramsA",
          "entitySet": "SalesShare"
        }
      },
      "cardB": {
        "settings": {
          "selectionAnnotationPath": "com.sap.vocabularies.UI.v1.SelectionVariant#paramsB",
          "entitySet": "SalesShare"
        }
      }
    }
  }
}
```