70

CDS View Error Association Cannot Be Used Locally

 1 year ago
source link: https://answers.sap.com/questions/390248/cds-view-error-association-cannot-be-used-locally.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Search Questions and Answers
Dec 25, 2017 at 06:50 AM

CDS View Error Association Cannot Be Used Locally

18195 Views Last edit Dec 25, 2017 at 07:00 AM 3 rev
99991-cds-error.jpg

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

Attachments

cds-error.jpg (319.1 kB)
3 Answers
Sort by:

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.

Dec 27, 2017 at 10:04 AM

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,

Aug 31, 2022 at 02:53 PM

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

2 comments
11 minutes ago

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

Know someone who can answer? Share a link to this

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that your answer complies with our Rules of Engagement.

You must be Logged in to submit an answer.

Please provide a distinct answer and use the comment option for clarifying purposes.
10 characters required.

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK