on 2023 Dec 11 9:41 AM
Hi SAP Community,
I am trying to set up a Fiori App (RAP) with the following properties:
I have one parent (root) entity called 'actual' and one child entity called 'forecast'. What I want to achieve is to include all the fields of both entities on one object page by linking both entities with the same UUID field ([0..1 Cardinality]. Below is a snipped of the CDS views code of both entities:
define root view entity ZRE_MAIN_ACTUAL
as select from ztd_actual as Main_Actual
composition [0..1] of ZRE_MAIN_FORECAST as _MAIN_FORECAST
define view entity ZRE_MAIN_FORECAST
as select from ztd_forecas as Main_Forecast
association to parent ZRE_MAIN_ACTUAL as _MAIN_ACTUAL on $projection.Uuid = _MAIN_ACTUAL.Uuid
Now, when I preview the app and create a new object I can see the fields of both entities on the object page, however, only the fields of the parent entity are editable and the child ones are not editable. Also, when I go into the draft data tables of both entities I can see only data in the parent entities data table but no data in the child table.
To preview the app I am creating a Fiori app project in VS Code with the help of SAP Fiori Tools. My app uses oData V4 and is draft enabled.
I would be happy for any hints on how I can achieve to be able to have all the fields editable with a [0..1] cardinality. Thank you 🙂
Request clarification before answering.
Hi felixdeum
Below are some points which you may check if you have implemented or not:
association <Child Entity> { create; with draft };
This will allow you have Create button for Child Entity.
As per the functionality and based on my experience (little) first system will ask you to fill all Root entity form and then you ill click on Create Button of Associated Entity which will open Object Page to fill form.
For more details please visit below video:
https://www.youtube.com/watch?v=QdmFrja4yZw
Data will go together (Root and Child) to Persistent state, till tile both records should be available in your Draft table.
Thanks-
Abhishek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhishek, Thanks for your reply 🙂
I had already added the given line into my behavior implementation.
In my case I do not want to implement or show and create buttons for the child entity. The child entity is supposed to be automatically created when the parent (root) entity is being created.
Hi felixdeum
I have not got chance to Implement this kind of scenario but still below are my suggestions:
You may want to use EML in order (Association create) with header, and you also might have Implemented early Numbering method, there you may try to put your logic.
For more details you may check below video for EML Create by Associations:
https://www.youtube.com/watch?v=5MZQ5EDgyxU
I would also like you to read about Factory Methods in ABAP RAP that might help.
Thanks-
Abhishek
User | Count |
---|---|
71 | |
33 | |
9 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.