I am trying to build a simple smarttable, using a CDS with annotation, I expect the columns to be displayed automatically but no column or selection field are displayed automatically. When I try to create a report with fiori element it is working fine but not with my freestyle app and smarttable. What is missing ?
@AbapCatalog.sqlViewName: 'ZTEST_CDS_SHP'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Test Shipment view'
@VDM.viewType: #CONSUMPTION
@VDM.private:false
@Search.searchable: true
@UI.headerInfo: { typeName: 'Order', typeNamePlural: 'Orders' }
@OData.publish: true
define view ZTESTV_CDS_SHP as select from ZRDCV_CDS_SHIPMENT
association [0..1] to ZTESTV_CDS_DCHELP as _DCValueHelp on $projection.DcSite = _DCValueHelp.Werks
association [0..1] to makt as _ArticleValueHelp on $projection.Article = _ArticleValueHelp.matnr and _ArticleValueHelp.spras = $session.system_language
{
@Search.defaultSearchElement: true
@UI.selectionField: [ { position: 10 } ]
@UI.lineItem: [ { position: 10, importance: #HIGH } ]
key shipment as Shipment,
@UI.selectionField: [ { position: 20 } ]
@UI.lineItem: [ { position: 20, importance: #HIGH } ]
key exidv as Hu,
....
here is the XML view
<mvc:View
controllerName="ns.shipment1.controller.Worklist"
xmlns="sap.m"
xmlns:mvc="sap.ui.core.mvc"
xmlns:semantic="sap.f.semantic"
xmlns:smartFilterBar="sap.ui.comp.smartfilterbar"
xmlns:app="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"
xmlns:smartTable="sap.ui.comp.smarttable">
<semantic:SemanticPage
id="page"
headerPinnable="false"
toggleHeaderOnTitleClick="false">
<semantic:titleHeading>
<Title
text="{i18n>worklistTitle}"
level="H2"/>
</semantic:titleHeading>
<semantic:content>
<!-- use this to make the table occupy the available screen height -->
<VBox fitContainer="true">
<!-- FILTER BAR ******************************************** -->
<smartFilterBar:SmartFilterBar
id="smartFilterBar"
entitySet="ZTESTV_CDS_SHP"
persistencyKey="SmartFilter_Explored"
basicSearchFieldName="Shipment"
enableBasicSearch="true"
visible="true"
considerSelectionVariants="true"
showFilterConfiguration="true">
</smartFilterBar:SmartFilterBar>
<!-- SMART TABLE ******************************************** -->
<smartTable:SmartTable
id="ShipmentTable"
entitySet="ZTESTV_CDS_SHP"
smartFilterId="smartFilterBar"
tableType="Table"
useExportToExcel="true"
beforeExport="onBeforeExport"
useVariantManagement="true"
useTablePersonalisation="true"
header="Shipment Items"
showRowCount="true"
persistencyKey="SmartTableAnalytical_Explored"
enableAutoBinding="true"
class="sapUiResponsiveContentPadding"
editTogglable="false"
app:useSmartField="true"
app:useSmartToggle="true">
</smartTable:SmartTable>
</VBox>
