Calculated field &1 is not allowed.

Message type: E = Error

Message class: SADL_GW_DT_CDS - Messages CDS Checks

Message number: 002

Message text: Calculated field &1 is not allowed.



What causes this issue?

In the CDS view (consumption view), a calculated field is defined:
e.g.: so.NetAmount + so.TaxAmount as GrossAmount
A field can only be calculated using a calculation exit.


System Response

The system issues an error message and will not allow you to continue with this transaction until the error is resolved.



How to fix this error?

Create an ABAP class (CL_xxx_EXIT) which implements the interface
IF_SADL_EXIT_CALC_ELEMENT_READ where the field is calculated.
Add the annotations to the field in the CDS view (consumption view):
@ObjectModel: { virtualElement : true<(>,<)>
virtualElementCalculatedBy: 'ABAP:CL_xxx_EXIT'
}
cast( 0 as MYAMOUNT ) as GrossAmount<(>,<)>


Procedure for System Administrators

Contact the corresponding developer of the CDS view to correct the
error.

Error message extract from SAP system. Copyright SAP SE.