cancel
Showing results for 
Search instead for 
Did you mean: 

Add Edit View and Save Function to Fiori ODATA App

Former Member
0 Kudos

Hello Community,

it is very easy for me to build a fiori app with a master detail template providing data from an ODATA service with Web IDE.

My ODATA Service does not only provide a GET function, it is also able to create and update entries, but the master detail template only displays the data and has no edit view.

What is the easiest way to add an edit function to my app?
I am able to create an edit view and call the ODATA service with ajax and send the changed values from document.getElementById() but what is the correct way to do this?

Is there a step by step instruction or demo app?

Thanks for your help!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

There is already a template providing an edit function in the category "SAP Fiori Application" called "CRUD Master-Detail Application".

Answers (1)

Answers (1)

former_member227918
Active Contributor
0 Kudos

dont use ajax and getElementById() etc.

use sap.ui.model.odata.v2.ODataModel or v4 and to add and edit functionality explore createEntry() and submitChanges(), will help you.

Former Member
0 Kudos

Thanks a lot for your help Akhilesh!
But what exactly are the next steps to implement an edit function, after creating an app using a template with an ODATA service?
Is there already an ODataModel or do I have to create it in the save function?

Do I have to change anything in the structure of the template, or am I able to simply add the save function without doing anything else?

former_member227918
Active Contributor
0 Kudos

once you select the oData service while creating app from template, initially odata model will be created(check- component.js and manifest.json). no need to create any other model and all.

now, you can perform CRUD operation with the help of this model, check below link for more info:

OData V2 Model