on 2025 Mar 03 12:31 PM
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
Request clarification before answering.
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,
Follow on LinkedIn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
90 | |
11 | |
9 | |
8 | |
7 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.