Skip to Content

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

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

se16n.png (83.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Feb 20 at 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

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 21 at 10:41 AM
    Add comment
    10|10000 characters needed characters exceeded

  • 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

    Add comment
    10|10000 characters needed characters exceeded