2009 May 12 9:23 AM
Hi Experts,
I am creating a database view. I am using this view in my search help(created in se11). Now this view is returning recurring values. I want only the distinct values in my search help. Can anyone please suggest how do I go about it?
Regards,
Abdullah
2009 May 12 9:41 AM
Is it possible that your view isn't constructed properly? For example, when you include a table with language-dependent descriptions and there are multiple languages defined, you might end up with unwanted duplicates.
What are the tables involved in your query, and how have you linked them?
Thomas
2009 May 12 9:36 AM
Hi:
use search help in selection method where you can use distinct to avoid the duplicate records
For details, have a look
[Link|http://help.sap.com/saphelp_nw70/helpdata/en/cf/21ee38446011d189700000e8322d00/content.htm]
Regards
Shashi
2009 May 12 9:42 AM
Dear Shashi,
Can you please elaborate on the same.
The steps I followed are:
1. Create database view.
2. Create search help and in the selection method I specified the view name.
3. Specify the view fields I require in the search help.
The database view is returning duplicate values. So when I click on F4 on the search help, I get the same. How can I suppress the duplicates?
Regards,
Abdullah
2009 May 12 9:41 AM
Is it possible that your view isn't constructed properly? For example, when you include a table with language-dependent descriptions and there are multiple languages defined, you might end up with unwanted duplicates.
What are the tables involved in your query, and how have you linked them?
Thomas
2009 May 12 9:45 AM
Hi Thomas,
My field here is Size/Dimensions (GROES) of Material Master table MARA. In the view selection conditions I have specified, MARA GROES NE ' '
Since size is a non key field of MARA, I am getting duplicates. Which I want to avoid.
Regards,
Abdullah
2009 May 12 9:57 AM
Seems like you cannot do this with a view but must rather program the SELECT DISTINCT statement yourself via a [search help exit|http://help.sap.com/saphelp_nw70/helpdata/en/cf/21ee52446011d189700000e8322d00/frameset.htm].
Thomas
2009 May 12 9:43 AM
Hi,
In the view , Just check if the key fields are joined. If the fields are not keys of the table, then you will get duplicate entries.
2009 May 12 9:49 AM
2009 May 12 9:51 AM
Hi Sarita,
If I was using a select statement, there would have been no issue. I am using it in a search help created using SE11.
Regards,
Abdullah
2009 May 12 9:56 AM
Hi,
Use this statement
DELETE ADJACENT DUPLICATES FROM TBL_HELP COMPARING -
.
And pass the TBL_HELP thru this FM.
CALL FUNCTION 'F4UT_PARAMETER_RESULTS_PUT'
Regards,
Suneel G
2009 May 12 9:59 AM
Hi Suneel,
We are in the tyre industry and size will be used on the interface of most MM/SD related Z reports. Creating a search help will be better than coding here. More over if its a select-options, I will have to give the routine twice for field-low and field-high.
Regards,
Abdullah
2009 May 12 9:58 AM
Hi,
Please check that you have importing parameter for the search help parameters, this will allow you to restrict values. Also check that you have key fields as part of the search help parameter list as importing as well as exporting parameter.
You can also use search help exit by using the interface same as that of function module F4IF_SHLP_EXIT_EXAMPLE and check the values in the table RECORD_TAB[] to remove duplicate entries.
Regards,
George
2009 May 12 11:09 AM
Hi George,
I am using
select-options: s_groes for mara-groes matchcode object zgroes modif id chr.
If i opt for coding I will have use something similar to the code below.,
at selection-screen on value-request for s_groes-low.
perform f_f4_groes.
at selection-screen on value-request for s_groes-high.
perform f_f4_groes.
I will explore the search help exit.
Regards,
Abdullah
Edited by: Abdullah Ismail on May 12, 2009 3:41 PM
2009 May 12 11:17 AM
Hi Abdullah Ismail ,
Use Search help exit to delete the duplicate records.
For information about this refer the below link:
http://www.sapdev.co.uk/dictionary/shelp/shelp_exit.htm
Thanks,
Sudha
2009 May 12 11:39 AM
Hi,
Thanks a lot everybody. I used the search help exit and it solved the problem.
Regards,
Abdullah.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |