Quantcast
Channel: SCN : Popular Discussions - SAP NetWeaver Gateway Developer Center
Viewing all articles
Browse latest Browse all 1657

Parse filter string

$
0
0

Hi guys,

 

What is the recommended way to manually parse the odata filter string?

 

I want to be able to use 'and' operator, for example: ..AbcCollection?$filter=Param1 eq '60002273' and Param1 eq '60002274'

 

Code attach below...

 

since 'and' is not supported by default, lt_filter_select_options will be empty, and lv_filter_str will have the value of  '( ( PARAM1 = '50002273' ) and ( PARAM1 = '50002274' ) )'

 

So is there any standard util class that i can use to parse it easily ? NOTE: my gateway is on a different instance so I do not have class '/iwcor/cl_odata_expr_utils'

 

 

*  process filter

     lr_filter = io_tech_request_context->get_filter( ).

     lt_filter_select_options = lr_filter->get_filter_select_options( ).

     lv_filter_str = lr_filter->get_filter_string( ).

 

     IF  lv_filter_str IS NOT INITIAL AND lt_filter_select_options IS INITIAL.

 

       me->/iwbep/if_sb_dpc_comm_services~log_message(

         EXPORTING

           iv_msg_type   = 'E'

           iv_msg_id     = '/IWBEP/MC_SB_DPC_ADM'

           iv_msg_number = 025 ).


Viewing all articles
Browse latest Browse all 1657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>