SAP Knowledge Base Article - Public

3076602 - Get the error "The association _I_XXX cannot be used locally in the view" while publishing CDS View

Symptom

Get the error "The association _I_XXX cannot be used locally in the view" while publishing CDS View

Environment

SAP S/4HANA Cloud

Reproducing the Issue

1. Creat a CDS view in the app Custom CDS View

2. Associate several data source to the primary data source. For example, the primary data source is A. The associated data source are B,C.

3. When define the "ON" condition for data source D, the filed of data source B is used instead of the field of data source A.

4. Publish the CDS viw, there is an error: "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

Resolution

  1. Edit the custom CDS view
  2. Change the right hand side of the join condition  to the field of the primary data source
  3.  If there is no relevant field in the primary data source then create another custom CDS view to join the Data source A and data source B. Then this new data source will have the field.

Keywords

The association, cannot be used locally in the view, Custom CDS View , KBA , BC-SRV-APS-GKE , Generic CDS Key User Editor , Problem

Product

SAP S/4HANA Cloud 2105