
sap-fiori-add-visual-filter
Add visual filters (chart-based) to SAP Fiori Elements filter bar or value help using CAP or ABAP RAP. Use when asked to add chart filters, bar chart selectors, or visual filter bars to a Fiori Elements application.
- Installs
- 604
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/sap/open-ux-tools --skill sap-fiori-add-visual-filter- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads sap-fiori-add-visual-filter automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
SAP Fiori Visual Filter
Purpose
Add chart-based filters (Bar/Line) to filter bar or value help dialog (OData V4).
Prerequisites
CAP Projects:
- ✅ VS Code or SAP Business Application Studio (BAS) - Both environments supported
- ✅ Fiori MCP Server - Required for Fiori app modification (VS Code only)
ABAP RAP Projects:
- ✅ VS Code only - ABAP Development Tools extension is VS Code-specific
- ✅ Fiori MCP Server - Required for Fiori app modification
- ✅ ABAP Development Tools for VS Code extension - Required for backend development (includes ADT MCP server for RAP operations)
MANDATORY: Gather Required Inputs First
STOP and ASK the user for ALL of these inputs if ANY are missing from the prompt:
- Entity - Which entity to add the visual filter to
- Dimension field - The field to filter by (e.g., Category, Status, Destination)
- Measure field - The numeric field to aggregate (e.g., Amount, TotalPrice, ReservationPrice)
- Aggregation method - How to aggregate (see valid values below)
- Chart type - Bar or Line (recommend Bar as default)
DO NOT proceed with implementation until all inputs are confirmed.
⚠️ Line chart dimension type restriction: ChartType: #Line only supports dimensions typed as Edm.Date, Edm.TimeOfDay, or Edm.DateTimeOffset. If the requested dimension is a different type (e.g. string/association code like Status, Category), either use #Bar instead or confirm with the user that the dimension field is a date/time type before proceeding.
CAP Implementation
Enable Aggregation (MANDATORY)
@Aggregation.ApplySupported: {
Transformations: ['aggregate','groupby'],
AggregatableProperties: [{ Property: Amount }],
GroupableProperties: [Category]
}
Aggregated Property (Measure)
Analytics.AggregatedProperty #Amount_sum : {
$Type: 'Analytics.AggregatedPropertyType',
Name: 'Amount_sum',
AggregatableProperty: Amount,
AggregationMethod: 'sum',
![@Common.Label]: 'Total Amount'
}
Valid AggregationMethod values (lowercase string):
sum- Sum of the non-null valuesmin- Smallest of the non-null valuesmax- Largest of the non-null valuesaverage- Sum of non-null values divided by count of non-null valuescountdistinct- Count of distinct values, omitting null values
⚠️ CRITICAL: Must be a lowercase string (e.g., 'sum'), NOT an enum (e.g., #SUM). Using an enum will cause SQL generation errors.
Chart Annotation
UI.Chart #visualFilter : {
ChartType: #Bar,
Dimensions: [Category],
DynamicMeasures: ['@Analytics.AggregatedProperty#Amount_sum']
}
✅ Uses DynamicMeasures
PresentationVariant
UI.PresentationVariant #visualFilter: {
Visualizations: ['@UI.Chart#visualFilter']
}
Scalar property versus managed association dimension
The annotation location depends on how the dimension is declared in the CAP model:
- A direct scalar property can be annotated inline. For example,
Category : String(80)is a real entity element, so useCategory @Common.ValueList #visualFilterinside theannotate ... with { ... }block. - A managed association is different. For example,
Category : Association to Categoriesgenerates the local foreign keyCategory_code;Category_codeis not a declared element in the source entity and cannot be annotated inline in that block.
For the scalar Category dimension, this is valid:
annotate MyService.Entity with {
Category @Common.ValueList #visualFilter: {
$Type: 'Common.ValueListType',
CollectionPath: 'Entity',
PresentationVariantQualifier: 'visualFilter',
Parameters: [
{ $Type: 'Common.ValueListParameterInOut',
LocalDataProperty: Category, ValueListProperty: 'Category' }
]
};
};
For a visual filter whose dimension is the managed Category association, use the separate association-key target described below. Do not replace the target with Category_code inside the entity annotation block.
⚠️ Dimension is a Managed Association FK (e.g. Category_code, Status_ID)
When the dimension field is the auto-generated foreign key column of a managed association (e.g. Category_code from Category : Association to Categories), you cannot annotate it inline inside the entity's annotate ... with { ... } block — the FK column is not visible as an element there. The CDS compiler will fail with:
Element "Category_code" has not been found
✅ CORRECT: Use a separate annotate statement targeting the association itself — the compiler rewrites it to the FK column:
// Compiles to target Travels/Category_code in $metadata
annotate MyService.Entity:Category with @(
Common.ValueList #visualFilter: {
$Type : 'Common.ValueListType',
CollectionPath : 'Entity',
PresentationVariantQualifier: 'visualFilter',
Parameters : [
{ $Type: 'Common.ValueListParameterInOut',
LocalDataProperty: Category_code, ValueListProperty: 'Category_code' }
]
}
);
Key points:
- Target syntax:
annotate <Service>.<Entity>:<assoc>— for a managed to-one association, the compiler copies/rewrites annotations on the association to its generated local FK element. This matches documented CAP compiler behavior (see CAP docs on "Managed Associations"). If other annotations (e.g.Common.Label,Common.Text) already target the same association elsewhere, they're merged into a singleAnnotations Target="...Entity/<assoc>_code"block in$metadata. Verify withcds compile --to edmxif unsure. LocalDataPropertyandValueListPropertyboth use the FK column name (e.g.Category_code), not the association name.CollectionPathis the same entity set that holds the chart data (self-reference), not the code-list entity set.
❌ WRONG: Inline annotation inside the entity block — fails to compile:
annotate MyService.Entity with { ... } {
Category_code @Common.ValueList #visualFilter: { ... }; // ❌ Element not found
};
SelectionFields
UI.SelectionFields: [Category]
Manifest configuration (MANDATORY)
The shared Manifest Configuration section below applies to CAP and RAP.
ABAP RAP Implementation (4 Steps)
CRITICAL: NEVER EDIT metadata.xml - IT IS READ-ONLY!
⚠️ PRE-FLIGHT CHECKLIST - Verify BEFORE Implementation
Missing ANY of these will cause the visual filter to fail:
-
@OData.applySupportedForAggregation: #FULLon projection view (ZC_*) -
@Aggregation.default: #SUM(or #AVG, #MIN, #MAX) on measure field -
@UI.chartannotation with correct qualifier in metadata extension -
@UI.selectionFieldon dimension field - Frontend
Common.ValueListannotation in annotation.xml - Manifest
controlConfigurationwith visual filter settings - All CDS objects activated
1. Backend Projection View (MANDATORY) - Enable Aggregation Support
⚠️ CRITICAL: @OData.applySupportedForAggregation annotation is MANDATORY
WITHOUT this annotation:
- OData service will NOT support aggregation
- Visual filter will fail to load
- Chart annotations will be ignored
Placement:
- ✅ MUST be on PROJECTION view (ZC_* or ZZZC_*) with
TRANSACTIONAL_QUERYcontract - ❌ NOT on interface view (ZR_* or ZZZR_*)
CORRECT Example:
// MANDATORY! Must be present!
@OData.applySupportedForAggregation: #FULL
define root view entity ZC_ENTITY
provider contract TRANSACTIONAL_QUERY
as projection on ZR_ENTITY
{
@Aggregation.default: #SUM // Specify aggregation method for measure
Amount;
Category; // Dimension field (no aggregation annotation needed)
}
WRONG Example:
// ❌ WRONG - Don't put on interface view
// WRONG PLACE!
@OData.applySupportedForAggregation: #FULL
define root view entity ZR_ENTITY
as select from TABLE
2. Backend Metadata Extension (MANDATORY) - Add Chart, PresentationVariant, SelectionField Annotations
⚠️ CRITICAL: @UI.chart and @UI.presentationVariant are ENTITY-LEVEL (header) annotations.
Place them in the header block — BEFORE annotate view ZC_ENTITY with (alongside @UI.headerInfo.*), NOT inside the { ... } field block and NOT on a field (e.g. the dimension field).
Attaching @UI.chart to a field fails activation with: Annotation 'UI.chart.qualifier' used at wrong position (wrong scope).
// ↓↓↓ HEADER SCOPE: these go BEFORE `annotate view`, never on a field ↓↓↓
@UI.chart: [{
qualifier: 'visualFilter',
chartType: #BAR,
dimensions: ['Category'],
measures: ['Amount']
}]
@UI.presentationVariant: [{
qualifier: 'visualFilter',
visualizations: [{
type: #AS_CHART,
qualifier: 'visualFilter'
}]
}]
annotate view ZC_ENTITY with
{
@UI.selectionField: [{ position: 10 }]
Category;
@EndUserText.label: 'Amount'
Amount;
}
3. Frontend (annotation.xml) - Add ValueList
ValueList Annotation on Dimension Field:
<Annotations Target="<YourServiceNamespace>.<YourEntityType>/Category">
<Annotation Term="Common.ValueList" Qualifier="visualFilter">
<Record Type="Common.ValueListType">
<PropertyValue Property="CollectionPath" String="<YourEntitySet>"/>
<PropertyValue Property="PresentationVariantQualifier" String="visualFilter"/>
<PropertyValue Property="Parameters">
<Collection>
<Record Type="Common.ValueListParameterInOut">
<PropertyValue Property="LocalDataProperty" PropertyPath="Category"/>
<PropertyValue Property="ValueListProperty" String="Category"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
Important: Replace placeholders:
<YourServiceNamespace>- e.g.,com.sap.gateway.srvd.ztravel.v0001<YourEntityType>- e.g.,TravelType<YourEntitySet>- e.g.,Travel
4. Verify Active Annotations (MANDATORY)
After activating both DDLS and DDLX, verify the changes are live:
⚠️ IMPORTANT: DDLS and DDLX are Separate Objects
The projection view (DDLS file) and metadata extension (DDLX file) are separate ABAP development objects that happen to share the same entity name.
Key points:
- DDLS = Data Definition (projection view) - contains entity definition, associations, fields, and data annotations
- DDLX = Metadata Extension - contains UI annotations (@UI.chart, @UI.presentationVariant, field labels, etc.)
- Both must be activated individually - activating one does NOT activate the other
- Both must exist for the visual filter to work
Activation:
- Use ABAP ADT MCP to activate ABAP objects
- Activate the DDLS file separately from the DDLX file
Verification Steps:
-
Verify Activation Status:
- Check the activation tool output for success messages
- Verify no errors were reported during activation
- Both DDLS and DDLX must show successful activation
-
Check OData $metadata:
- Open your service URL in browser:
<service-url>/$metadata - Search for:
<Annotation Term="UI.Chart" Qualifier="visualFilter"> - Also verify:
<Annotation Term="UI.PresentationVariant" Qualifier="visualFilter"> - If these annotations are missing from $metadata, the DDLX is not active OR the service binding needs republishing
- Open your service URL in browser:
5. Manifest configuration (MANDATORY)
Use the shared Manifest Configuration section below.
Manifest Configuration (Common for CAP and RAP)
Complete manifest.json structure:
"sap.ui5": {
"routing": {
"targets": {
"<YourListReport>": { // Replace with your actual List Report target name
"type": "Component",
"name": "sap.fe.templates.ListReport",
"options": {
"settings": {
"contextPath": "/<YourEntitySet>", // Replace with your entity set path
"controlConfiguration": {
"@com.sap.vocabularies.UI.v1.SelectionFields": {
"layout": "CompactVisual",
"initialLayout": "Visual",
"filterFields": {
"Category": {
"visualFilter": {
"valueList": "com.sap.vocabularies.Common.v1.ValueList#visualFilter"
}
}
}
}
}
}
}
}
}
}
}
Path: sap.ui5.routing.targets.<ListReport>.options.settings.controlConfiguration
Visual filter settings belong under controlConfiguration, not directly under settings.
Important placeholders:
<YourListReport>- Your List Report target name (e.g.,TravelList)<YourEntitySet>- Your entity set path (e.g.,/Travel)Category- Your dimension field namevisualFilter- Must match the qualifier in your annotations
CRITICAL: Manifest Configuration Structure
Visual filter settings go under controlConfiguration, NOT directly under settings!
Testing
Refer to the Application Preview Guidelines section in the sap-fiori-app-development skill for detailed testing instructions, including:
- CAP project testing with watch scripts
- Standalone Fiori project testing with live backend vs. mock mode
- Metadata refresh procedures after backend changes
Key Differences
CAP:
- Aggregation + measures defined in CDS
- Uses DynamicMeasures
- Aggregation and chart defined in same place
RAP:
- Aggregation defined in backend CDS only
- Uses Measures (not DynamicMeasures)
- Metadata is read-only
Common Mistakes
- Backend Changes are not activated.
- Qualifier mismatch between Chart, ValueList, PresentationVariant, and manifest
- Wrong path in manifest (use full vocabulary path)
- Missing SelectionField annotation
- Non-numeric measure field
- Missing compact visual layout configuration in manifest
CAP:
- Trying to annotate a managed-association FK column (e.g.
Status_code) inline insideannotate ... with { ... }— fails withElement "..._code" has not been found. Use a separateannotate Service.Entity:assoc with (...)statement instead (see "Dimension is a Managed Association FK" above).
RAP:
- Missing backend aggregation support
- Using DynamicMeasures instead of Measures
- Adding Common.ValueList in backend instead of frontend (ValueList MUST be in frontend annotation.xml)
- Adding UI annotations directly in CDS projection view instead of metadata extension
- Trying to use @Consumption.valueHelpDefinition for visual filters (that's for value help dialogs, not visual filters)
Best Practices
- Always activate backend changes in ADT MCP before testing
- Use 1 dimension + 1 measure per visual filter
- Prefer Bar charts for better readability
- Keep qualifier names consistent across all annotations
- Test with different data volumes
- Always include layout: "CompactVisual" and initialLayout: "Visual" in manifest
RAP Specific:
- ALWAYS use ADT MCP to modify backend files when available
- Chart + PresentationVariant → Backend metadata extension (.ddlx.acds)
- Common.ValueList → Frontend annotation.xml (CANNOT be in backend)
References
- SAP Fiori Elements Visual Filter Documentation: https://ui5.sap.com/#/topic/5ea9bb1d544a42eabf71822a8a2cb753
- ABAP RAP Aggregation support: https://help.sap.com/docs/abap-cloud/abap-rap/projection-view
FAQ
What does the sap-fiori-add-visual-filter skill do?
Add visual filters (chart-based) to SAP Fiori Elements filter bar or value help using CAP or ABAP RAP. Use when asked to add chart filters, bar chart selectors, or visual filter bars to a Fiori Elements application.
How do I install sap-fiori-add-visual-filter?
Run npx skills add https://github.com/sap/open-ux-tools --skill sap-fiori-add-visual-filter in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/sap-fiori-add-visual-filter/ (personal) or .claude/skills/sap-fiori-add-visual-filter/ (project).
Which AI agents can use sap-fiori-add-visual-filter?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is sap-fiori-add-visual-filter safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains sap-fiori-add-visual-filter?
It is published by sap in sap/open-ux-tools. It has 604 recorded installs.
More from sap/open-ux-tools
sap-fiori-app-development
sap/open-ux-tools
Guidelines for SAP Fiori app development for CAP and standalone projects. Use when creating or modifying SAP Fiori Elements applications, adding a List Report, Object Page, or Worklist, or connecting a Fiori app to a CAP service or OData endpoint.
sap-fiori-analytical-chart
sap/open-ux-tools
Add analytical chart (chart + table hybrid) to SAP Fiori Elements List Report using aggregated data. Supports CAP and ABAP RAP (OData V4). Use when asked to add a chart section, aggregated data visualization, or Analytical List Page chart to a List Report.
sap-fiori-eslint-plugin
sap/open-ux-tools
Configure, migrate, or run ESLint with @sap-ux/eslint-plugin-fiori-tools in SAP Fiori projects (standalone or CAP). Use when ESLint is missing and the user wants to add it or add code quality checks; when an existing .eslintrc or eslint@8 config needs upgrading to ESLint 9 flat config; when the user wants to run linting, fix lint errors, or ESLint is broken or not working; or when the user wants to see the application issues or UX consistency issues for a specific app — e.g. "show application issue(s) for my project ", "show application issues for app X", "UX consistency issues", "issues consistent with Page Map", "same issues as Application Information".
sap-fiori-create-cli
sap/open-ux-tools
Invokes the @sap-ux/create CLI — generate, add, convert, remove, update, change, list, get commands for SAP Fiori projects. Use when asked to run sap-ux, invoke create CLI, add config to a project, generate adaptation-project, or use any sap-ux/create subcommand. Full options for each command group are in the linked references.
sap-fiori-opa5-test-development
sap/open-ux-tools
Use this skill when writing, fixing, extending, or reviewing OPA5 integration tests for SAP Fiori Elements applications - whether the app uses OData V4 (sap.fe.test library) or OData V2 (fioriElementsTestLibrary). Triggers on any request involving OPA5 journeys, page objects, JourneyRunner setup, test structure, mock data, or debugging test failures in a SAP Fiori Elements project generated by SAP Fiori tools. Use even when the user says "write integration tests" or "add an OPA journey" without specifying the library, as long as the project context is SAP Fiori Elements. Not applicable to freestyle UI5 apps.
odata-vocabularies-sync
sap/open-ux-tools
Open the skill to read its SKILL.md instructions.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.