on 2025 May 06 4:16 PM
I am in the BTP ABAP Environment working on some RAP annotations. I have a RAP Object that looks like this:
define root view entity ROOT
composition [0..*] of CHILD as _child
{
key uuid,
...
_child
}
define view entity CHILD
association to parent ROOT as_root on CHILD.rootuuid = ROOT.uuid
{
key uuid,
rootuuid,
CoolValue,
_root
}
In the annotations of the ROOT, I know I can add fields from my child like so:
annotate entity ROOT with
{
@ui: {
lineItem: [{ position: 10, value: '_child.CoolValue' }],
selectionField: [{ position: 10, element: '_child.CoolValue' }]
}
_child;
}
These annotations work great if I want the field to be displayed by default.
My requirement is to have the field available, but not displayed. So for filter fields, I want to see the field in 'Adapt Filters', and for the list I want to view the field in the view settings' Columns list. But by default they should not be displayed.
If I remove the annotations, the field 'CoolValue' is not available at all (because you lose the reference to the field that is important in the child entity). How can I adjust this implementation to make the field available, but not shown by default?
Request clarification before answering.
how about add a custom column in the table with availability='Adaptation'?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1. What happens if you remove the position from lineitem and selectionfiled?
lineItem: [ { value: '_child.CoolValue' } ] ...
2. or something else:
does it support hidden : true ?
lineItem: [{ position: 10, value: '_child.CoolValue', hidden: true }] ?
3. or using
lineItem: [{ position: 10, value: '_child.CoolValue', importance: #LOW, visible: false }]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you defined consumption on top of your root and child entity?
what if you define this on your consumption root entity :
define root view entity YYY as projection on XXX ( your root entity)
{ ....
_child.CoolValue as coolValue
.... }
also your annotate should be now on YYY
annotate entity YYY with
{
....
}
and give it no annotation on annotate entity, I mean does not even define this field ( CoolValue) on entity annotation. Would you be able to see this field on filter section?
User | Count |
---|---|
23 | |
21 | |
8 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.