2023 Feb 24 4:01 PM
Hi over there.
I've created, via Eclipse ADT, a CDS extension view for the standard CDS C_SALESORDERITEMFS. I've put two associations; I've used individual fields in the selection list from one of those associations, and I've added the second association directly in the selection list. As below:
Well then, the C_SALESORDERITEMFS standard CDS View is exposed as an EntitySet of the standard OData service SD_F1814_SO_FS_SRV. And while the individual fields from _ZV01 association that I've added are visible in each individual record from C_SALESORDERITEMFS EntitySet...
...the _zv01Tabla association is not, and is neither on the Metadata of the OData (in the first screenshot the new association should appear after the to_TransactionCurrency one):
However, if I run the C_SALESORDERITEMFS View in Eclipse and use the Follow Association Command, I can see the original standard association as well as the new one added by me:
Why is this happening? Is it possible to expose/use the association as itself in the standard CDS OData?
2023 Feb 28 11:25 AM
Hi,
I had the same question before.
I could solve the issue by exposing the association target (in your case zv01) in the Service Definition. OData will only expose the association in its metadata, if the target is also exposed. Otherwise, the target cannot be accessed and thus the association would be useless. Consequently, the association is not shown in OData.
In your case, zv01 seems to be a table, but tables cannot be exposed in Service Definitions. So you would need to introduce a Data Definition as a layer between the database table and the Service Definition. Additionally, it seems you are working with an SAP Service Definition. Consequently, you would need to extend the service:
Alternatively, if you just want to expose one simple field (without exposing an entity), try to include the field explicitly.
In your case
_zv01.posnr as YourAliasForThisField
This should directly include the field via OData with no need to modify (extend) the Service Definition.
All in all, it depends on your requirement. If you really need to full association for navigation in OData, you will need to include the target in the Service Definition. Otherwise, you may try to include individual fields directly.
I hope I could help you with this suggestion.
Best,
Nikolas
2023 Jul 26 1:58 PM
Hi Nikolas, what would you suggest when we are not in Service Definition case, but in old SEGW world? How one can extend standard oData service with association target? Appreciate any hints.
2023 Jul 26 2:10 PM
Hi Pavel,
sorry, I do not know an answer for your question regarding the SEGW use case. Maybe you can post your question as an independent question to reach more experts.
Best, Nikolas
2024 Jan 03 4:13 PM
nikolas.dimitriadis / pavel.veremenyuk - Have you found any solution for SEGW case?
2024 Jan 09 8:53 AM
2 weeks ago - last edited 2 weeks ago
Hi Nikolas,
Can you explain how you have exposed association targets in the OData service. I have a similar case where I extended a Standard CDS view to add new Virtual column that is calculated in frontend. But here I need to implement filteration for that field.
To implement filter I followed the way described in below blog but I am getting that association not defined error.