on 12-26-2013 4:53 PM
Hi All,
I have two fields in search parameter let field A and B, AS per my client requirement , I want result should search either by A or B but not both.
I want result based on 'OR' in between those two parameters.
So suggest me which one going to help me to achieve this by add_selection_param or GET_SELECTION_PARAMS .
And how i write the code for 'OR' Condition.
Can anyone please tell me how can I achieve it ?
Regards
Alok
Hi Alok,
It is not possible to make an OR conditon at the Screen level, Please do the validation in DO_VALIDATE method ,and throw a message if both are filled.
Thanks.
Rajesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Alok,
If you have two fields A and B as search parameter then use ADD_SELECTION_PARAM like below:--
CALL METHOD LR_QS->ADD_SELECTION_PARAM
EXPORTING
IV_ATTR_NAME = 'fieldA'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'param1'.
and,
CALL METHOD LR_QS->ADD_SELECTION_PARAM
EXPORTING
IV_ATTR_NAME = 'fieldB'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'param2'.
the query will internally take all these parameters as OR... You don't have to specify the OR anywhere.
Please check and let me know.
Thanks,
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Alok,
Is this your customer search component? If so,
then you have to read the selection parameters and before querying the table you to use OR condition to build the "where" clause.
Thanks and Regards,
Ashik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Alok,
Ok, in that case you have to check the implementation class of the search result
Eg: CL_BUPA_IL_HEADER_SEARCH=>IF_CRM_BUPA_IL_QUERY~GET_DYNAMIC_QUERY_RESULT( )
In this method IT_SELECTION_PARAMETERS parameter will contain input search criteria.
You have to debug IF_CRM_BUPA_IL_QUERY~GET_DYNAMIC_QUERY_RESULT( ) and check where exactly the "WHERE" clause of the query is built and see if any BADI is available to change the parameter that is passed to "WHERE" condition.
Hope it helps.
Hi,
I am expecting answer ......
come on... any one!!!!!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alok,
On the Searchpage , if we restrict the screen element with A or B, will that work for you?
Let me explain you in details there will be only 1 Screen element with drop down A & B, so, now end user had to select one of them only.
If this is fine then, I can send you other steps to follow
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.