cancel
Showing results for 
Search instead for 
Did you mean: 

OData query input

Former Member
0 Kudos

Hi

Does OData accept an array as a query input? I have only seen single fields as filter options and vaguely remember reading that table inputs are not suported.

In a lot of our BAPIs, we have range tables for input/table parameters.How do we handle them?

- How do we pass them when calling OData services, using OR?

- How should we build the gateway service( data mapping/ method ) to handle these range tables as inputs.

If I select the table type in the service builder data model creation step, it creates a new entity type for the table parameter.

For example, the service needs to return the Store details for a list of stores, instead of calling the service per store, I should be able to pass the stores all in one go.

My RFC has a range of type WERKS_T_RANGE, the service data model needs to have StoreNo as the parameter. How should multiple store no.s be passed in the service?

Thanks

Arthi

Accepted Solutions (1)

Accepted Solutions (1)

former_member184867
Active Contributor
0 Kudos

Hi Arthi,

You can use the following URL pattern to pass multiple values for the same field using OR .

http://<HOST>:<PORT>/MYSERVICE/MyCollection?$filter=FIELD1 eq 'AAAAA' or FIELD1 eq 'BBBB'

You will get the values in form of select option in parameter it_filter_select_options in the Data Provider (or Data Provider Ext) class.

Regards,

Atanu

Former Member
0 Kudos

Thanks Atanu.

I can use the select-option in the data provider method if I'm coding the whole data retrieval processing.

If I'm using an RFC that already has a range table for store no. then how do I map it in the service builder?

Former Member
0 Kudos

Hi

I'm able to do it by adding a new property for the field in 'Map to Data Source' step and mapping the range table to it. The filtering gets handled in the data provider method automatically based on it_fitler_select_options.

Thanks!

Arthi

Answers (0)