Different facets have been defined to display important information in the sections of the content area.
A facet contains collection facets (UI.CollectionFacet) as well as reference facets (UI.ReferenceFacet). Collection facets are made up of a list of records that each represent a reference facet to a field group annotation. Reference facets represent a reference to a line item annotation (list on the object page).
A hierarchy level is also supported; instead of a reference facet, you can add a collection facet that consists of several reference facets. The contents of these reference facets will then be arranged underneath.
In the figure below, the collection facet for Product Information combines three reference facets. Each reference facet refers to a field group, or to an identification annotation.
Further reference facets refer to identification sections, field group, contact or line items' annotations. For line items, a list is rendered.
To render a smart table, the section must comprise a list (indicated by com.sap.vocabularies.UI.v1.LineItem).
To render a toolbar for the table, com.sap.smartapp.UI.Action must be defined as the entity type. In this case, the com.sap.smartapp.UI.Action list is processed and a button is generated based on the label and function import information.
An Add Entry button is rendered if Org.OData.Capabilities.V1.InsertRestrictions/Insertable/Bool is set to true for the entity set.
The fields are rendered using the smart field control so the associated annotations are also used.
To enable, for example, extensions, personalization, automated testing, you need to have stable IDs for views and controls. In most cases, you can derive them automatically from existing annotations. In case of collection facets, a new annotation was introduced with which you can set a stable ID. The ID should be meaningful and must be unique within the entity type. You should only use characters in camel case without spaces.
<Annotation Term="UI.Facets"> <Collection> <Record Type="UI.CollectionFacet"> <PropertyValue Property="ID" String="GeneralInformation"/>
lo_collection1 = lo_annotation->create_collection( ). lo_record2 = lo_collection1->create_record( iv_record_type = 'UI.CollectionFacet') ##NO_TEXT. lo_property_value3 = lo_record2->create_property( 'ID' ) ##NO_TEXT. lo_property_value3->create_simple_value( )->set_string( 'GeneralInformation' ) ##NO_TEXT.
The annotation generator of the fact sheets automatically adds an ID to the GeneralInformation collection facet.
<Annotation Term="UI.Facets"> <Collection> <!-- This facet is displayed as before in a section --> <Record Type="UI.ReferenceFacet"> <PropertyValue Property="Label" String="{@i18n>@GeneralInfoFacetLabel}"/> <PropertyValue Property="Target" AnnotationPath="@UI.FieldGroup#GeneralInformation" /> </Record> <Record Type="UI.CollectionFacet"> <PropertyValue Property="ID" String="FurtherData"/> <PropertyValue Property="Label" String="{@i18n>@FurtherData}"/> <PropertyValue Property="Facets"> <Collection> <!-- This CollectionFacet becomes a subsection with a form with groups --> <Record Type="UI.CollectionFacet">