Skip to Content

Hello Fellow SCNers,

In this blog, I will demo the usage of Smart Table control including OData Metadata development and Front End application code.

Smart Table uses Vocabulary based annotations in OData.


Data Structure and Data preparation

Step 1: Go to SE11 and create a table as shown below.


Step 2: Populate the data and check.


Service Creation

Step 3: Import the highlighted vocabulary(ies) in SEGW(Project Builder Transaction). (This is a one time activity)


Step 4: Create a Service with Vocabulary Based Annotation as

Serv Det 1.jpg

Step 5: Create an Entity – SmartTable and corresponding EntitySet. These are standard steps and I am ignoring them here, though I have attached screenshot of the same.

Serv Det 2.jpg

Properties –

Serv Det 3.jpg

Step 6: Import the vocabulary in the Service as –

Import Vocab.jpg

Step 7: Create the Line Item Annotation which is the most important one for Smart table as it will help the UI5 framework to create table structure.

Choose the line item column and then click on Create Annotation.

Line Item.jpg

Step 8: Click on ‘Append Row/Create’

Line Item 2.jpg

Step 9: Choose the highlighted type for property

Line Item 3.jpg

Step 10: One column is created as shown below –

Line Item 4.jpg

Do the above step for all 4 columns.

Step 11: Now the service will look like –

Proj 1.jpg

Step 12: Implement the Getter for Smart Table Entityset too –


Now the metadata should look like below

<edmx:Edmx xmlns:edmx=”” xmlns:m=”” xmlns:sap=”” Version=”1.0″>

<edmx:Reference xmlns:edmx=”“Uri=”https://<host:port>/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName=’%2FIWBEP%2FVOC_UI’,Version=’0001′,SAP__Origin=’LOCAL’)/$value“>

<edmx:Include Namespace=”″/>


<edmx:Reference xmlns:edmx=”“Uri=”https://<host:port>/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName=’%2FIWBEP%2FVOC_CORE’,Version=’0001′,SAP__Origin=’LOCAL’)/$value“>

<edmx:Include Namespace=”Org.OData.Core.V1″/>


<edmx:Reference xmlns:edmx=”“Uri=”https://<host:port>/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName=’%2FIWBEP%2FVOC_COMMUNICATION’,Version=’0001′,SAP__Origin=’LOCAL’)/$value“>

<edmx:Include Namespace=”″/>


<edmx:DataServices m:DataServiceVersion=”2.0″>

<Schema xmlns=”” Namespace=”ZSMARTTABLE4″ xml:lang=”en” sap:schema-version=”0000″>

<EntityType Name=”SmartTable” sap:content-version=”1″>


<PropertyRef Name=”Bname”/>


<Property Name=”Bname” Type=”Edm.String” Nullable=”false” MaxLength=”12″ sap:label=”User”/>

<Property Name=”Fullname” Type=”Edm.String” Nullable=”false” MaxLength=”80″ sap:label=”Complete name”/>

<Property Name=”SmtpAddr” Type=”Edm.String” Nullable=”false” MaxLength=”241″ sap:label=”E-Mail Address”/>

<Property Name=”Location” Type=”Edm.String” Nullable=”false” MaxLength=”40″ sap:label=”Location”/>


<EntityContainer Name=”ZSMARTTABLE4_Entities” m:IsDefaultEntityContainer=”true”>

<EntitySet Name=”SmartTableSet” EntityType=”ZSMARTTABLE4.SmartTable” sap:content-version=”1″/>


<Annotations xmlns=”” Target=”SmartTable”>

<Annotation Term=””>


<Record Type=””>

<PropertyValue Property=”Label” String=”Location”/>

<PropertyValue Property=”Target” AnnotationPath=”Location”/>


<Record Type=””/>

<Record Type=””>

<PropertyValue Property=”Label” String=”Location”/>

<PropertyValue Property=”Target” AnnotationPath=”Location”/>


<Record Type=””/>




<atom:link xmlns:atom=”” rel=”self” href=”<host:port>/sap/opu/odata/sap/ZSMARTTABLE4/$metadata“/>

<atom:link xmlns:atom=”” rel=”latest-version” href=”<host:port>/sap/opu/odata/sap/ZSMARTTABLE4/$metadata“/>




Front End Code

Step 13: For sake of simplicity I have put the Smart Table in Index.html file and run it.

<!DOCTYPE html>


  <meta http-equiv=’X-UA-Compatible’ content=’IE=edge’ />

  <meta http-equiv=’Content-Type’ content=’text/html;charset=UTF-8’/>

<title>Smart Table</title>

  <script id=’sap-ui-bootstrap’ type=’text/javascript’




data-sap-ui-libs=’sap.ui.commons, sap.m’>


  <script id=”view1″ type=”sapui5/xmlview”>

  <core:View xmlns:core=”sap.ui.core” xmlns=”sap.m” xmlns:smartFilterBar=”sap.ui.comp.smartfilterbar” xmlns:smartTable=”sap.ui.comp.smarttable” controllerName=”smartTable.controller” class=”sapUiSizeCompact”>

  <Page id=”page” title=”Customers”>

  <smartTable:SmartTable entitySet=”SmartTableSet” enableAutoBinding=”true”/>






sap.ui.controller(“smartTable.controller”, {

  onInit: function() {

  var sURL, oModel, oView;

  sURL = “<host:port>/sap/opu/odata/sap/ZSMARTTABLE4”;

  oModel = new sap.ui.model.odata.v2.ODataModel(sURL, {

  json: true


  oView = this.getView();




sap.ui.core.UIComponent.extend(“smartTable.Component”, {


  * Initialize the application


  * @returns {sap.ui.core.Control} the content


  createContent: function() {

  var app = new sap.m.App({

  initialPage: “idView”


  var oView = sap.ui.xmlview(“idView”, { viewContent: jQuery(“#view1”).html() });        


  return app;



  new sap.ui.core.ComponentContainer({

  name : “smartTable”




  <body class=’sapUiBody’>

  <div id=’content’></div>



Final Output –


PS: You may get some errors like one shown below but it is dependent on the SAPUI5 Version. I have used 1.33.0-SNAPSHOT version but it works on 1.28 also.


I would like to thank Santhosh Gowda whose blog gave me inspiration to test this control and Arshdeep Singh for his help.

I would request you all to provide feedback and ask questions to enhance everyone’s learning.


Ankit Maskara.

To report this post you need to login first.


You must be Logged on to comment or reply to a post.

  1. Kiran VK

    Hi Ankit,

    First Thank you for this wonderful blog.

    And i followed your blog, i did as per your inputs but no data is displaying in UI. any suggestions please.

    I need an help where we can bind the data Dynamically based on input. for example if user given one sales order need get the SO Item details and to be displayed same using SmartTable. In the above example user do not have any interaction.

    Kind Regards, Kiran

  2. Moritz Ruff

    I followed all you instructions, but I get this Message (we are on 1.44):


    And in the Configuration of the Control I get no Columns:


    Can you assist?


    Update: The Gateway seems to create wrong Metadata, see SCN:

      1. Moritz Ruff

        Hi Diana,

        thank you for your anwser. Unforunally you don’t have the oportunity to mark Properties as “Filterable” when you use the Vocabulary-Services needed for Smart-Controls.

        Best regards

  3. Former Member

    Hi all,

    I was implementing the same approach and I was also getting the Popup “Select at least one column to perform the search”.

    Finally I have found the problem. In my case using the annotation type it doesn’t work, instead I need to use the type.

    Hope it helps!



Leave a Reply