How To Fix CFD_REGISTRY_CHECK121 - On clause of Association &1 in CDS View &2 contains not only elements


SAP Error Message - Details

  • Message type: E = Error

  • Message class: CFD_REGISTRY_CHECK - Custom Fields: Messages for Registry Check

  • Message number: 121

  • Message text: On clause of Association &1 in CDS View &2 contains not only elements

  • Show details Hide details
  • What causes this issue?

    In the on condition of the association you use $projections fields which
    are calculated. 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 are calculated 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_CHECK121 - On clause of Association &1 in CDS View &2 contains not only elements ?

    The SAP error message CFD_REGISTRY_CHECK121 indicates that there is an issue with the definition of an association in a Core Data Services (CDS) view. Specifically, the error message states that the "On clause of Association &1 in CDS View &2 contains not only elements." This typically means that the ON clause of the association is incorrectly defined, possibly including non-element expressions or conditions that are not valid for an association.

    Cause:

    1. Incorrect ON Clause: The ON clause of the association may include conditions that are not based solely on the fields of the associated entities. For example, it might include calculations, functions, or other non-element expressions.
    2. Syntax Errors: There may be syntax errors or misconfigurations in the CDS view definition that lead to this error.
    3. Incompatible Data Types: The fields used in the ON clause may have incompatible data types or may not match the expected types for the association.

    Solution:

    1. Review the ON Clause: Check the ON clause of the association in the CDS view definition. Ensure that it only contains valid field references (elements) from the associated entities. Remove any non-element expressions or conditions.

      Example of a correct ON clause:

      association [0..1] to AnotherEntity as _AnotherEntity
      on $projection.Field1 = _AnotherEntity.Field2
    2. Use Only Element References: Ensure that all references in the ON clause are to fields (elements) of the entities involved in the association. Avoid using calculations, functions, or other expressions.

    3. Check Data Types: Verify that the data types of the fields being compared in the ON clause are compatible. If necessary, perform type conversions to ensure compatibility.

    4. Syntax Validation: Use the ABAP Development Tools (ADT) in Eclipse or the SAP GUI to validate the syntax of your CDS view. This can help identify other potential issues.

    5. Documentation and Examples: Refer to the official SAP documentation for CDS views and associations to ensure that you are following best practices and guidelines.

    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, associations are used to define relationships between different entities. They are similar to foreign key relationships in traditional database design.
    • SAP Notes and Community: Check SAP Notes or the SAP Community for any known issues or additional guidance related to this error message.

    By following these steps, you should be able to resolve the CFD_REGISTRY_CHECK121 error and correctly 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