Skip to Content
1

How to cast calculation field in ABAP-CDS to a data element?

Feb 18 at 03:45 PM

187

avatar image

How to cast calculation field in ABAP-CDS to a data element?

se16n.png (83.5 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Domi Bigl Feb 20 at 11:04 PM
1

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

Show 3 Share
10 |10000 characters needed characters left characters exceeded

I tried the annotation "@EndUserText.label" and it doesnt affect the description of the field =\

0

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

1

Hi,

can you be more specific about "CDS based GW services"?

0
Horst Keller
Feb 21 at 10:41 AM
1
Share
10 |10000 characters needed characters left characters exceeded
Rajkumar Narasimman Feb 18 at 08:00 PM
-1

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

I tried to use data element without success.

I'm using ABAP 740 SP08.

0