cancel
Showing results for 
Search instead for 
Did you mean: 

Criticality in Projection View of RAP BO with draft, best practice?

WRoeckelein
Active Participant
0 Kudos
188

Hi RAP developers,

in our draft enabled RAP BO (for business configuration) we have a Lifecyle State field (DRAFT, RELEASED, DEPRECATED). We want to show Criticality Colors (ie @ui.identification.criticality, @ui.lineitem.criticality), Criticality needs to be 1,3,2 respectivly.

So where to calculate this, ie do

case LifecycleState when 'DEPRECATED' then 2 when 'DRAFT' then 1 else 3 end as LifecycleCriticality

?

In the Projection View I get "Field LIFECYCLECRITICALITY contains a not supported expression".

When I do this in the R View, IMHO I have to do this also in the Query View for the draft, or? This would not so nice, having to write this twice...

Why can't I add such simple calculations which are UI related in the C View (and not have this field in an API I-View)?

Any other suggestions? What is best practice here?

I am aware of https://sapui5.hana.ondemand.com/#/api/sap.ui.comp.smartfield.SmartField%23annotations/IsConfigurati... but IMHO this is not supported in RAP...

Regards,

  Wolfgang

 

View Entire Topic
ClearQueries
Explorer

Hi @WRoeckelein,

As you rightly mentioned, adding CASE statements in projection view is not supported.

If you add it in R view, it will definitely require additional efforts and coding (not a  best practice of course).

As per best practice, you can introduce VIRTUAL FIELD on projection view.

https://help.sap.com/docs/abap-cloud/abap-rap/modeling-virtual-elements

You can define virtual field of type INT1, write your logic in the relevant calculationExit class and map this field with criticality relevant annotation as you mentioned earlier.

This logic will be considered during draft as well as active scenario.

Hope this helps.

Please accept the answer if it resolves your query.

 

Regards,

ClearQueries.com 

Follow on LinkedIn

WRoeckelein
Active Participant
0 Kudos

Hi @ClearQueries ,

while this seems to be a working solution. I wouls not consider this a desirable solution.

First it involved another development artefakt, second it introduces a mixture of programming languages. A lot of effort for such a simple calculation.

And third we have the performance impact. Calculating this in the HANA database together with the other fields will be much perfomanter than seperatly calling an ABAP method and looping over the result table.

And last but not least, I am wondering on the long term future of virtual fields, as virtual fields for filtering are not available in ABAP Cloud.

Regards,

  Wolfgang