2018 Feb 18 3:45 PM
How to cast calculation field in ABAP-CDS to a data element?
2018 Feb 20 11:04 PM
Hi
That's not possible at the moment, maybe SAP will use an annotation (eg @EndUserText.label) also in all backend tools...
@EndUserText.label: 'A Sum'
cast( 100 * 22 as abap.dec(11,2) ) as total,
You can already use the annotations in you custom code, if needed - tables DDHEADANNO and DDFIELDANNO or class CL_DD_DDL_ANNOTATION_SERVICE (not available with 740!)
And it's also recommended not to use the generated DDL SQL View.
regards
Domi
2018 Feb 18 8:00 PM
Hi.
Instead of abap.dec(11,2), did you tried with data element name.
What is the version you are using? It looks from release ABAP 750, the data element can be specified in CAST Expression, please check here
Regards
Rajkumar Narasimman
2018 Feb 20 6:17 AM
I tried to use data element without success.
I'm using ABAP 740 SP08.
2018 Feb 20 11:04 PM
Hi
That's not possible at the moment, maybe SAP will use an annotation (eg @EndUserText.label) also in all backend tools...
@EndUserText.label: 'A Sum'
cast( 100 * 22 as abap.dec(11,2) ) as total,
You can already use the annotations in you custom code, if needed - tables DDHEADANNO and DDFIELDANNO or class CL_DD_DDL_ANNOTATION_SERVICE (not available with 740!)
And it's also recommended not to use the generated DDL SQL View.
regards
Domi
2018 Feb 21 8:02 AM
I tried the annotation "@EndUserText.label" and it doesnt affect the description of the field =\
2018 Feb 21 8:06 AM
Hi
Yes, it's not yet implemented in backend now! - SAP use them eg. in CDS based GW services, but not in DDIC/DDIC related tools...
kr
Domi
2018 Feb 21 9:57 AM
Hi,
can you be more specific about "CDS based GW services"?
2018 Feb 21 10:41 AM
2021 Sep 18 11:17 PM