SAP Knowledge Base Article - Public

3076602 - Error "The association _I_XXX cannot be used locally in the view (SDDL_PARSER_MSG/061)" occurs, while publishing Custom CDS View - SAP S/4HANA Cloud

Symptom

Error "The association _I_XXX cannot be used locally in the view (SDDL_PARSER_MSG/061)" occurs, while publishing Custom CDS View.

Environment

SAP S/4HANA Cloud

Reproducing the Issue

[CASE 1]

  1. Create a CDS view in the Custom CDS View app.
  2. Associate several data source to the primary data source. For example, the primary data source is A and the associated data source are B, C.
  3. When define the "ON" condition for data source D, the field of data source B is used instead of the field of data source A.
  4. Publish the Custom CDS View.
  5. Error message is triggered: "The association _I_XXX cannot be used locally in the view".

[CASE 2]

  1. Create a CDS view in the Custom CDS View app.
  2. Associate another data source to the primary data source. For example, the primary data source is A and the associated data source are B.
  3. When define the "ON" condition for data source B, you are using a path expression as in A.Field is alias of A._Association.Field.
  4. Expose any field from custom CDS view B.
  5. Publish the Custom CDS View.
  6. Error message is triggered: "The association _I_XXX cannot be used locally in the view".

Cause

When performing the association, the field of the primary data source should be used in the right-hand side of the join condition.

However, path expressions from the primary data source are not allowed in ON condition.

Resolution

[CASE 1]

  1. Edit the Custom CDS view.
  2. Change the right-hand side of the join condition to the field of the primary data source.

[CASE 2]

  1. Edit the Custom CDS view A.
  2. Expose the field from the association of the primary data source, A._Association.Field as Field1.
  3. Publish custom CDS view A.
  4. Create a new custom CDS view B and make A as primary data source.
  5. Add the association to the data sources to C and use A.Field1 in the ON condition.
  6. Expose field C.Field.

Keywords

The association cannot be used locally in the view, Custom CDS View, join condition, locally defined association, the ON condition of the association is applied directly to the join ON condition, the join ON condition may contain invalid clauses, clauses of this type cannot be used in ON conditions of joins, Message no. SDDL_PARSER_MSG061, SDDL_PARSER_MSG/061 , KBA , BC-SRV-APS-GKE , Generic CDS Key User Editor , Problem

Product

SAP S/4HANA Cloud Public Edition all versions ; SAP S/4HANA Cloud all versions