‎2009 Apr 15 2:37 PM
Hi,
Is it possible to have my custom code in selection method for a search help.
The idea is to put values needed for search help in one internal table and the result to be based on it.
Regards,
Stefan
‎2009 Apr 15 2:42 PM
Hi Stefan,
You could explore the concept of the Search Help Exit where you can change the search help data using ABAP code.
help.sap.com and F1 on the field within the search help from SE11 gives a lot of information.
Cheers,
Aditya
‎2009 Apr 15 2:49 PM
search the forum on search help exit and you can find many post of mine.
‎2009 Apr 15 3:04 PM
Hi,
Go through the following links to w.r.t serch help exits
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee52446011d189700000e8322d00/content.htm
http://help.sap.com/saphelp_40b/helpdata/en/cf/21ee52446011d189700000e8322d00/content.htm
http://www.sapdev.co.uk/dictionary/shelp/shelp_exit.htm.
by
Prasad GVK.
‎2009 Apr 15 3:36 PM
use the following FM for custom search help.
create your internal table for search help and pass to this function module.
F4IF_INT_TABLE_VALUE_REQUESTRegards,
Lalit Mohan Gupta.
‎2009 Apr 15 3:41 PM
hi Stefan,
see the below exapmle for F4 help..
F4 Help - Calling it from a program and limiting values
To avoid the standard F4 help to be show, insert the event PROCESS ON-VALUE-REQUEST in the program and add a field
statement for the field that should trigger the F4 help. In the mdoule called from PROCESS ON-VALUE-REQUEST, call function module
F4IF_FIELD_VALUE_REQUEST.
Example 1 - Dynpro
process before output.
.....
process after input.
.....
PROCESS ON VALUE-REQUEST.
FIELD it_zsd00003-prctr MODULE f4_help_for_pctr.
MODULE f4_help_for_pctr INPUT.
* NOTE:
* Tabname/fieldname is the name of the table and field
* for which F4 should be shown.
*
* Dynprog/Dynpnr/Dynprofield are the names of the Progran/Dynpro/Field
* in which the f4 value should be returned.
*
* Value: The value of the Dynpro fuield when calling the F4 help.
* You can limit the values shown, by inseting a value in this parameter
* e.g '50*' to show only values beginning with 50
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'ZSD00003'
fieldname = 'PRCTR'
* SEARCHHELP = ' '
* SHLPPARAM = ' '
dynpprog = 'ZSD00002_BRUGERKONV_LISTE'
dynpnr = '0100'
dynprofield = 'IT_ZSD00003-PRCTR'
* STEPL = 0
value = '50*'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* SUPPRESS_RECORDLIST = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* TABLES
* RETURN_TAB =
* EXCEPTIONS
* FIELD_NOT_FOUND = 1
* NO_HELP_FOR_FIELD = 2
* INCONSISTENT_HELP = 3
* NO_VALUES_FOUND = 4
* OTHERS = 5
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " F4_help_for_pctr INPUT
Example 2 - Report
To control F4 help in a selection screen use the
AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field>
event.
Note that for ranges both the low and high value of the field
must have there own ON VALUE-REQUEST
Example:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prctr-low.
PERFORM f4_help_prctr.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prctr-high.
PERFORM f4_help_prctr.
REPORT f4help.
PARAMETERS:
p_auart LIKE vbak-auart.
START-OF-SELECTION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_auart.
PERFORM f4_help_aaurt.
*---------------------------------------------------------------------*
* FORM f4_help_auart *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM f4_help_auart.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'VBAK'
fieldname = 'AUART'
* SEARCHHELP = ' '
* SHLPPARAM = ' '
* DYNPPROG = ' '
* DYNPNR = ' '
* DYNPROFIELD = ' '
* STEPL = 0
* VALUE = ' '
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* SUPPRESS_RECORDLIST = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* TABLES
* RETURN_TAB =
* EXCEPTIONS
* FIELD_NOT_FOUND = 1
* NO_HELP_FOR_FIELD = 2
* INCONSISTENT_HELP = 3
* NO_VALUES_FOUND = 4
* OTHERS = 5
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
Regards,
Prabhudas
‎2009 Apr 15 3:42 PM
Hi,
AT-SELECTION SCREEN ON VALUE-REQUEST
FOR it_zsd00003-prctr .
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'ZSD00003'
fieldname = 'PRCTR'
dynpprog = 'ZSD00002_BRUGERKONV_LISTE'
dynpnr = '0100'
dynprofield = 'IT_ZSD00003-PRCTR'
value = '50*'
.
IF sy-subrc <> 0.
ENDIF.
Regards
Krishna
‎2009 Apr 17 8:40 AM
Thanks everybody !
The idea is like this. I would like when we search for a material to have search help with material number, description, stock in plant1, stock in plant2, stock in plant3. I have internal table with needed data, but I don't know how to use it in FM F4IF_INT_TABLE_VALUE_REQUEST.
Please advise !
Stefan
‎2009 Apr 17 8:47 AM
Thanks everybody !
The idea is like this. I would like when we search for a material to have search help with material number, description, stock in plant1,
stock in plant2,
stock in plant3.
I have internal table with needed data,
but I don't know how to use it in FM F4IF_INT_TABLE_VALUE_REQUEST.
Please advise !
Stefan
‎2009 Apr 24 12:34 PM