cancel
Showing results for 
Search instead for 
Did you mean: 

getEntitySetMethod -> passing 2 filter values

christoph_nagl
Participant
0 Kudos

Hi experts,

i want to pass to the getEntitySet method of my service 2 filter values

?$filter=PAR1 eq '01'&$filter=PAR2 eq '02'

But how can I access both filters in my service implementation. In the input filter string only the last value is inserted (PAR2 eq '02').

thanks for support.

br,

christoph

Accepted Solutions (0)

Answers (2)

Answers (2)

AshwinDutt
Active Contributor
0 Kudos

Hello Chris,

Please pass as below and check.

?$filter=PAR1 eq '01' and PAR2 eq '02'


Regards,

Ashwin

christoph_nagl
Participant
0 Kudos

Hi,

thanks - it works.

2 questions left:

1) is there a documentation for the parameters?

2) is there a FUBA to change the filter input string to internal table of select options that i can use it in a select statement or is it necessary to parse the string manually?

BR,

Christoph

former_member184867
Active Contributor
0 Kudos

Documentation

/IWBEP/IF_MGW_APPL_SRV_RUNTIME - SAP NetWeaver Gateway - SAP Library

To change to Internal table refer to

lt_filters = io_tech_request_context->get_filter( )->get_filter_select_options( ).

Refer to How to Develop Query Options for an OData Service Using Code-Based Implementation for sample.

AshwinDutt
Active Contributor
0 Kudos

Hello Chris,

1. For filter parameters documentation, you can refer to the one mentioned by Former Member

2. Inputs sent as $filters parameters are already available as part of select options which can be used directly in our select statements. Not necessary that always we need to convert and use as string in the select statements.

Use io_tech_request_context->get_filter( )->get_filter_select_options( ) to get the filter parameters in the format of select options. (data type /iwbep/t_mgw_select_option)

Regards,

Ashwin

christoph_nagl
Participant
0 Kudos

Hi,

one question occured after implementation.

I have oModel which i set to the list item.

listItem.setModel(oModel);

In my xml view i refer to the {/KennzahlSet}. But how can I pass the filter objects now? In the gui i have no chance to do this?

Thanks for support.


BR,
Christoph

former_member184867
Active Contributor
0 Kudos

You are using wrong URL

The correct URL should be ?$filter=PAR1 eq '01' and  PAR2 eq '02'.

Refer to Section 4.5 of http://www.odata.org/documentation/odata-version-2-0/uri-conventions/

There are multiple ways to access the filter values, filter string being the most elementary.

A better option can be

lt_filters = io_tech_request_context->get_filter( )->get_filter_select_options( ).

Refer to for sample.

Message was edited by: Atanu Mallik