cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How do I make a field from a child entity available as non-default in a list report?

MattDion
Participant
176

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?

Accepted Solutions (0)

Answers (2)

Answers (2)

junwu
SAP Champion
SAP Champion
0 Kudos

how about add a custom column in the table with availability='Adaptation'?

https://sapui5.hana.ondemand.com/test-resources/sap/fe/core/fpmExplorer/index.html#/customElements/c...

suzanne_alivand
Explorer
0 Kudos

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 }] 


MattDion
Participant
0 Kudos
If you remove the position, it just defaults to the last entry on display. Hidden and exclude hide the field from both the display and the configuration, so the field is not available at all. Visible is not a valid annotation.
suzanne_alivand
Explorer
0 Kudos

.

suzanne_alivand
Explorer
0 Kudos

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?