cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple values input parameters for ODATA links

Former Member
0 Kudos

Hello gurus

i have created a Calc view with graphical approach AND JSON links which works perfectly.

i am trying to add input parameters on Plant and want to pass multiple values through Odata link but its not working.

I have created Input parameter Plant and have linked Plant from view using "Column" and made it mandatory.

If i execute the JSON link it still brings all the values

do i need to tie the Input parameter to any calculated column or something to make it work ?

here is the syntax i try to pass in odata link-

InputParams%28PLANT=%27AZ01%27%29/Results?$format=json

Accepted Solutions (1)

Accepted Solutions (1)

SergioG_TX
Active Contributor
0 Kudos

kartik,

yes you need to add the filter into the columns.. when you have a node, click on the filter, then provide  your formula whether it is for one value or multiple.

COLUMN=IN_FILETER  or

in(COLUMN, values_comma_separated)

this would do the filtering on your column and the input values provided.

here is a link how to pass the input values from sql for your test

http://scn.sap.com/thread/3818350

Former Member
0 Kudos

so the only way i can add FILTER is at PROJECTION level only.

i added the filter and expression like below and it works correctly for 1 value.

  1. in("REGION",'$$In_Region$$') or match ("REGION",'*$$In_Region$$*'


question is if i have to pass multiple values or all values what wwould be the syntax in odata link ?


working link---InputParams(PLANT='AZ01')/Results?$format=json


i have tried below and that doesnt work-

InputParams(PLANT2='AZ01','US01')/Results?$format=json

SergioG_TX
Active Contributor
0 Kudos

Kartik,

the values in the input parameter must be comma separated and must have double single quotes in order to work - check out the link I provided. here it is again: http://scn.sap.com/thread/3818350

Former Member
0 Kudos

hi Sergio,

Thanks it works perfectly with the suggestions you mentioned.

here is the syntax that worked for me-

InputParams(PLANT='AZ01'',''AZ05')/Results?$format=json

Former Member
0 Kudos

so what if you have more than 2 values-

i am trying this and it seems to not work -

InputParams(PLANT='US01'',''US02","US03')/Results?$format=json

i was expecting all 3 to display however it only displays the first US01

SergioG_TX
Active Contributor
0 Kudos

you have the correct single quotes.. make sure the filter is applied correctly to the rest of the projections..

Former Member
0 Kudos

Filters expression is as below-

in("PLANT2",'$$PLANT$$') or match ("PLANT2",'*$$PLANT$$*')

it brings all values for US01,US02,US03,US04 if i use syntax - (PLANT='US0*'')/Results?$format=json

if i use -(PLANT='US01'',''US03')/Results?$format=json

it brings both US01 & US03

if i use -(PLANT='US01'',''US02')/Results?$format=json

it brings both US01 & US02

so the only time i try to enter more than 2 values it doesnt work-

InputParams(PLANT='US01'',''US02","US03')/Results?$format=json

SergioG_TX
Active Contributor
0 Kudos

you should use the   in("PLANT2",'$$PLANT$$')  - I don't think the match should be used on this scenario. in my same exercise, I was able to achieve it with the in clause

Former Member
0 Kudos

Hi Sergio,

what version of HANA are you on?

if i remove the  or match ("PLANT2",'*$$PLANT$$*')

i loose the functionality of searching on "*"

i can still search for 2 values but more than 2 values it just doesnt bring data.

also looks like the exercise you have tried in the link above is more on SQL side of HANA Modeller right?

or were u trying in an ODATA link?

SergioG_TX
Active Contributor
0 Kudos

hi Karthik,

I am on 1.102 but I also did this on 1.97 before.

I did try both in SQL, as well as from xsodata

Answers (0)