Skip to Content
0
Former Member
Oct 26, 2022 at 02:31 PM

SAP FIORI MASTER DETAIL APPLICATION - SAVE DATA THROUGH ODATA

122 Views Last edit Dec 22, 2022 at 06:16 AM 2 rev

Hi All,

I have created an application using the template provided - " Master Detail Application" on top of an Odata.

By default the view created id " Detail View" and all the line items are reflecting correctly.

I created another view "Edit_DetailPage View " and binded the data. So when the user edit the detail view it navigate to the Edit_DetailPage View which is working fine.

Now I need to SAVE any change data from the Edit_DetailPage View with a SAVE button.

I need to get all the data from the Edit_DetailPage to Odata. I have written the below code, but it seems to be wrong and not working. Can you please let me know the coding part required in the onSave event in the view.

onSave: function (oEvent)

{

var oDataModel = this.getView().getModel();

var mNewEntry = {};

mNewEntry.LicenceNo = sap.ui.getcore().byId("LicenceNo").getValue();

oDataModel.update(mNewEntry);

}

Thank You.