cancel
Showing results for 
Search instead for 
Did you mean: 

CDS View Error Association Cannot Be Used Locally

former_member217691
Participant
0 Kudos

Hello Friends

While using CDS view

I am getting error

Association cannot be used locally within the view

Please find attached image of my CDS view and help me resolve the error.

Any ides how to resolve the error.

Regards,
Sunil

Accepted Solutions (0)

Answers (3)

Answers (3)

Sean_Zhang
Product and Topic Expert
Product and Topic Expert

Hi Sunil,

Association can't be used where it's defined, it's not the association purpose.

you have two options:

1, you have a higher level CDS for the current one, then you could use the association freely.

or 2, you switch the association to leftouter join.

Best Regards,

Sean

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

???

glauco
Active Contributor
0 Kudos

this works for me. thank you.

Hello Sunil,

Looks like the issue is because of the usage of $projection.For details, please see Horst Keller's comment from April 19,2017 in response to the comment by Ceyhun Alp here

Best,

Aashrith.

vishalkumar007
Discoverer
0 Kudos

Did you find a solution to this ? The Association can be exposed but the direct fields can't be used ?

0 Kudos

Keept the association to vbap as it is in the current view and remove the _vbep.wmeng as Orderqty in the current view and use it in the higher level CDS view that is where the current view is the source view, then it won't throw the error.

Thanks

LNV

0 Kudos

There will be a problem that on using the _vbep.wmeng as Orderqty defining in the higher level view that if the higher level view is a Query view because the definition is not recognised by the ODP and will throw the error "Cannot Resolve name in the ODP" , so in such case create one more new higher level view view2 to the current view view1 and use the association to vbep in that view2 and define the field from vbep. use that view2 as the source view to query view instead of the view1..

Thanks

LNV