cancel
Showing results for 
Search instead for 
Did you mean: 

CRUD in SAPUI5

Former Member
0 Kudos

HI

I have seen that to remove an entry from the model

I can use model.remove(entry);

My question: does it also delete the entry from the database?

In case I would like to delete an entry from the db, do I

have to implement a new service?

Thank you for your support.

Regards

Yuval

Accepted Solutions (1)

Accepted Solutions (1)

ChandraMahajan
Active Contributor
0 Kudos

YUVAL PEERY wrote:

My question: does it also delete the entry from the database?

In case I would like to delete an entry from the db, do I

have to implement a new service?

OData Model is server side model and hence you have to implement the logic in OData service in the backend to handle CRUD operations.

you need not to implement new service but need to implement corresponding CRUD methods in DPC_EXT class as I mentioned in my blog (Assuming you are talking about OData services in SAP Gateway)

Once it is done then from UI5 application, you can perform CRUD operations as described here OData Write Support - What's New in SAPUI5 - SAP Library

Regards,

Chandra

Former Member
0 Kudos

Hi Chandra

Thank you very much for referring me to your blogs.

I will study them carefully.

Reagrds

Yuval

Former Member
0 Kudos

Hi Chandra

I am following your blog and run into a little problem:

after importing my DDIC and generating classes

when I try to register my project as service,

the buttons in folder Service Maintenance are grayed out.

Any idea why?

Thanks

Yuval

ChandraMahajan
Active Contributor
0 Kudos

For this issue you can refer this discussion from SAP Gateway space.

Regards,

Chandra

Answers (1)

Answers (1)

SergioG_TX
Active Contributor
0 Kudos

anything you do in the model (most likely) will only be done on the model at the client side.. if you do an odata model post or ajax call to the xsjs and then do an interaction to the db from the server side javascript, only then you will delete from the db.