2013 Dec 11 12:03 PM
Hi,
I am using elementary search help in selection screen of my report like below code
SELECT-OPTIONS: s1 FOR kna1-kunnr MATCHCODE OBJECT zz_sh1.
when press F4 getting 10 entries from search help zz_sh1, but i want to display only 5 values based on some condition. is there any way to do without changing search help zz_sh1.
Thanks,
2013 Dec 11 12:26 PM
Hi Subramanyam,
What how is your custom search help built up? and what is your filter crriteria in selection screen..
Otherwise, remove match code object extension and display search help with le F4IF_INT_TABLE_VALUE_REQUEST afte revent AT SELECTION SCREEN ON VALUE REQUEST FOR S1.
USe same logic as in custom search help and get data in internal table and then filter it as per your requirement .
Thanks,
Chirdip
Hi,
I am using elementary search help in selection screen of my report like below code
SELECT-OPTIONS: s1 FOR kna1-kunnr MATCHCODE OBJECT zz_sh1.
when press F4 getting 10 entries from search help zz_sh1, but i want to display only 5 values based on some condition. is there any way to do without changing search help zz_sh1.
Thanks,
2013 Dec 11 12:15 PM
Hi,
If you press the highlighted button, you can filter in search help:
Regards,
2013 Dec 11 12:26 PM
Hi Subramanyam,
What how is your custom search help built up? and what is your filter crriteria in selection screen..
Otherwise, remove match code object extension and display search help with le F4IF_INT_TABLE_VALUE_REQUEST afte revent AT SELECTION SCREEN ON VALUE REQUEST FOR S1.
USe same logic as in custom search help and get data in internal table and then filter it as per your requirement .
Thanks,
Chirdip
2013 Dec 11 12:56 PM
Hi Chirdip,
my search help has been build using with standard selection method which i cant change. they have used help view in selection method of search help.
So i am calling abap report where this search help has been used as matchcode in selection screen . but this report is using in different areas. it should work as early for other places and it will be filtered only in my place where am calling report. I have the filtering condition in my code.
please let me know if you are not cleared.
Thanks
2013 Dec 11 1:06 PM
You can filter stuff using search help exit for the same. Please search scn
2013 Dec 11 1:35 PM
Hi madan,
if i use search help exit it will all the places where matchcode used. another one how to pass my condition to search help exit from my report???
Thanks,
2013 Dec 11 2:04 PM
Hi Subrahmanyam,
I guess you can also put your condition in search help exit specific to your t code using check sy-tcode = 'XYZ'. and then filter it with your logic.
Otherwise, as suggested earlier build your code in at selection screen on value request for ..
and get data from table which is used in selection method into internal table.
filter this internal table using your logic and display it with F4IF_INT_TABLE...
Thanks,
Chirdip
2013 Dec 11 2:09 PM
Hi Subrahmanyam -
It seems you have created a custom search help. You can use search help exit to reduce the entries based on your condition. You can go through the documentaion for Function module F4IF_SHLP_EXIT_EXAMPLE.
Let us know, if it helps.
Regards,
Atul Mohanty
2013 Dec 11 2:21 PM
We can do either of the following.
(1) Do select query and fill the f4 table based on standard tables and manipulate the data in the At selection screen on value request for field event
OR
(2) Copy a standard search help and write the search help exit for manipulating data before the display.(You can copy the standard search help to custom if you are planning on reusing the same)
Simply put,either we need to write search help exit for zz_sh1 or go with a custom F4 table at the selection screen event.There is no hassle in copying zz_sh1 to zz_sh2 and writing a help exit for zz_sh2 if you want to keep the zz_sh1 intact for using in another program,right.....It is upto the developer to decide.
2013 Dec 11 5:29 PM
Hi Byju,
let me explain about my requirement,
I have to change the selection screen field F4 values (i.e 5 values) for Z1 report. they already using zz_sh1 search help in selection screen to get F4 values (i.e 10 values). But the same report Z1 is using in another scenario where it have to display all F4 values (10).
If i use your both ways selection screen field F4 values will effect in another places also. am i right?
I have the condition value when F4 values will be filtered in Z1 report. but how to pass this condition value to search help exit?
Thanks,
2013 Dec 12 4:23 AM
I will lay the options on the table once again based on the update
(1)If we create a search help then it can show only one match code on the screen at a time,right.So simply put,creating more than 1 search help will not satisfy the requirement based on the scenario unless you want to create 2 selection screen objects and toggle thier display based on the scenario.
(2)If we still need to proceed with search help exit with a zz_sh1, since the same report calls it on different scenario within the same program,use a EXPORT memory to set some value flag in memory in scenario from program and IMPORT the same one in the search help exit so that now you can have the scenario of the program also identified.BAsed on this you can control the data being displayed.I have not tried it with a search help,so please check it out.
(3) creating an F4 table and using it in the selection screen for the event.
I assume from your explanation that the scenario is determined at the begining.Now based on the scenario the F4 table can be filled.The calling of the F4 can still be done at the selection screen event.
I believe you will prefer option 2.For the syntax of EXPORT/IMPORT pls check SDN threads....
Hope it clarifies...
2013 Dec 11 3:22 PM
You can filter the results of the search help without using FM F4IF_INT_TABLE_VALUE_REQUEST, check my answer in threads like Use Elementary Search help of collective search help or Default value in search help parameter (The field used to filter must be available in search help selection of course)
Regards,
Raymond
2013 Dec 12 8:48 AM
Hi
This can be achieved using search help exit. When you create a search help in se11 you have an option to add a search help exit. What you can do is follow the steps given below.
1. Go to se37 and type F4IF_SHLP_EXIT_EXAMPLE and copy the program to a different source so that we can alter the contents.
2. Open the copied program and find the code ' IF CALLCONTROL-STEP = 'DISP''. (line no 84 in the program). Within this if condition you have to write the code to alter the contents of your search help.
3. All the contents appearing in your search help is stored in a table called record_tab. Now for example if you want to delete all the duplicated entries from you search help then you can write.
Sort record_tab.
Delete adjacent duplicates from record_tab.
You can give any conditions based on your requirement.
4. Save the program and copy the name of the program.
5.Open se11 and create search help for your field.
6. In the search help exit field paste the copied program name.
So every time when you press you f4 help the function module that you have mentioned in the search help exit will be tigerred and your code written with the IF CALLCONTROL-STEP = 'DISP'' will be activated thus filtering the records in the search help according to the users wish.
With regards
Suneesh