cancel
Showing results for 
Search instead for 
Did you mean: 

How to properly Bind SAPUI5 SmartTable in CAP to SAP HANA View with Input Parameters through CDS?

cosminpopa
Associate
Associate
173

Hello,

I’ve created a CDS entity in my CAP project with input parameters, but I’m encountering issues when trying to bind it to a SAPUI5 SmartTable. Somehow, I cannot get SAPUI5 to pass the input parameters to the URL. I implemented SmartTables without input parameters and they worked smooth. Data is properly fetched through oData, having the URL /odata/v2/test-service/V_TEST(PARAM1='X',PARAM2='Y')/Set.

 

@CDS.persistence.exists
@CDS.persistence.calcview
entity V_TEST(PARAM1: String, PARAM2: String) {
       Data1:  String(50)  @title: 'Data1';
       Data2: String(50) @title: 'Data2';
}
<smartTable:SmartTable
                id="SmartTable"
                smartFilterId="smartFilterBar"
                initiallyVisibleFields="DATA1,DATA2"
                entitySet="V_TEST"
                tableType="Table"
                useTablePersonalisation="true"
                useVariantManagement="true"
                persistencyKey="SmartTable_Explored"
                enableAutoBinding="true"
                enableExport="true"
                class="sapUiResponsiveContentPadding"
                beforeRebindTable=".onBeforeRebindTable"
            >
 
Also added a smart filter bar, but it does nothing when trying to add the filters. It still says no data and no columns.
Do you have any ideas how can I make that happen? Thank you !

 

View Entire Topic
junwu
SAP Champion
SAP Champion
0 Kudos

https://stackoverflow.com/questions/31996305/bind-smarttable-with-entityset-of-an-entity/32012301#32...

 

tableBindingPath is your keyword for google or search in this community.

cosminpopa
Associate
Associate
0 Kudos

tableBindingPath = "/V_TEST(PARAM1='X',PARAM2='Y')/Set"? I do not understand how can I use tableBindingPath here. I do not have someting like "Items" in my entity that I should nav to. Probably can add /Set, but, I need to add the input parameters first.

junwu
SAP Champion
SAP Champion
0 Kudos
google please, the question is answered before.....
cosminpopa
Associate
Associate
0 Kudos

Alright.

cosminpopa
Associate
Associate
0 Kudos
https://community.sap.com/t5/technology-q-a/issue-with-binding-smart-table-with-entityset-and-tableb... Tried this approach. Still nothing. More than that, there are no columns to be shown.
cosminpopa
Associate
Associate
0 Kudos
I managed to get the SmartTable to send the correct request and retrieve the expected data. However, the SmartTable still displays the input parameters PARAM1 and PARAM2 as table columns, instead of showing the actual data columns returned in the response. Do you have any idea how can I fix this?