Do you have any question about this error?
Message type: E = Error
Message class: CFD_REGISTRY_CHECK - Custom Fields: Messages for Registry Check
Message number: 120
Message text: On clause of Association &1 in CDS View &2 contains cast statement
In the on condition of the association you use $projections fields which
have a CAST. This is currently not possible as such associations cannot
be used in view extensions and will lead to syntax errors (General CDS
restriction).
The system issues an error message and will not allow you to continue with this transaction until the error is resolved.
Instead of using $projections fields which have a CAST you have to use
the fields from the underlying data source.
Error message extract from SAP system. Copyright SAP SE.
CFD_REGISTRY_CHECK120
- On clause of Association &1 in CDS View &2 contains cast statement ?The SAP error message CFD_REGISTRY_CHECK120 indicates that there is an issue with the use of a cast statement in the ON clause of an association within a Core Data Services (CDS) view. This error typically arises when the CDS view is trying to establish a relationship between two entities, but the ON clause includes a cast that is not allowed.
Cause:
The primary cause of this error is the presence of a cast statement in the ON clause of an association. In CDS views, the ON clause is used to define the join condition between two entities. However, using a cast in this context can lead to ambiguity and is not supported by the CDS framework.
Solution:
To resolve this error, you should remove the cast statement from the ON clause of the association. Instead, ensure that the fields being compared in the ON clause are of the same data type. Here are the steps you can take:
Identify the Association: Locate the association in your CDS view that is causing the error. The error message will provide the names of the association (
&1
) and the CDS view (&2
).Review the ON Clause: Examine the ON clause of the identified association. Look for any cast statements (e.g.,
CAST(...)
).Remove the Cast: If you find a cast statement, remove it and ensure that the fields being compared are compatible in terms of data type. If necessary, adjust the data types of the fields in the underlying tables or views to ensure they match.
Test the CDS View: After making the changes, activate the CDS view and check if the error persists. If the error is resolved, you should be able to use the association without issues.
Related Information:
By following these steps, you should be able to resolve the CFD_REGISTRY_CHECK120 error and successfully define your CDS view associations.
Get instant SAP help. Start your 7-day free trial now.
CFD_REGISTRY_CHECK119
Condition Alias differs for active and draft entity of Bus.Ctxt &1
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
CFD_REGISTRY_CHECK118
Datasource Alias &1 for union case was not found in CDS View &2
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
CFD_REGISTRY_CHECK121
On clause of Association &1 in CDS View &2 contains not only elements
What causes this issue? In the on condition of the association you use $projections fields which are calculated. This is currently not possible as su...
CFD_REGISTRY_CHECK122
On clause of Association &1 in CDS View &2 has not only 'equal' operator
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
Click on this link to search all SAP messages.