Application Development 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: 

How to add a field to the Search help

Former Member
0 Kudos

Hi.

I create a Search help 'ZSH_ELE' in SE11.

Selection Method name is KNA1.

Search help Exit Name is ZSEARCHHELP_EXIT

In Search help Paramenters i provide KUNNR and LAND1.

when i press f4 i got the data also.

Now the Problem is when i press F4 i want get the details of KUNNR, LAND1 and also NAME1.

But i do not want add any NAME1 in my search help.

By seeing SDN i write the code in Search help exit like this.

Source Code of the Function Module.

FUNCTION ZSEARCHHELP_EXIT.

*"----


""Local Interface:

*" TABLES

*" SHLP_TAB TYPE SHLP_DESCR_TAB_T

*" RECORD_TAB STRUCTURE SEAHLPRES

*" CHANGING

*" VALUE(SHLP) TYPE SHLP_DESCR_T

*" VALUE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL

*"----


DATA: WA_SHLP TYPE DFIES,

V_NAME1 TYPE KNA1-NAME1,

V_KUNNR TYPE KNA1-KUNNR,

V_VAR(13) TYPE C.

LOOP AT RECORD_TAB.

READ TABLE SHLP-FIELDDESCR INTO WA_SHLP

WITH KEY TABNAME = 'KNA1'

FIELDNAME = 'KUNNR'.

IF SY-SUBRC = 0.

V_VAR = RECORD_TAB-STRING+0(13).

CONDENSE V_VAR NO-GAPS.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = V_VAR

IMPORTING

OUTPUT = V_VAR.

SELECT KUNNR NAME1 FROM KNA1 INTO (V_KUNNR, V_NAME1) WHERE KUNNR = V_VAR+3(10).

IF V_NAME1 IS NOT INITIAL.

CONCATENATE RECORD_TAB-STRING V_NAME1 INTO RECORD_TAB-STRING.

MODIFY RECORD_TAB.

ENDIF.

ENDSELECT.

ENDIF.

ENDLOOP.

ENDFUNCTION.

Based on this i did not get the NAME1 values.

How we can add the field(NAME1) to this Search help.

If it is ok. i will add the field in the Predefine search help also.

Thank u.

Krishna.

3 REPLIES 3

former_member188685
Active Contributor
0 Kudos

if you add that field in the search help and then only it will apear in the search help .

Former Member
0 Kudos

why you do not want to add field in the search help?

add the field 'NAME1' to search help 'ZSH_ELE' and activate it. You will get the details of Name1 along with the other two fields that you have included in search help.

Former Member