Quantcast
Channel: SCN : All Content - SAP Gateway
Viewing all articles
Browse latest Browse all 2823

Can't access SAP sample gateway services data

$
0
0

Hello Everybody,

 

I am trying to connect my UI5 application with SAP sample oData Gateway Services. But unfortunately it doesn't Show any data in the table of my UI5 application. oData Gateway URL and application code snippets are the following.

 

Sample Gateway Services: https://sapes1.sapdevcenter.com/sap/opu/odata/sap/ZGWSAMPLE_SRV/$metadata

 

oData Entity values:

-<EntityType sap:content-version="1" Name="BusinessPartner">

-<Key>

<PropertyRef Name="BusinessPartnerID"/>

</Key>

<Property Name="BusinessPartnerID" sap:updatable="false" sap:label="GeschPartnID" MaxLength="10" Nullable="false" Type="Edm.String" sap:creatable="false"/>

<Property Name="BpRole" sap:label="GeschPartnRolle" MaxLength="3" Type="Edm.String" sap:filterable="false"/>

<Property Name="EmailAddress" sap:label="E-Mail-Adresse" MaxLength="255" Type="Edm.String" sap:semantics="email" sap:filterable="false"/>

<Property Name="CompanyName" sap:label="Firmenname" MaxLength="80" Type="Edm.String"/>

 

Application code snippets:

 

createContent : function(oController) {

 

  var oModel = new sap.ui.model.odata.ODataModel("https://sapes1.sapdevcenter.com/sap/opu/odata/sap/ZGWSAMPLE_SRV");

  sap.ui.getCore().setModel(oModel);

 

  var oTable = new sap.ui.table.Table({

  editable: false

  });

 

  oTable.addColumn(new sap.ui.table.Column({

  label: new sap.ui.commons.Label({text: "ID"}),

  template: new sap.ui.commons.TextField().bindProperty("value", "BusinessPartnerID"),

  sortProperty: "BusinessPartnerID"

  }));

  

  oTable.addColumn(new sap.ui.table.Column({

  label: new sap.ui.commons.Label({text: "Name"}),

  template: new sap.ui.commons.TextField().bindProperty("value", "CompanyName"),

  sortProperty: "CompanyName"

  }));

  

  oTable.addColumn(new sap.ui.table.Column({

  label: new sap.ui.commons.Label({text: "E-mail"}),

  template: new sap.ui.commons.TextField().bindProperty("value", "EmailAddress"),

  sortProperty: "EmailAddress"

  }));

  

     oTable.setModel(oModel);

     oTable.bindRows("/BusinessPartner");

     oTable.placeAt("content");

 

  }

 

Please point me out where is the problem.

Thank you very much.


Viewing all articles
Browse latest Browse all 2823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>