cancel
Showing results for 
Search instead for 
Did you mean: 

Filter Option using Tcode - SEGW

Former Member
0 Kudos
274

Hi All,

I am new to Odata services.. I am trying to create filter for object, while it fetch data using method - GET_ENTITYSET (Query). any how I am not able to do so..

I have selected the filter option at entity and entity_set.. but its not working..

I am passing filter parameters but in get_entityset method not getting data in table -  IT_FILTER_SELECT_OPTIONS and IV_FILTER_STRING are coming blank..

Please advice how I can achieve it..

Regards,

Accepted Solutions (0)

Answers (1)

Answers (1)

kammaje_cis
Active Contributor
0 Kudos

Can you share your URI? May the problem is in that,

Former Member
0 Kudos

Hi Krishna,

I am using get_entityset method to get filters.. In some of the article I read we need to do bit of coding to get the filter passed on URL..

DATA: lt_filters         TYPE                   /iwbep/t_mgw_select_option,

*-get filter

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

I was able to read filter vales in program.. but in metadata whole entity is coming as filterable.. even though I have selected only couple of fields..

Any suggestions what I am missing..

Thanks...

former_member184867
Active Contributor
0 Kudos

Hi Rajesh,

by default all the properties are filterable ... if you  need to set a property as non filterable you need to explicitly do that..

Regards,

Atanu

kammaje_cis
Active Contributor
0 Kudos

As Atanu mentioned all properties are filterable by default. You can explicitly disable them using the corresponding API.

The fact that you marked as filterable or not- filterable has no bearing on the functionality. That is, if you mark a property as not- filterable, but pass the filter for that property in URI, and you have code to handle it, it will work. Metadata is only an indication for consuming clients, but does not validate/stop you.

Thanks

Krishna

Former Member
0 Kudos

Thanks, I am using following code to read the filter parameter values:

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

I am sure, it was working earlier but now in program LT_FILTER is not getting any value..

kammaje_cis
Active Contributor
0 Kudos

that says problem is with your URI.

Thanks

Krishna

Former Member
0 Kudos

Thanks I checked the URL and its working fine ..