on 2016 Jan 14 10:46 AM
I created an abap cds view with annotations . SYSTEM = 7.50.
@AbapCatalog.sqlViewName: 'z_cds_test_2'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Test 2 CDS'
@OData.publish: true
define view ZMYFLIGHTS2
as select from spfli
association [1..1] to scarr as spfli_scarr
on spfli.carrid = spfli_scarr.carrid
{
@UI.selectionField: [ { position: 10 } ]
@UI.lineItem: [ { position: 10 } ]
key spfli.carrid as id,
@UI.lineItem: [ { position: 20 } ]
key spfli_scarr.carrname as carrier,
@UI.lineItem: [ { position: 40 } ]
key spfli.connid as flight,
@EndUserText:{ quickInfo:'Some info22' }
@UI.lineItem: [ { position: 50 } ]
spfli.cityfrom as departure,
@UI.lineItem: [ { position: 60 } ]
spfli.cityto as destination
}
I can see the GW service is connected to a annotation model and the annotation model can be reached through:
.../sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Annotations(TechnicalName='ZMYFLIGHTS2_CDS_VAN',Version='0001')/$value
For the UI5 part i created a simple test app:
Controller
var oModel, oView;
oModel = new sap.ui.model.odata.ODataModel("/sap/opu/odata/sap/zmyflights2_cds", true);
//oModel.setCountSupported(false);
oView = this.getView();
oView.setModel(oModel);
View
<smartTable:SmartTable id="mySmartTable"
entitySet="ZMYFLIGHTS2"
smartFilterId="smartFilterBar"
tableType="Table"
useExportToExcel="true"
useVariantManagement="false"
useTablePersonalisation="false"
header="Flights"
showRowCount="true"
enableAutoBinding="true">
<!-- layout data used to make the table growing but the filter bar fixed -->
<smartTable:layoutData>
<FlexItemData growFactor="1"/>
</smartTable:layoutData>
</smartTable:SmartTable>
I UI5 i get an error:
Select at least one column to perform the search
What am I missing here?
Any help will be appreciated.
Regards,
Bert
Request clarification before answering.
Hi Bert,
you have to set some initialy visible columns.
in the view on the SmartTable set property initiallyVisibleFields and enumerate some of your columns.
See below example
best regards,
Lucian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you must specify the annotation model when creating the ODataModel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In your annotation at the top of the file try adding
@Search.searchable: true
and then setting a field to be searchable with
@Search.defaultSearchElement: true
spfli.cityto as destination
Regards,
Jamie
SAP - Technology RIG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 17 | |
| 8 | |
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.