Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Search Help values to Internal table

Former Member
0 Likes
4,329

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

8 REPLIES 8
Read only

Former Member
0 Likes
1,709

You can try to find the table from where the search help is picking the values and populate that in the internal table..

Read only

0 Likes
1,709

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

Read only

Former Member
0 Likes
1,709

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.

Read only

Former Member
1,709

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.

好运,

启明星

Read only

0 Likes
1,709

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

Read only

Former Member
0 Likes
1,709

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.

Read only

Former Member
0 Likes
1,709

Hello Nilesh,

Check this thread :

Same exact functionality is answered.

Thanks,

Greetson

Read only

Former Member
0 Likes
1,709

This message was moderated.