I'm new with ODATA. I have created a BAPI, CDS Views and want to use them together. Can I consume or implement ODATA on Bapi or is it the other way around? Is it possible to implement it using RAP?
Request clarification before answering.
Hello @walkerist79 ,
Without more information, it is a bit difficult to answer your question fully.
If my answer is not helpful, maybe you can add some information about your CDS view, the BADI and what you were hoping to achieve?
But I can give you some general pointers.
In general: No. The CDS views are created to be "Database Agnostic", meaning that they have to work on some MySQL server as well as a HANA server, so including ABAP code is not supported directly in the view.
Again, it comes down to what your BADI does. If the logic can be replicated in a CDS view with the functions available, you might as well 'do it again'. However, I imagine that if it could, you wouldn't be asking 🙂
Absolutely!
If you are building your OData service from scratch, you can do pretty much anything, including a 'select' from your CDS view.
You can follow this guide: How to create or Building a Custom SAP Gateway Service OData with SEGW.
Again, absolutely!
If you are new to RAP, I recommend you just start from the top of the official documentation, but the chapter on "Developing Actions" might be closer to what you are looking for.
Here, you can define custom actions, and can implement them as you see fit in an ABAP class and consume your BADI, while still reading your CDS views.
Well, it depends on what you want.
Consuming a BADI in a CDS view is not supported, however there are ways to combine them. Either with a custom OData Project, or through RAP. However of these are looong ways around, if you are just starting out with either.
So, if it's for a client, I would suggest you do your best to replicate the functionality with the standard CDS library. If it is just for fun / learning, it depends on how much of a challenge you are in for.
An OData project is - arguably - easier to start, but RAP is a powerful framework, if you can get your head around it.
Hope this helps 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have a custom entity then you can go with Unmanaged implementation and can call released API instead of BAPI.
If you want to use ABAP then you can create a project in SEGW, get your CDS' reference in project and override the create method. There you can write the BAPI Code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 10 | |
| 5 | |
| 5 | |
| 5 | |
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.