Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

can a ABAP CDS view be used for CRUD operations?

amitgoyal
Explorer
0 Kudos
9,352

Hi

Is it possible to do create/update/delete operation using ABAP CDS? if so, how? I know it is possible via ABAP RAP framework but I was curious to find out if it can be done by any other methods?

Thanks Amit

1 ACCEPTED SOLUTION

somnath
Active Participant
0 Kudos
6,408

Hello Amit,

Yes, this should be possible with ABAP CDS using BOPF. You need to attach Object model annotations and there you need to mention create / update/delete. The logical part will be shifted to the BOPF layer. Hope this helps.

- Thanks, Som

8 REPLIES 8

Sandra_Rossi
Active Contributor
0 Kudos
6,408

Using a view (select) to create, update and delete?

amitgoyal
Explorer
0 Kudos
6,408

my understanding is that CDS views are mostly for reading data and to do code push down using some of the in built sql functions and expressions.

What I am not clear is if we can use a ABAP CDS view for creating to modifying a underlying database table? or is it simply for READ only purpose?

keremkoseoglu
Contributor
6,408

You can take advantage of AMDP or EML to modify data. Or, do it in plain ABAP.

somnath
Active Participant
0 Kudos
6,409

Hello Amit,

Yes, this should be possible with ABAP CDS using BOPF. You need to attach Object model annotations and there you need to mention create / update/delete. The logical part will be shifted to the BOPF layer. Hope this helps.

- Thanks, Som

0 Kudos
6,408

Thanks Somnath. So if I understand this correctly - we can only enable CRUD operations either by attaching a BOPF or build ABAP RAP based applications? CDS on its own cannot be using for CUD operations.

0 Kudos
6,408

Hello somnath_sap2020_22,

Sorry for asking you a question on a different topic. But I had to find a way to reach you. I watched your videos about RAP-SAP BAS on Youtube. First of all, thank you very much for these.

I want to reach you. But how can we do this? Could it be an E-Mail or a phone number?

How did you reach CDS- Behavior Implementation Class via UI5? I want to understand and learn this. Thank you very much.

Thank you very much.

The main purpose of accessing RAP via SAPUI5 should be to access and manage CDS Behavior Implementation Classes in RAP, right?
But unfortunately this cannot be done, or I could not find a way. Do you know about this?

Access RAP CDS behavior implementations (backend), via the Business App.Studio-UI5 (Frontend) button

I can access RAP-oData from an empty UI5 project. No problem with that. However, I don't know how to reach the annotation (action-button) in this RAP-oData. Because when I press the button on the UI, I want this button to be able to reach the "Behavior Implementation Class" that I created together with the CDs, as in fiori. But I can't find how to do this? I have also read the SAP Flexible Programming Model topic, but I do not think it is relevant to my position.

If you know this, could you suggest me how to do it please?

UI5 Freestyle Application call (RAP) BOPF Custom Action

Thank you

0 Kudos
6,408

orhaner - If you are using Fiori elements then action button can be added through annotations but if you are using Freestyle UI5 application then action in RAP BO is similar to Function Import(You can look at metadata of service for hints). If you need sample code to trigger odata function import through onPressEvent of button I can provide some code.

former_member820465
Participant
0 Kudos
6,408

Hello somnath_sap2020_22,

Sorry for asking you a question on a different topic. But I had to find a way to reach you. I watched your videos about RAP-SAP BAS on Youtube. First of all, thank you very much for these.

I want to reach you. But how can we do this? Could it be an E-Mail or a phone number?

How did you reach CDS- Behavior Implementation Class via UI5? I want to understand and learn this. Thank you very much.

Thank you very much.

The main purpose of accessing RAP via SAPUI5 should be to access and manage CDS Behavior Implementation Classes in RAP, right?
But unfortunately this cannot be done, or I could not find a way. Do you know about this?

Access RAP CDS behavior implementations (backend), via the Business App.Studio-UI5 (Frontend) button

I can access RAP-oData from an empty UI5 project. No problem with that. However, I don't know how to reach the annotation (action-button) in this RAP-oData. Because when I press the button on the UI, I want this button to be able to reach the "Behavior Implementation Class" that I created together with the CDs, as in fiori. But I can't find how to do this? I have also read the SAP Flexible Programming Model topic, but I do not think it is relevant to my position.

If you know this, could you suggest me how to do it please?

UI5 Freestyle Application call (RAP) BOPF Custom Action

Thank you very much.

Orhan