'Show output values aka conversion-exit values in CDS?
I've created a CDS view, which reads some data from 2 tables.
My problem is, that one of the columns has a conversion policy behind - so if I display the data with SE16n, it shows the "converted value" but within my cds view only the unconverted value is shown.
Is there an option to show converted values in CDS views?
Solution 1:[1]
Use Virtual Elements
they can be used to calculate fields that are not available in CDS.
Steps
- Add a placeholder field:
cast( '' as abap.char(255)) AS after_conversion - Add Annotation
@ObjectModel.virtualElement: trueto your field - Add Annotation
@ObjectModel.virtualElementCalculatedBy: 'ABAP:<z_class>' - Create the Class
Z_CLASS - Use interface
if_sadl_exit_calc_element_read - In Method
calculateyou can do the conversion
Solution 2:[2]
No actually conversion exits are not supported in CDS. But with string conversions you can rebuild the conversion exits.
-> see Documentation
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | AndrĂ¡s |
| Solution 2 | noah |
