cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CDSFiori Elements – Object Page – Chart Facet Error:ApplySupported is not added to the annotations

jaroslav_hrbacek
Participant
0 Kudos
971

Hi Experts,

I have CDS views and I want to display a chart in the Object Page. In preview (ADT) I get an error:

ApplySupported is not added to the annotations

Here are the views:

@AbapCatalog.sqlViewName: 'ZCMATPK'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Material Stock'

@VDM.viewType: #CONSUMPTION

@UI.headerInfo: { typeName: 'Material' ,
                  typeNamePlural: 'Materials' ,
                  title: { type: #STANDARD , value: 'Material'} ,
                  description: { type: #STANDARD, value: 'MaterialName' } }


define view ZC_MaterialPK
  as select from ZI_MaterialPK
  association [0..*] to ZI_MaterialStock as _MaterialStock on $projection.Material = _MaterialStock.Material
{
      @UI.facet: [
         { id: 'idWeight' ,
             purpose: #HEADER,
             label: 'Weight' ,
             type: #FIELDGROUP_REFERENCE,
             targetQualifier: 'hdWeight'} ,
         { id:'idGeneralInformation' ,
               type: #COLLECTION ,
               label: 'General Information' ,
                position: 10 } ,
             { type: #IDENTIFICATION_REFERENCE ,
               label : 'General Information',
               parentId: 'idGeneralInformation',
               id: 'idIdentification' ,
               position: 10 },
             { type: #FIELDGROUP_REFERENCE ,
               label : 'Last Changed',
               targetQualifier: 'fgLastChanged' ,
               parentId: 'idGeneralInformation' ,
               id : 'idGroupLastChanged' ,
               position: 20 },
         { id: 'idLineItemMatPlant' ,
               type : #LINEITEM_REFERENCE ,
               label : 'Plant Data' ,
               position: 20 ,
               targetElement: '_MaterialPlant'} ,
         { id : 'idChart' ,
               type: #CHART_REFERENCE ,
               label : 'Chart',
               targetElement: '_MaterialStock',
               position: 30 }
                    ]
      @UI.selectionField: [{ position: 10 }]
      @UI.lineItem: [{ position: 10 }]
      @UI.identification: [{ position: 10 }]
      @ObjectModel.text.element: ['MaterialName']
  key Material,

      @UI.selectionField: [{ position: 20 }]
      @UI.lineItem: [{ position: 20 }]
      @UI.identification: [{ position: 20 }]
      @ObjectModel.text.element: ['MaterialTypeName']
      MaterialType,

      @UI.selectionField: [{ position: 30 }]
      @UI.lineItem: [{ position: 30 }]
      @UI.identification: [{ position: 30 }]
      @ObjectModel.text.element: ['MaterialGroupName']
      MaterialGroup,

      @UI.fieldGroup: [{ qualifier: 'hdWeight' , position: 10 }]
      @Semantics.quantity.unitOfMeasure: 'MaterialWeightUnit'
      MaterialGrossWeight,

      @UI.fieldGroup: [{ qualifier: 'hdWeight' , position: 20 }]
      @Semantics.quantity.unitOfMeasure: 'MaterialWeightUnit'
      MaterialNetWeight,

      @Semantics.unitOfMeasure: true
      MaterialWeightUnit,

      @UI.fieldGroup: [{ qualifier: 'fgLastChanged' , position: 10 }]
      LastChangedby,

      @UI.fieldGroup: [{ qualifier: 'fgLastChanged' , position: 20 }]
      LastChangedOn,

      MaterialTypeName,
      MaterialGroupName,
      MaterialName,

      _MaterialPlant,
      _MaterialStock
}
@AbapCatalog.sqlViewName: 'ZIMATSTK'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'test'

@UI.chart: [{
    title: 'Stock by Plant and St Location',
    description: 'Stock by Plant' ,
    chartType: #COLUMN,
    dimensions: ['Plant', 'StorageLocation'],
    measures: ['UnrestrictedStock']
}]


define view ZI_MaterialStock
  as select from I_MaterialUnrestrictedUseStock
{
  key Material,
  key Plant,
  key StorageLocation,
      @Semantics.unitOfMeasure: true
      MaterialBaseUnit,

      @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
      @DefaultAggregation: #SUM
      MatlWrhsStkQtyInMatlBaseUnit as UnrestrictedStock,
      /* Associations */
      _Material,
      _MaterialBaseUnit,
      _Plant,
      _StorageLocation
}
I follow that example: CDS-Fiori Elements – Object Page – Chart Facet

After previewing in ADT I get this error:

What annotation am I missing?

It works well with OData V2. No problem.

But I have it / want it in V4.

please help

Thanks

Jarda

Accepted Solutions (1)

Accepted Solutions (1)

sandeep_rs
Product and Topic Expert
Product and Topic Expert

Hi,

yes, this is a known restriction currently that RAP does not add this annotation - there is a requirement in the pipeline but is currently still a restriction. For now, you should add this as a local annotation.

Best Regards,

Sandeep

Chris43
Newcomer
0 Kudos

Hi,

could you please explain how I can add it locally? I face the same problem.

 

Thank you.

Answers (0)