/sap-ux-fiori-tools:sap-fiori-add-visual-filter visual filter with entity name, dimension field (e.g., Status, Category), measure field (e.g., TotalPrice, Amount), aggregation method (sum/min/max/average/countdistinct), and chart type (Bar/Line)from sap-ux-fiori-tools
Adds chart-based visual filters (Bar/Line) to SAP Fiori Elements filter bars or value help dialogs in CAP or ABAP RAP projects.
Ships in sap-ux-fiori-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Add chart-based filters (Bar/Line) to filter bar or value help dialog (OData V4).
CAP Projects:
ABAP RAP Projects:
STOP and ASK the user for ALL of these inputs if ANY are missing from the prompt:
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.
@Aggregation.ApplySupported: {
Transformations: ['aggregate','groupby'],
AggregatableProperties: [{ Property: Amount }],
GroupableProperties: [Category]
}
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.
UI.Chart #visualFilter : {
ChartType: #Bar,
Dimensions: [Category],
DynamicMeasures: ['@Analytics.AggregatedProperty#Amount_sum']
}
✅ Uses DynamicMeasures
UI.PresentationVariant #visualFilter: {
Visualizations: ['@UI.Chart#visualFilter']
}
The annotation location depends on how the dimension is declared in the CAP model:
Category : String(80) is a real entity element, so use Category @Common.ValueList #visualFilter inside the annotate ... with { ... } block.Category : Association to Categories generates the local foreign key Category_code; Category_code is 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.
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:
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 single Annotations Target="...Entity/<assoc>_code" block in $metadata. Verify with cds compile --to edmx if unsure.LocalDataProperty and ValueListProperty both use the FK column name (e.g. Category_code), not the association name.CollectionPath is 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
};
UI.SelectionFields: [Category]
Missing ANY of these will cause the visual filter to fail:
@OData.applySupportedForAggregation: #FULL on projection view (ZC_*)@Aggregation.default: #SUM (or #AVG, #MIN, #MAX) on measure field@UI.chart annotation with correct qualifier in metadata extension@UI.selectionField on dimension fieldCommon.ValueList annotation in annotation.xmlcontrolConfiguration with visual filter settings⚠️ CRITICAL: @OData.applySupportedForAggregation annotation is MANDATORY
WITHOUT this annotation:
Placement:
TRANSACTIONAL_QUERY contractCORRECT 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
⚠️ 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;
}
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., TravelAfter 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:
Activation:
Verification Steps:
Verify Activation Status:
Check OData $metadata:
<service-url>/$metadata<Annotation Term="UI.Chart" Qualifier="visualFilter"><Annotation Term="UI.PresentationVariant" Qualifier="visualFilter">Use the shared Manifest Configuration section below.
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 annotationsVisual filter settings go under controlConfiguration, NOT directly under settings!
Refer to the Application Preview Guidelines section in the sap-fiori-app-development skill for detailed testing instructions, including:
CAP:
RAP:
CAP:
Status_code) inline inside annotate ... with { ... } — fails with Element "..._code" has not been found. Use a separate annotate Service.Entity:assoc with (...) statement instead (see "Dimension is a Managed Association FK" above).RAP:
RAP Specific:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
9 skills in this plugin
/sap-fiori-analytical-chartAdd 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-app-developmentGuidelines 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-building-blocksGenerated from the plugin's indexed repository (sap/open-ux-tools) — no native marketplace selected
npx claudepluginhub p/sap-sap-ux-fiori-tools-plugins-coding-agents-fioriOther plugins' skills for the same job