on ‎2024 Dec 15 5:32 PM
I am learning RAP, so I have a doubt that why do we need Read Entitiy in RAP . I understood that to read the data from BO. but we already had select stmt/modify/insert stmt for that. I could have written select from cds entity to get my data in an internal table(just assuming).
requesting your help on this. this could be silly question but as i am new it feels a lot to me. tnx in advance
Request clarification before answering.
To complete the CRUDQ operations of a REST compliant HTTP Service!
Consider the in the end BO or say the Service you are building which needs to be consumed by an outside Entity( meaning other outside client/consumer like eg. Postman tool), for it to be accessed from an outside world/client it should have options for implementing R READ operations as well. Read based on Navigations, Expand etc. these won't work without that.
Thanks,
Sijin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Helpful link(refer Andre's comments ) https://community.sap.com/t5/technology-q-a/how-to-implement-read-quot-deep-structure-quot-in-sap-ra...
it deals with transaction buffer, I believe.
imagine you are creating a record, it is not saved yet, will you get that record via querying cds?probably not, but Read entity will give that record, if I am not wrong.
same for update case, if update is not saved, querying cds will give u old data, read entity will give updated data in your session/transaction.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Subhashish,
A RAP BO(Business Object) is not just a CDS view. It usually represents a real-world artifact that has both a structure (1 or more CDS views with parent-child hierarchies/associations) as well as a behaviour(operations and properties). 'Read Entities' which is a part of EML(Entity Manipulation Language) provides type-safe access to the RAP BO while abstracting the complexity of the underlying BO implementation from the developer.
More here:
Best Regards,
Saurabh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @das_shubhashish,
It's a good question! Once we start learning Entity Manipulation Language (EML), it's natural to wonder why we need to use EML, especially READ ENTITY, ENTITIES.
The answer is simple. If there is a Business Object (BO) and its data model with CDS View Entities, then use READ ENTITY, ENTITIES in either local mode or external usage. I would strongly advise against using these BO's CDS View Entities directly.
Secondly, you will undoubtedly benefit from using READ ENTITY, ENTITIES in LOCAL MODE. This allows you to read affected entity instances and draft-enabled entity instances, among other advantages.
Furthermore, you can read data from not only the selected entities but also from associated entities either IN LOCAL MODE and external. In this case, the BO has a root entity with one or more child and leaf entities.
Thanks,
Tuncay
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 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.