on 09-22-2016 7:34 AM
Hi, in our UI5 apps with ODATA Services we have complicated search strings with or. We know we have to handle them in our code and will not get select options. But the variable iv_filter_string has not the format I expected. Sample with Service CB_GL_ACCOUNT_DP Request in gateway client /sap/opu/odata/sap/CB_GL_ACCOUNT_SRV/GLAccounts?$filter=substringof('11',GLAccountName) or substringof('11',GLAccount) Breakpoint in Method at the first statement METHOD /iwbep/if_mgw_appl_srv_runtime~get_entityset. Value of variable iv_filter_string, when You run the url ( ( substringof ( '11' , GLAccountName ) or ( substringof ( '11' , GLAccount ) ) First there are more brackets than given in the url. Second the brackets are wrong. The expression will not work. There are solutions with deleting all brackets, but I don't want to parse the string. I only want to replace for instance substring() with like. Has anyone else this problem? Thanks for Your help. Greetings Kerstin
Hello Kerstin,
Try to call io_tech_request_context( )->get_filter( )->get_filter_string( ) method.
You can also obtain complete range with use of method io_tech_request_context( )->get_filter( )->get_filter_select_options( ) for select or etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, the format of my message changes completely:
Hi,
in our UI5 apps with ODATA Services we have complicated search strings with or.
We know we have to handle them in our code and will not get select options. But the variable iv_filter_string has not the format I expected.
Sample with Service CB_GL_ACCOUNT_DP
Request in gateway client
/sap/opu/odata/sap/CB_GL_ACCOUNT_SRV/GLAccounts?$filter=substringof('11',GLAccountName) or substringof('11',GLAccount)
Breakpoint in Method at the first statement
METHOD /iwbep/if_mgw_appl_srv_runtime~get_entityset.
Value of variable iv_filter_string, when You run the url
( ( substringof ( '11' , GLAccountName ) or ( substringof ( '11' , GLAccount ) )
First there are more brackets than given in the url. Second the brackets are wrong. The expression will not work.
There are solutions with deleting all brackets, but I don't want to parse the string.
I only want to replace for instance substring() with like.
Has anyone else this problem?
Thanks for Your help.
Greetings Kerstin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Kerstin,
Based on the URL shared, according to me, you have to send the filters with AND operator considering you are performing pattern search based on 2 different parameters GLAccountName & GLAccount
Check as below ->
/sap/opu/odata/sap/CB_GL_ACCOUNT_SRV/GLAccounts?$filter=substringof('11',GLAccountName) and substringof('11',GLAccount)
You will receive all the information inside it_filter_select_options
Regards,
Ashwin
Hi Ashwin,
thanks a lot for Your answer.
We don't want to use AND. Actually we need OR.
We want to search different fields with one search string and combine it with or.
So I need the variable iv_filter_string with the same string I put to the option $filter.
But this varable is wrong with to much brackets that doesn't match.
Greetings
Kerstin
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.