2006 Jun 01 10:18 AM
Does anyone know if it is possible to make an ad_hoc_query with some OR restrictions instead of AND?
With an ad_hoc_query all parameters used are followed by and, I mean, the results should fullfills ALL the restrictions imposed.
For example, I need to do an ad_hoc_query in which the first surname fullfills the restriction "PEREZ" OR "GUTIERREZ". How can I do it?
Thanks in advanced.
2006 Jun 07 3:13 PM
If i understood your question, instead of parameters if you have select-options in your ad_hoc_query, you can specify in your single Value options "PEREZ" OR "GUTIERREZ" and it should bring either "PEREZ" or
"GUTIERREZ" right !
If i understood your question, instead of parameters if you have select-options in your ad_hoc_query, you can specify in your single Value options "PEREZ" OR "GUTIERREZ" and it should bring either "PEREZ" or
"GUTIERREZ" right !
2006 Jun 07 3:13 PM
If i understood your question, instead of parameters if you have select-options in your ad_hoc_query, you can specify in your single Value options "PEREZ" OR "GUTIERREZ" and it should bring either "PEREZ" or
"GUTIERREZ" right !
2006 Jun 15 10:59 AM
I mean different fields. Perhaps I have'n found the rigth words to explain the problem. If I want to make an ad-hoc-query in which the results were the number of pernrs available in which the first surname was 'PEREZ' OR the second surname was 'GUTIERREZ' how can I do it?
Thanks for your answer.
2006 Jun 15 11:07 AM
query with a where condition. say first and second surnames go in fields s1 and s2.
<query> where s1 CS 'REZ' or s2 CS 'REZ'. Because both names that you gave me both have 'REZ' common. you might want to modify that and query. CS means contains string.
Regards,
Vijay
2006 Jun 15 11:11 AM
Hello Maria,
If u want to make a query on the fly then u can use select stmt with where clause supplied with internal table which is popluated.
select * from mara
where (t_itab).
The content of t_tab is built in the program. If u want to generically search u can use OR or u can use LIKE with %.
2006 Jun 15 11:47 AM
You mean with programming but if I use an standard sap transaction which is S_PH0_48000513 which corresponds to Ad_hoc_query how can I do the OR with different fields if the transaction shows me one select option for each input field chosen and is joining the options in both fields with a supposed AND?. The results make me think there is an AND.
Example ; I chose first surname in the query and the second. The system propose me two select options in which I introduce for surname_1 (first select option) 'PEREZ' and for surname (second select option) 'GUTIERREZ'. I want the Personal numbers whose surname_1 were 'PEREZ' OR surname_2 were 'GUTIERREZ'.
2006 Jun 15 3:48 PM
If you can change the infoset, there is provision Under Extras button to add custom code.
the custom code can look something like this.
CHECK parameter1 = 'PEREZ' or parameter2 = 'GUTIERREZ'.
2006 Jun 16 7:26 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |