1

Hi i have a smart table like below

<VBox id="myid">
        <smartTable:SmartTable id="smartTable_ResponsiveTable" entitySet = "Employee" enableAutoBinding="true"
                tableType="ResponsiveTable" initialise="onSmartTableInit" editable="false" useVariantManagement="false"
                useTablePersonalisation="true" header="Employees" showRowCount="true" useExportToExcel="true" />
</VBox>

my odata service is like below:

<workspace>
  <atom:title>Default</atom:title>
  <collection href="TablePersonalization">
      <atom:title>TablePersonalization</atom:title>
  </collection>
  <collection href="Employee">
     <atom:title>Employee</atom:title>
  </collection>
  <collection href="Collections">
    <atom:title>Collections</atom:title>
  </collection>
</workspace>

my smart table is there in second view which is has a navigation from the first view. when ever i move to the second view we are binding the total view with a different path like below.

  this.getView().bindElement(bindingPath);

bindingPath = "/Collections('12345')"

here in my case, i am trying to bind the path "Employee", which is a parent navigation at root level.

iam confused about entitySet and tableBindingPath

metadata of oData is as follows.

<EntityType Name="EmployeeType">
 <Key>
  <PropertyRef Name="EMP_ID"/>
 </Key>
 <Property Name="EMP_ID" Type="Edm.String" Nullable="false"   MaxLength="1024"/>
 <Property Name="NAME" Type="Edm.String" Nullable="false" MaxLength="1024"/>
 <Property Name="ADDR" Type="Edm.String" Nullable="false" MaxLength="1024"/>
 <Property Name="SAL" Type="Edm.String" Nullable="false" MaxLength="1024"/>
</EntityType>

my DB table is as follows:-

entity Employee {
    key EMP_ID      :               String(1024) not null;  // Identifier of   the Column
    NAME            :               String(1024) not null;
    ADDR            :               String(1024) not null;
    SAL             :               String(1024) not null;
}; 

my odata is as follows.

"MY_SCHEMA"."my.db.models::CollectionModel.Employee" as "Employee";

i confused about the mapping here. what does the entitySet expects, is it table name or entityType name in metadata and what about the table binding path. Can any body answere this.

saran kumar
  • 69
  • 2
  • 3
  • 7

2 Answers2

3


The entitySet expects the name of your Entity in Service. This is mainly required so that in the settings button all the fields in your entity will come up.
TableBindingPath - this is to bind the data. For example you could be binding the table to association to a Parent in which case you specify the association name.
This Reference should probably help.

Kindly note, if you do not specify the tableBindingPath and set the enableAutoBinding flag to true then system will table will automatically call getEntitySet on entitySet specified.
Hope this helps.
Thanks and Regards,
Veera

Community
  • 1
  • 1
Veeraraghavan N
  • 839
  • 1
  • 10
  • 19
  • Hi Veera, thank you for your response. i tried the same as you mentioned, still not working, in my case i have a navigation as follows. /Collection('23453')/PatientItems. i have given entitySet="CollectionsType" and since it has a navigation to the PatientItems so i have given tableBindingPath="PatientItems". i found this name(PatientItems form the navigation property in metadata). but still facing problem. in the reference you have mentioned i didnot understand POHeaders – saran kumar Aug 18 '15 at 11:07
  • When ever we move to a page where the we are showing smart table, we are change the binding context as well. means we are setting this.getView().bindElement("/Collection('23453')"). now model also point to this path. – saran kumar Aug 18 '15 at 14:28
  • Hi Saran, The tableBindingPath is fine but the entitySet should be the name of the entitySet of the PatientItems. For Example lets take 2 entitySets 1.HeaderSet 2. ItemSet and the navigation from HeaderSet to ItemSet is called items EntitySet should be ItemSet tableBindingPath should be items – Veeraraghavan N Aug 18 '15 at 15:20
  • Hi Veera that means, i have my oData meta data as follows and i have given entitySet = "PatientsType" is this the one you explained? – saran kumar Aug 19 '15 at 07:53
  • Hi veera, i you dont mind can we take this offline. her is my mailid : pleaseansmyquestion@gmail.com, can you please send me a test mail. – saran kumar Aug 19 '15 at 14:01
  • Hi Veera, is it mandatory that, our oData service metadata should have sap specific annotations?. – saran kumar Aug 19 '15 at 15:01
  • Hi Veera, I came to know that smart table is working in version 1.30 and not in the lower versions, i dont know the reason excatly, but i think its because of the metadata of the Odata. Still i am in confusion that is it mandatory that,our oData service metadata should have sap specific annotations? if yes how can we inject the annotations into meta data in Hana side, because we should not change the version, just because of the smart table. – saran kumar Aug 20 '15 at 09:41
  • Smart Table should be available from 1.26 or 1.28. To implement smart table it is not absolutely mandatory that oData annotations should be there. You can do without these annotation then some features of smart table wont be available. But you should be still be available to use Smart as long you have a oData service . The metadata of the Service is a must but not other annotations. – Veeraraghavan N Aug 20 '15 at 10:43
0

I found the below regarding SmartTable.

Check the version of the sapui5 you are using, in my case i am using sapui5 1.28.5, in which smart table is not working, then i changed the version of the sapui5 to 1.30 it started working.

saran kumar
  • 69
  • 2
  • 3
  • 7