Customizing List Card

Customizing List Card

Adding Smart Links

Define a semantic object for the entity set and its property using the annotation target to add smart links. For example:

Sample Code

XML Annotation

Sample Code
Hidden
<Annotations Target="GWSAMPLE_BASIC.SalesOrder/SalesOrderID">
<Annotation Term="com.sap.vocabularies.Common.v1.SemanticObject" String="OVP" />
</Annotations>

Sample Code

ABAP CDS Annotation

Sample Code
Hidden
annotate view SALESORDER with {
  @Consumption.semanticObject: 'OVP'
  salesorderid;
}

Sample Code

CAP CDS Annotation

Sample Code
Hidden
annotate GWSAMPLE_BASIC.SalesOrder with {
  @Common.SemanticObject : 'OVP'
  SalesOrderID
};

Text Arrangement in List Area

Define Text arrangement annotation to format content on the list area.

Sample Code

XML Annotation

Sample Code
Hidden
<Annotations xmlns="http://docs.oasis-open.org/odata/ns/edm" Target="GWSAMPLE_BASIC.SalesOrder/CustomerID">
<Annotation Term="com.sap.vocabularies.Common.v1.Text" Path="Supplier_Name"/>
<Annotation Term="com.sap.vocabularies.UI.v1.TextArrangement" EnumMember="com.sap.vocabularies.UI.v1.TextArrangementType/TextLast" />
</Annotation> 
</Annotations>

Sample Code

ABAP CDS Annotation

Sample Code
Hidden
annotate view SALESORDER with {
  @UI.TextArrangement: #TEXT_LAST
  customerid;
}

Sample Code

CAP CDS Annotation

Sample Code
Hidden
annotate GWSAMPLE_BASIC.SalesOrder with {
  @Common.Text : Supplier_Name
  @UI.TextArrangement : #TextLast
  CustomerID
};

In the preceding example, the text Customer is bound to the ContactID property and appears as shown in the table:

Text Arrangement Type Result
TextLast ContractID (Customer)
TextFirst Customer (ContractID)
TextOnly Customer

Filtering

You can add filters to list card by using the com.sap.vocabularies.UI.v1.SelectionVariant annotation term, or by passing filter parameter in the URL. For more information, see Configuring Card Filters

Sorting or Grouping

You can sort information in the list card by using sortBy and sortOrder properties in the application descriptor file. For more information, see Configuring Sort Properties