Skip to Content
0

Add Edit View and Save Function to Fiori ODATA App

Jun 05, 2017 at 09:23 PM

175

avatar image

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!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Peter Pan Jun 08, 2017 at 11:19 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Akhilesh Upadhyay Jun 06, 2017 at 08:28 AM
0

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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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?

0

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

0