title: SAPUI5 OData binding to table
body: <p>I try to bind campaign data from the OData service <strong>CUAN_CAMPAIGN_SRV</strong> to a TableSelectDialog element. In my view I have an Input field with input help:</p>
  
  <pre><code>&lt;form:FormElement visible="true"&gt;
  &lt;form:label&gt;
      &lt;Label text="Campaign" design="Standard" width="100%" required="false" textAlign="Begin" textDirection="Inherit"/&gt;
  &lt;/form:label&gt;
  &lt;form:fields&gt;
      &lt;Input id="campaignId" type="Text" enabled="true" visible="true" width="auto" editable="true" showValueHelp="true" valueHelpOnly="true" valueHelpRequest="handleValueHelp"/&gt;
  &lt;/form:fields&gt;
  </code></pre>
  
  <p></p>
  
  <p>The value help calls the function <strong>handleValueHelp</strong> in my controller:</p>
  
  <pre><code>handleValueHelp: function(oController) {
       this.inputId = oController.oSource.sId;
       // create value help dialog
       if (!this._valueHelpDialog) {
           this._valueHelpDialog = sap.ui.xmlfragment(
               "my.view.Campaigns",
               this
           );
       this.getView().addDependent(this._valueHelpDialog);
       }
  
       // open value help dialog
       this._valueHelpDialog.open();
  }
  </code></pre>
  
  <p>This is when my <strong>table dialog (fragment)</strong> pops up:</p>
  
  <pre><code>&lt;core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core"&gt;
  &lt;TableSelectDialog id="campaignSelect" title="Select campaign" items="{path:'/CampaignSet'}" growingThreshold="5"&gt;
      &lt;columns&gt;
          &lt;Column&gt;
              &lt;Text text="Name"/&gt;
          &lt;/Column&gt;
          &lt;Column&gt;
              &lt;Text text="ID"/&gt;
          &lt;/Column&gt;
          &lt;Column&gt;
              &lt;Text text="Created at"/&gt;
          &lt;/Column&gt;
          &lt;Column&gt;
              &lt;Text text="Created by"/&gt;
          &lt;/Column&gt;
      &lt;/columns&gt;
      &lt;items&gt;
          &lt;ColumnListItem&gt;
              &lt;Text text="{CampaignName}"/&gt;
              &lt;Text text="{CampaignId}"/&gt;
              &lt;Text text="{CreatedOn}"/&gt;
              &lt;Text text="{CreatedBy}"/&gt;
          &lt;/ColumnListItem&gt;
      &lt;/items&gt;
  &lt;/TableSelectDialog&gt;
  </code></pre>
  
  <p></p>
  
  <p>So I tried to bind the EntitySet <strong>CampaignSet</strong> from OData Service CUAN_CAMPAIGN_SRV to the table. Therefore I added this code to my <strong>init() function</strong> of the controller:</p>
  
  <pre><code>var uname = "UNAME";
  var pw = "PW";
  
  var oModel = new sap.ui.model.odata.v2.ODataModel("https://host:port/sap/opu/odata/sap/CUAN_CAMPAIGN_SRV/",
  true, uname, pw);
  
  this.getView().setModel(oModel);
  </code></pre>
  
  <p><strong>The problem is:</strong> the table contains no data and this error shows up in the console:</p>
  
  <p><a href="https://i.stack.imgur.com/zpY9i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zpY9i.png" alt="Developer Console Error Log"></a></p>
  
  <blockquote>
    <p>Translated from german: "In the context of Data Services an unknown internal server error occured"</p>
  </blockquote>
  
  <p><strong>iwfnd/error_log says this:</strong></p>
  
  <blockquote>
    <p>Invalid format (return table): Row Number 1, Property Name
    'ChangedOn', Property Value '0 '</p>
  </blockquote>
  
  <p>Why does ChangedOn even matter if I don't want to bind this property?</p>
  
  <p>I can call something like below <strong>directly in browser</strong> with success:</p>
  
  <p><a href="https://host:port/sap/opu/odata/sap/CUAN_CAMPAIGN_SRV/CampaignSet" rel="nofollow noreferrer">https://host:port/sap/opu/odata/sap/CUAN_CAMPAIGN_SRV/CampaignSet</a>('100001625')/CampaignName</p>
  
  <p>What do I do wrong? Thank you for every hint!</p>
  
  <hr>
  
  <p>ChangedOn is set to Nullable in the service definition:</p>
  
  <p><a href="https://i.stack.imgur.com/CaISW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CaISW.png" alt="ChangedOn segw"></a></p>