cancel
Showing results for 
Search instead for 
Did you mean: 

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

philipp_thiele
Explorer
0 Kudos

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

former_member289890
Participant
0 Kudos

Hi Philipp,

How to define input parameters with default value calculation view input parameter ?

Thanks,

Tanveer

former_member289890
Participant
0 Kudos

Hi Philipp,

Were you able to use this parameterized xsodata in Fiori elements ? Can you please help with some direction ?

Thanks,

Tanveer

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

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

philipp_thiele
Explorer
0 Kudos

Thank you! I didnt try it with /Results at the end.

Answers (0)