Skip to Content
avatar image
Former Member

[SmartTable} Color Coding

Hi everybody,

I am trying to get some color coding into the SmartTable and it just does not work. I don't know what I am doing wrong so I just present you my metadata.xml and hope that someone finds the error.

I want to display two columns: DOTYID and PRICE. Price should be color coded using the CriticalityCalculation provided by the DataPoint annotation. I reference the annotation using the DataFieldForAnnotation annotation.

<?xml version="1.0" encoding="utf-8"?><edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap="http://www.sap.com/Protocols/SAPData" Version="1.0">
    <edmx:DataServices m:DataServiceVersion="2.0">
        <Schema xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Namespace="leo.core.plots" sap:schema-version="0">
            <EntityType Name="Point" sap:service-schema-version="1" sap:service-version="1" sap:semantics="aggregate" sap:content-version="1"><Key xmlns="http://schemas.microsoft.com/ado/2008/09/edm"><PropertyRef Name="DOTYID"/></Key><Property xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Name="DOTYID" Type="Edm.String" sap:visible="true" sap:label="Belegart"/><Property xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Name="DOID" Type="Edm.Int64" sap:visible="true" sap:label="Anzahl Dokumente"/><Property xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Name="PRICE" Type="Edm.Int64" sap:visible="true" sap:label="Preis"/><Property xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Name="WEIGHT" Type="Edm.Int64" sap:visible="true" sap:label="Gewicht"/><Property xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Name="AMOUNT" Type="Edm.Int64" sap:visible="true" sap:label="Stückzahl"/></EntityType>
            <EntityContainer Name="leo.core.plots" m:IsDefaultEntityContainer="true">
                <EntitySet Name="Points" EntityType="leo.core.plots.Point"/>
            </EntityContainer>
            <Annotations xmlns="http://docs.oasis-open.org/odata/ns/edm" Target="leo.core.plots.Point">

                <Annotation Term="com.sap.vocabularies.UI.v1.DataPoint" Qualifier="PRICE">
                    <Record Type="com.sap.vocabularies.UI.v1.DataPointType">
                        <PropertyValue Property="Title" String="Preis"/>
                        <PropertyValue Property="Value" Path="PRICE"/>
                        <PropertyValue Property="CriticalityCalculation">
                            <Record Type="com.sap.vocabularies.UI.v1.CriticalityCalculationType">
                                <PropertyValue Property="ImprovementDirection" EnumMember="com.sap.vocabularies.UI.v1.CriticalityCalculationType/Minimize"/>
                                <PropertyValue Property="ToleranceRangeHighValue" Int="24000"/>
                                <PropertyValue Property="DeviationRangeHighValue" Int="24000"/>
                            </Record>
                        </PropertyValue>    
                    </Record>   
                </Annotation>

                <Annotation Term="com.sap.vocabularies.UI.v1.LineItem">
                    <Collection>
                        <Record Type="com.sap.vocabularies.UI.v1.DataField">
                            <PropertyValue Property="Label" String="Belegart"/>
                            <PropertyValue Property="Value" Path="DOTYID"/>
                        </Record>
                        <Record Type="com.sap.vocabularies.UI.v1.DataFieldForAnnotation">
                            <PropertyValue Property="Label" String="Preis"/>
                            <PropertyValue Property="Target" AnnotationPath="@com.sap.vocabularies.UI.v1.DataPoint#PRICE"/>
                        </Record>
                    </Collection>
                </Annotation>
            </Annotations>
        </Schema>
    </edmx:DataServices>
</edmx:Edmx>

The result is the following. The Price column does not show up:

Is it even possible to use the CriticalityCalculation in a SmartTable?

Best regards,
Hendrik

smarttable.png (3.9 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers