2007 Jul 16 12:55 PM
Dear Friends,
Is it possible to export Search Help values to Internal table?
On screen, when user click on Search button, the SAP standard search help will call (Customer Search). After entering values, some result get displayed and this result need to export to the internal table.
Thanks in stack
Nilesh
Dear Friends,
Is it possible to export Search Help values to Internal table?
On screen, when user click on Search button, the SAP standard search help will call (Customer Search). After entering values, some result get displayed and this result need to export to the internal table.
Thanks in stack
Nilesh
2007 Jul 16 12:58 PM
You can try to find the table from where the search help is picking the values and populate that in the internal table..
2007 Jul 16 1:25 PM
I can select from SAP standard table, but then what is use for giving search help to the user. On the screen user entered some search criteria and depending upon that the search help will display result. This result need to append in the internal table.
Regards
Nilesh
2008 Jul 10 12:35 AM
Hey Nilesh,
Any luck with this requirement? I am faced with the same situation and I do not want unecessarily query all the related tables when I have a search help already defined for the same.
Please do let me know if you were able to find a function module which takes in the Search Help name , the input parameter value and returns an internal table of the exporting parameters as a result.
Thanks and Best Regards,
Puja.
2008 Jul 10 3:38 AM
Hi:
try this:
DATA : wa_shlp TYPE shlp_descr,
it_records LIKE ddshretval OCCURS 0 WITH HEADER LINE.
wa_shlp-SHLPNAME = 'MAT0M'. "one of elementary search help name from mara-matnr.
wa_shlp-SHLPTYPE = 'SH'.
CALL FUNCTION 'F4IF_SELECT_VALUES'
EXPORTING
shlp = wa_shlp
MAXROWS = 0
SORT = ' '
CALL_SHLP_EXIT = ' '
IMPORTING
MAXROWS_EXCEEDED =
TABLES
RECORD_TAB =
RECDESCR_TAB =
return_tab = it_records
.
LOOP AT it_records.
WRITE:/ it_records.
ENDLOOP.
Follows is how to get the search help name:
CALL FUNCTION 'DD_SHLP_GET_HELPMETHOD'
EXPORTING
tabname = 'MARA'
fieldname = 'MATNR'
langu = sy-langu
NO_CHKTAB_MAPPING =
GET_ENTITYTAB = ' '
CHANGING
shlp = wa_shlp
callcontrol = callcontrol
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
OTHERS = 3
.
*
CALL FUNCTION 'F4IF_EXPAND_SEARCHHELP'
EXPORTING
shlp_top = wa_shlp
IMPORTING
shlp_tab = shlps.
好运,
启明星
2008 Jul 10 11:31 PM
Hey Qi,
That was exactly what I was looking for. I wish to award you points, however this thread has not been initiated by me. Hence I am unable to do so here...
I have opened another thread, please post your answer there. I shall assign you the necessary points.
You could search for the new post under the Search Term "Programatically capture Search Help" in this same forum.
Thanks a lot for your inputs.
Best Regards,
Puja
2008 Jul 11 5:50 AM
hi ,
I didnt get ur question right , but there is a way to pass values to a internal table from a search help.
in process on value request, either you can specify the searchhelp name and search help parameter in exporting fields ( SEARCHHELP ,SHLPPARAM ) or you can specify the table and field name from which u want to pick value. here is the sample FM for this,
DATA : it_t TYPE TABLE OF ddshretval .
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'ZVBAK_102015' < specify the table name from which u want to pick values >
fieldname = 'ZKUNAG' < field for which u want value>
SEARCHHELP = ' '
SHLPPARAM = ' '
dynpprog = sy-cprog
dynpnr = '0100' < return screen number>
dynprofield = 'ITAB-ZKUNAG' < internal table field on which u want to dump the selected value>
TABLES
return_tab = it_t.
2008 Jul 11 5:58 AM
2011 May 30 11:01 AM