cancel
Showing results for 
Search instead for 
Did you mean: 

Virtual Element calculated field as selection field in RAP

former_member721373
Participant

Hi Everyone,

Is it possible to make the virtual element calculated field available as a Selection Field in UI as well?

The UI.SELECTIONFIELD doesn’t work on virtual element field.

Can anyone help me know if it’s possible and how?

Regards,

Ehtram

View Entire Topic
Marian_Zeis
Active Contributor

Have a look in the documentation:

https://help.sap.com/docs/ABAP_PLATFORM_NEW/fc4c71aa50014fd1b43721701471913d/df0ef4aac2d34fdd948b8a8...

define view entity CDSProjView
  as projection on CDSEntity
{
  key      elem_1          as Element1,

           [@EndUserText.label: 'Element Label']
           [@EndUserText.quickInfo: 'Quick Information']@ObjectModel.virtualElementCalculatedBy: 'ABAP:ABAPClass'
           @ObjectModel.filter.transformedBy: 'ABAP:ABAPClass'
           @ObjectModel.sort.transformedBy: 'ABAP:ABAPClass'
  virtual  ElemName : {DataElement | ABAPType } ,
...
}
former_member721373
Participant
0 Kudos

Hi marianzeis

I am actually looking to use virtual element fields selection fields whereas in the example provided in documentation, we apply filter on the cds view field. After checking similar questions on the forum, I guess it’s not yet possible to use transient field as a selection field. Let me know if i am wrong 😀

Marian_Zeis
Active Contributor
0 Kudos

Hi eihtu ,

thats strange because i was using this approach just this week.
It´s a little bit different use case, but i was using this blog and was using it as selection field:

https://blogs.sap.com/2020/01/16/filtering-on-association-property-in-fiori-element-app-via-abap-cds...

Föß
Active Participant
0 Kudos

Hi,

I wanted to use it in a 2021 system, somehow doesn't seem to work. (Dumps, Exceptions) - Then I checked the documentation again (for 2021), and there is no longer any mention of filter and sort.

Are your sure that it works in a S/4 2021 as well?

Regards, Johann