cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with data updating using OData Model and SAP UI5

Former Member
0 Kudos

Hi everyone,

I made a Gateway Service and I'm able to consume this Service with SAP UI5 (Read/Display data using the OData Model). The Service is also prepared to update values, i tried it in Gateway Client with 'get' and 'put' requests and it works fine.

This is what I have:

     var layout = new sap.ui.commons.layout.MatrixLayout('layout');
       layout.setWidth('80%');
       var rPannel = new sap.ui.commons.Panel('rPannel');
      
       var rTitle = new sap.ui.commons.Title('rTitle');
       rTitle.setText('All');
       rPannel.setTitle(rTitle);
      
       var oTable = new sap.ui.table.DataTable();
     
       oTable.addColumn(
         new sap.ui.table.Column({
          label: new sap.ui.commons.Label({text: "Land"}),
          template: new sap.ui.commons.TextField().bindProperty("value", "bankCountry"),
          sortProperty:"bankCountry"
         }));
       oTable.addColumn(
         new sap.ui.table.Column({
          label: new sap.ui.commons.Label({text: "Name"}),
          template: new sap.ui.commons.TextField().bindProperty("value", "bankName"),
          sortProperty:"bankName"
         }));
     
       var oModel = new sap.ui.model.odata.ODataModel(

        "http://..............",
         false,
         "user",
         "pw");
      
       oTable.setModel(oModel);
       oTable.bindRows("/BankCollection");
    
       rPannel.addContent(oTable);
       layout.createRow(rPannel);
       this.addContent(layout);

Now I would like to update the name of a bank, but I dont know how....

Do you know any helpful examples or tutorials which could help me?

I would appreciate your valuable help.

Kind Regards

Glen

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Glen,

You can refer to the following blog post, thought it talks about HANA to start with but at the end it is all about consuming the odata service which is exposed by netweaver gateway using UI5

http://scn.sap.com/community/developer-center/front-end/blog/2013/07/07/native-development-in-sap-ha...

And also the best place for SCN Community which for SAP UI5 is :

http://scn.sap.com/community/developer-center/front-end

Regards,

Srinivas Divakarla


Former Member
0 Kudos

Hi Srinivas

Thank you for your answer! This is all about consuming the oData service. Do you know an example where they update datas?

Kind Regards

Glen

former_member187794
Participant
0 Kudos

hello Glen

could you help me with the logic, if have have got a solution to update the data using Odata?

Thanks

Regards

Giri