$(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

HANA XSA use parameter in xsodata to pass to calculation view. URL format?

Hi,

I'm using SAP HANA XS Advanced. I created a calculation view with a mandatory input parameter called "ID".

In the Filter Expressions tab from the calculation view I used the parameter like so:

"ID"=$$ID$$

My xsodata service looks like this:

service {
	"MyApp.Database::employeebyid" as "employeeById" 
	keys generate local "localID"
	parameters via entity "InputParams";
}

Now I wanted to try the service using the browser. Without Parameter it all works fine when using this URL:

https://myhanainstance:51036/employeeById.xsodata/employeeById?$format=json

But how do I get my parameters into that? For XS Classic I found this:

http://myserver:80xx/path/to/myService.xsodata/myViewParameters(KUNNR='12345')

So I tried:

https://myhanainstance:51036/employeeById.xsodata/employeeByIdInputParams(ID=1)?$format=json

But it just says:

"Resource not found for the segment 'employeeByIdInputParams' at position 0."

What I expected because it is called employeeById and not employeeByIdInputParams but it seemed to work here. Or did I get that wrong?

I think that overall my service is working and I only have a wrong request URL because without Parameters I get the output:

column store error: search table error:  [34023] Instantiation of calculation model failed;exception 306106: Undefined variable: $$ID$$. Variable is marked as required but not set in the query\n

Hope someone knows which URL I have to use. Seems to be a marginal problem but I can't solve it using Google or the Dev Guide.

Kind regards,

Philipp

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 08, 2017 at 01:46 PM

    Hello Philipp,

    for XSA it is working the same way than for XSC.

    As you have defined "InputParams" as entity name for the Input Parameters you have to address that entity in your service. You also have to add the navigation property "Results" (default name as you have not defined another one) to get the results.

    So the URL should look like following:

    .../employeeById.xsodata/InputParams(ID=1)/Results?$format=json

    "$format=json" is added, cause XSA does not support Atom.

    Regards,
    Florian

    Add comment
    10|10000 characters needed characters exceeded