2005 Jun 21 12:50 PM
Hi all,
I want to create a search-help that returns not a single field value form the database, but a combination (concatenation) of three fields from the selected line of the database table/view.
The importing values of the search-help would be the three fields, the exporting value would be the concatenation of those three fields.
Is that possible?
Thank you,
Bogdan
2005 Jun 21 1:42 PM
Hi Bogdan,
I have not tried the solution completely but I think that it should not be a problem.
Create a search help exit on the lines of the example provided in Fn. module 'F4IF_SHLP_EXIT_EXAMPLE' and specify it in the search help. This exit should return a variable(in your case the concatenated field) which would be used as the parameter exported from the search help.
In the Fn. module(search help exit) be sure to specify changing fields: 'SHLP' and 'CALLCONTROL' and tables: 'SHLP_TAB' and 'RECORD_TAB' in the fn. mod. interface.
Hope this helps.
Sanjay
2005 Jun 21 1:29 PM
Hi,
I am not sure whether you are talking about F4 help.I hope you will select values from database based on condition.place it under at selection-screen while appending.
Here is the sample code.
tables kna1.
data:
begin of t_values occurs 2,
value like kna1-begru,
end of t_values,
t_return like ddshretval occurs 0 with header line.
select-options s_begru for kna1-begru.
at selection-screen on value-request for s_begru-low.
*Instead of the below code place your select statement
t_values = 'PAR*'.
append t_values.
t_values = 'UGG'.
append t_values.
*
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BEGRU'
value_org = 'S'
tables
value_tab = t_values
return_tab = t_return
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc = 0.
read table t_return index 1.
endif.
2005 Jun 21 1:41 PM
No Jayanthi.
I need to attach a search-help to a data element in a database structure that, instead of returning the value of a single field in the selected line of the hit-list, would return a combination of three fields from that line.
But I think I've got the solution, I will create a search-help exit for the search-help that I will attach to the structure field.
Bogdan
2005 Jun 21 1:42 PM
Hi Bogdan,
I have not tried the solution completely but I think that it should not be a problem.
Create a search help exit on the lines of the example provided in Fn. module 'F4IF_SHLP_EXIT_EXAMPLE' and specify it in the search help. This exit should return a variable(in your case the concatenated field) which would be used as the parameter exported from the search help.
In the Fn. module(search help exit) be sure to specify changing fields: 'SHLP' and 'CALLCONTROL' and tables: 'SHLP_TAB' and 'RECORD_TAB' in the fn. mod. interface.
Hope this helps.
Sanjay
2005 Jun 21 2:08 PM
Yes, Sanjay.
That's precisely what I was trying to do.
I will let you know of the result.
Thank you,
Bogdan
2005 Jun 21 3:07 PM
Hi Bogdan,
have a look at search help SFLIGHT and its exit SAPBC_GLOBAL_F4_SFLIGHT. In this example a very similar problem is solved. In this example it is the problem, how to get a search help parameter that is the difference of two database fields. In your case you need a search help parameter that is the concatenation of three database fields. It should be easy to adapt the example to your case.
Greetings Stephan
2005 Jul 01 11:06 AM
Hi all.
I wanted to come back just to say she problem is solved using the search-help exit approach.
Another question: the importing parameters from search-help's definition do not receive the value from the application context. What could cause this problem?
Thank you,
Bogdan
2005 Jul 27 3:58 AM
Hi all,
On the topic of search help exits, I need to restrict the values returned in the 'DISP' time of a collective search help for MAT1. The restriction needs to be authorisations - based on plant. The auth check is to check on WERKS values for materials returned in the search help, so that users may not see materials from a plant that they are not authorised to see. I have been attempting to execute the authorisation check in the DISP time, extracting the material number from t he string returned for the record_tab records. Unfortunately, being a collective serach help - the member search helps return the strings in different orders, so identifying the material number from the string is not easy.
Can anyone suggest a different way of executing this?
TIA