$(function () { pageContext.i18n.modTalk = 'moderation talk'; pageContext.i18n.replyToComment = 'Reply'; pageContext.i18n.modTalkEmpty = 'moderation talk is empty'; pageContext.url.getModTalk = "/comments/%25ID%25/listModTalk.json"; pageContext.url.possibleCommentRecipients = "/comments/%ID%/possibleRecipients.json"; pageContext.url.commentEdit = '/comments/%25ID%25/edit.html'; pageContext.url.commentView = '/comments/%ID%/view.html'; pageContext.i18n.commentVisibility = { 'full': 'Viewable by all users', 'op': 'Viewable by the original poster', 'mod': 'Viewable by moderators', 'opAndMod': 'Viewable by moderators and the original poster', 'other': 'Advanced visibility', 'dialogTitle': 'Comment visibility', 'selectGroups': 'Visible to groups', 'selectOther': 'Other recipients', 'selectOriginalPoster': 'Original poster', 'selectModerators': 'Moderators', 'selectAssignees': 'Asked to answer users' }; pageContext.i18n.commentMenuLabels = { 'comment-edit': 'comments.menu.edit', 'comment-delete': 'comments.menu.delete', 'comment-convert': 'comments.menu.convert' };pageContext.i18n.answer= { bestAnswer: 'Best Answer', controlBar : { accept: 'Accept', unaccept: 'Unaccept', acceptCommand: 'Accept this answer as correct', cancelAcceptedCommand: 'Remove this answers accepted status' } }; window.croles = { u: false, op: false, m: false, og: false, as: false, ag: false, dc: false, doc: false, eo: false, ea: false }; tools.init({ q: { e: false, ew: false, eo: false, r: false, ro: false, d: false, dow: false, fv: false, c: false, co: false, p: false, tm: false , ms: false, mos: false }, n: { f: false, vf: false, vfo: false, vr: false, vro: false, c: false, co: false, vu: false, vd: false, w: false, wo: false, l: false }, c: { e: false, eo: false, d: false, dow: false, ta: false, tao: false, l: false }, a: { e: false, ew: false, eo: false, d: false, dow: false, a: false, aoq: false, ao: false, tc: false, tco: false, p: false, tm: false }, pc: croles }, { tc: true, nsc: true }); commandUtils.initializeLabels(); }); Skip to Content
0

OData association between a table and a calculation view with parameters

Jun 06, 2017 at 05:29 AM

158

avatar image
G B

Hello community

Association between a table and a calculation view with parameters

Sample scenario -

service{

"XSTestProject::order_text" as "order_text" // Database table

navigates ("NAV" as "nav");

"XSTestProject.models::order_items" as "order_items" // Calculation View

Key (“ORDER_ID”)

parameters via key and entity "IP";

association via parameters "NAV"

principal "order_text"("langu","country","ORDER_ID") multiplicity "1"

dependent "order_items"("langu","country","ORDER_ID") multiplicity "*";

}

How do I construct the URL for this scenario? The parameters from calculation view should be passed on to the keys in the order_text table.

order_text table - order_id(key), order_desc, langu(key), country(key)

10 |10000 characters needed characters left characters exceeded

Please can you add more details about what error you get and the exact names of the columns you wanna pass to the parameters of the calc. view. Please also add the exact names of the parameters of the calc. view.

0
G B
Florian Pfeffer

Hello Florian

The calculation view has parameters - langu and country. When I send the values to these parameters using the ODATAservice url, these values should be passed on to the keys langu and country of order_text table.

I am currently not getting any error while activating the odata service definition. However, I am not sure about constructing the odata url for the same. Is this scenario possible? If not, kindly share your ideas on a possible solution.

0

I do not understand why you say, that the values should be passed on to the key fields of the order_text table, because you defined your service that a navigation is done from the table to the view. So values can be passed to parameter of the calc. view but not the other way around.

0
G B
Florian Pfeffer

Hi Florian

Thanks for the insight into this. Could you please let me know how to construct the odata url for this navigation along with the parameters to be passed.

0

With the current definition of the service you cannot construct an URL to reach that what you have described (you navigate from the text table to the items, but you need it the other way around if I understood your requirement correct).

1
G B
Florian Pfeffer

Hi Florian

My text table needs to be filtered for a specific language and it provides the master data required in my master - detail page.

The calculation view 'items' gives the content for the detail page and I am calling another text table inside my calculation view which also needs to be filtered for a specific language.

That is the reason behind the navigation from text table to the calculation view with params. Please provide me any suggestions for achieving this scenario.

Also can you please confirm if I can construct an OData URL for 'Navigating to entities via parameters' ,because there is a clause in the developer guide that says -This navigation property cannot be used in combination with the OData query options $expand, $filter and $orderby

0
G B
Florian Pfeffer

Hi Florian

I understand that in order to pass the parameters to the view, I need to navigate from view with parameters to a table.

But can you please provide me a usecase where the section 'Navigation to Entities via parameters' can be used. In the example mentioned for the above section in the developer guide, navigation is created from a table to an entity with parameters.

1) How can I construct the Odata url for the above? (navigation created from a table to an entity with parameters)

https://host.hana.ondemand.com/com/test.xsodata/Table?$expand=Ref&$format=json -> says "Syntax error in $expand system query option at position '12': navigation property 'Ref' cannot be expanded."

2) If I can't use a expand query option and I cannot pass the parameters to the calculation view, in what usecases can this scenario be used?

Kindly help me

0
Show more comments
* Please Login or Register to Answer, Follow or Comment.

0 Answers