How To Fix CFD_REGISTRY_CHECK120 - On clause of Association &1 in CDS View &2 contains cast statement


SAP Error Message - Details

  • 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

  • Show details Hide details
  • What causes this issue?

    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).

    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?

    Instead of using $projections fields which have a CAST you have to use
    the fields from the underlying data source.

    Procedure for System Administrators


    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message 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:

    1. 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).

    2. Review the ON Clause: Examine the ON clause of the identified association. Look for any cast statements (e.g., CAST(...)).

    3. 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.

    4. 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:

    • CDS Views: Core Data Services (CDS) is a framework for defining semantically rich data models in SAP. It allows for the creation of views that can be consumed by various applications.
    • Associations: In CDS views, associations define relationships between different entities. They are similar to foreign key relationships in traditional database design.
    • Data Types: Ensure that the data types of the fields used in the ON clause are compatible. You can refer to the data dictionary or the underlying table definitions to verify data types.

    By following these steps, you should be able to resolve the CFD_REGISTRY_CHECK120 error and successfully define your CDS view associations.

    • Do you have any question about this error?


      Upgrade now to chat with this error.


Instant HelpGet instant SAP help. Start your 7-day free trial now.


Related SAP Error Messages

Click the links below to see the following related messages:

Click on this link to search all SAP messages.


Rating
ERPlingo simplifies finding the accurate answers to SAP message errors. I now use every week. A must have tool for anyone working with SAP! Highly recommended!
Rate 1
Kent Bettisworth
Executive SAP Consultant