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

Function Module for search help Exit

Former Member
0 Likes
4,800

How to create a function Module for search help exits?

please explain in details with step by step process.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,223

Hi,

How to create a function Module for search help exits?

function module for search help F4IF_SHLP_EXIT_EXAMPLE

dynamic search help use 'F4IF_INT_TABLE_VALUE_REQUEST'

please check out the link below it will help you

A repository object maintained in the ABAP Dictionary. It supplies input fields on Dynpros with single- or multi-column input helps. Search helps can be linked in the Dictionary with components from structures, data elements, and check tables. A search help enables you to search for entry values with assigned data, without you having to know the exact spelling of the value.

http://help.sap.com/saphelp_46c/helpdata/EN/cf/21ee52446011d189700000e8322d00/content.htm

-


please explain in details with step by step process.

create a search help exit:

1. create an fm with this 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

put this logic in it:

  • Delete duplicate filter logic.

  • This logic only needs to apply at the 'DISP' event - which is just

  • before the hit list is displayed

if callcontrol-step = 'DISP'.

delete adjacent duplicates from record_tab.

endif.

2. edit your search help in se11 and enter the name of the above search help exit fm

-


check this sample code..for dynamic search help

REPORT ZTEST_F4HELP .

*---Report with selection screen and to display the list of

  • possible entries for field 'B' as per the value in field 'A'.

parameters: p_vbeln type vbak-vbeln,

p_posnr type vbap-posnr.

at selection-screen on value-request for p_posnr.

data: begin of help_item occurs 0,

posnr type vbap-posnr,

matnr type vbap-matnr,

arktx type vbap-arktx,

end of help_item.

data: dynfields type table of dynpread with header line.

dynfields-fieldname = 'P_VBELN'.

append dynfields.

call function 'DYNP_VALUES_READ'

exporting

dyname = sy-cprog

dynumb = sy-dynnr

translate_to_upper = 'X'

tables

dynpfields = dynfields

exceptions

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

invalid_parameter = 7

undefind_error = 8

double_conversion = 9

stepl_not_found = 10

others = 11.

read table dynfields with key fieldname = 'P_VBELN'.

p_vbeln = dynfields-fieldvalue.

call function 'CONVERSION_EXIT_ALPHA_INPUT'

exporting

input = p_vbeln

importing

output = p_vbeln.

select posnr matnr arktx into table help_item

from vbap

where vbeln = p_vbeln.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'POSNR'

dynprofield = 'P_POSNR'

dynpprog = sy-cprog

dynpnr = sy-dynnr

value_org = 'S'

tables

value_tab = help_item.

-


also check this link it will help you

/message/3854825#3854825 [original link is broken]

*********please reward points if the information is helpful to you*************

4 REPLIES 4
Read only

Former Member
0 Likes
2,224

Hi,

How to create a function Module for search help exits?

function module for search help F4IF_SHLP_EXIT_EXAMPLE

dynamic search help use 'F4IF_INT_TABLE_VALUE_REQUEST'

please check out the link below it will help you

A repository object maintained in the ABAP Dictionary. It supplies input fields on Dynpros with single- or multi-column input helps. Search helps can be linked in the Dictionary with components from structures, data elements, and check tables. A search help enables you to search for entry values with assigned data, without you having to know the exact spelling of the value.

http://help.sap.com/saphelp_46c/helpdata/EN/cf/21ee52446011d189700000e8322d00/content.htm

-


please explain in details with step by step process.

create a search help exit:

1. create an fm with this 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

put this logic in it:

  • Delete duplicate filter logic.

  • This logic only needs to apply at the 'DISP' event - which is just

  • before the hit list is displayed

if callcontrol-step = 'DISP'.

delete adjacent duplicates from record_tab.

endif.

2. edit your search help in se11 and enter the name of the above search help exit fm

-


check this sample code..for dynamic search help

REPORT ZTEST_F4HELP .

*---Report with selection screen and to display the list of

  • possible entries for field 'B' as per the value in field 'A'.

parameters: p_vbeln type vbak-vbeln,

p_posnr type vbap-posnr.

at selection-screen on value-request for p_posnr.

data: begin of help_item occurs 0,

posnr type vbap-posnr,

matnr type vbap-matnr,

arktx type vbap-arktx,

end of help_item.

data: dynfields type table of dynpread with header line.

dynfields-fieldname = 'P_VBELN'.

append dynfields.

call function 'DYNP_VALUES_READ'

exporting

dyname = sy-cprog

dynumb = sy-dynnr

translate_to_upper = 'X'

tables

dynpfields = dynfields

exceptions

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

invalid_parameter = 7

undefind_error = 8

double_conversion = 9

stepl_not_found = 10

others = 11.

read table dynfields with key fieldname = 'P_VBELN'.

p_vbeln = dynfields-fieldvalue.

call function 'CONVERSION_EXIT_ALPHA_INPUT'

exporting

input = p_vbeln

importing

output = p_vbeln.

select posnr matnr arktx into table help_item

from vbap

where vbeln = p_vbeln.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'POSNR'

dynprofield = 'P_POSNR'

dynpprog = sy-cprog

dynpnr = sy-dynnr

value_org = 'S'

tables

value_tab = help_item.

-


also check this link it will help you

/message/3854825#3854825 [original link is broken]

*********please reward points if the information is helpful to you*************

Read only

0 Likes
2,223

CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET'

EXPORTING

parameter = 'KUNNR'

  • OFF_RESULT = 0

  • LEN_RESULT = 0

  • FIELDNAME = ' '

  • IMPORTING

  • VALUE =

tables

shlp_tab = shlp_tab

record_tab = record_tab

  • SELOPT_TAB =

  • RESULTS_TAB =

changing

shlp = shlp

callcontrol = callcontrol

EXCEPTIONS

PARAMETER_UNKNOWN = 1

  • OTHERS = 2

I Need to pass two fields.. and based on those i have to perform select query.. how do i pass two fields? i have kunnr and another field to be passed./

Read only

Former Member
0 Likes
2,223

Hi

check this links

Search Help Exits:

<b>Reward points for useful Answers</b>

Regards

Anji