‎2007 Oct 13 1:58 PM
I WANT TO SEARCH WITH FIRST 3 LETTERS OF A FILED ... I NEED TO GET ALL POSSIBLE VALUES STARTING WITH THOSE 3 LETTERS ..
FOR EXAMPLE TO FIND THE VBELN VALUES ... 100* SHOULD GIVE ALL VALUES STARTING WITH 100 ..
PLS HELP ME...
‎2007 Oct 13 2:16 PM
Hi
If you have a predefined cumulative search help for that field you can search the values like that
for Example Material No will have MAT1 as search help
so when you wants to search for material numbers
if you enter 1000* it will display all those values related/starting with that
number.see the search Help creation
1) Elementary search helps describe a search path. The elementary search help must define where the data of the hit list should be read from (selection method), how the exchange of values between the screen template and selection method is implemented (interface of the search help) and how the online input help should be defined (online behavior of the search help).
2) Collective search helps combine several elementary search helps. A collective search help thus can offer several alternative search paths.
3)An elementary search help defines the standard flow of an input help.
4) A collective search help combines several elementary search helps. The user can thus choose one of several alternative search paths with a collective search help.
5)A collective search help comprises several elementary search helps. It combines all the search paths that are meaningful for a field.
6)Both elementary search helps and other search helps can be included in a collective search help. If other collective search helps are contained in a collective search help, they are expanded to the level of the elementary search helps when the input help is called.
CREATION:
Go to SE11 Tcode
select search help
give the 'z' search help name and create
select the selection method ur table name eg : 'mara'
dialog module 'display value immediately'.
add the field whatever u want and lpos = 1 and spos = 1 and check import and export parameter.
where left position when displaying and spos = search position
and then save and activate ..
See the links:
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee38446011d189700000e8322d00/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee45446011d189700000e8322d00/content.htm
https://forums.sdn.sap.com/click.jspa?searchID=3173469&messageID=2176485
https://forums.sdn.sap.com/click.jspa?searchID=3173469&messageID=3601619
pls go through this for search help creation
http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee2b446011d189700000e8322d00/content.htm
Search Help Exits:
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee52446011d189700000e8322d00/content.htm
http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_exit.htm
https://forums.sdn.sap.com/click.jspa?searchID=4390517&messageID=1712818
Regards
Anji
‎2007 Oct 13 3:57 PM
Hi,
All you need to do is
1) get the value entered by the user into a local variable.
2) get the first three letters using offset.
3) concatenate % after the third letter into a variable (say l_vbeln)
4) now hit the databse and find all the possible value, like this
select * into table lt_vbak from vbak where vbeln like l_vbeln.
5) now you have the table with the data. use the FM F4IF_INT_TABLE_VALUE_REQUEST and show the output.
see some sample code on how to build the FM
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'VBELN'
PVALKEY = ' '
dynpprog = sy-repid
DYNPNR = '0100'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = gt_values
field_tab = lt_fields
return_tab = lt_retval
DYNPFLD_MAPPING = Lt_dynmap
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CLEAR ls_retval.
READ TABLE lt_retval INTO ls_retval INDEX 1.
MOVE ls_retval-fieldval TO p_vbeln.
you can find many example on how to use this FM in the forum
Reward points if usefull
Regards,
Niyaz