cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with PO and HANA xsodata with input parameters

Former Member
0 Kudos

Hi,

We have a HANA view which uses input parameters, and this is exposed as an xsodata service, which also uses input parameters. The URL looks like this. For a single value the following syntax would be used:

http://hana:8000/data/view.xsodata/InputParams(i_var='1')/Results?$format=json

If there are multiple values for the variable, the following syntax is used.

http://hana:8000/data/view.xsodata/InputParams(i_var='1'',''2'',''3'',''4'',''5')/Results?$format=js...

The PO OData adapter works with a single value but fails with multiple values, with the following:

Error org.apache.olingo.odata2.api.edm.EdmSimpleTypeException: The metadata constraints [Nullable=false, DefaultValue=1, MaxLength=8] do not match the literal 1,2,3,4,5.

So PO is complaining that it thinks that the actual variable value is '1,2,3,4,5' rather than 5 separate values. Is this a PO bug, or is HANA breaking the OData format? Or just an integration issue between the two products? I'd sure appreciate any ideas on what to do.

Thanks!

John

Accepted Solutions (0)

Answers (2)

Answers (2)

daniel_ruiz2
Active Contributor
0 Kudos

hi John,

do you have a resource called InputParams? - because it seems rather an odd name for a resource.. also, I don't understand how one field (the key) can either be one value or an array value - wouldn't it be simpler to use a function import and pass your variable as a normal query parameter?

Former Member
0 Kudos

Hi,

As the error saying, 'metadata constraints ' and OData adapter usually downloads the edmx file at runtime.

I guess its problem in the edmx file, that means in the HANA view.


reg, avinash

Former Member
0 Kudos

So if we go to the OData 4.0 specification: http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.html

I can't find any usage like InputParams(i_var='1'',''2'',''3'',''4'',''5') in the spec. My guess is that HANA XS is breaking the OData specification here, which is why PI can't parse it.

It's possible that XS isn't even supposed to allow this and the usage is an undocumented feature, as I can't find reference to it in the documentation.

Looks like the solution would be to use the REST adapter and craft the URL programmatically in PI.

Former Member
0 Kudos

One point would like to add is.

PO OData adapter supports only version V2.

reg, avinash