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

Former Member
0 Likes
758

Hi,

Can anyone please tel me any function module to be used for search help???

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
732

Hi,

You can do this by two way:

1. Make a help by using SE11 & attach it to your field like this 'parameters abc like zstudent-name matchcode object id = search help name'

&

2. Use Function module to make help on your field by using this coding.

********************************************************************************

DATA: lc_vbeln LIKE vbrk-vbeln,

ltab_fields LIKE help_value OCCURS 0 WITH HEADER LINE,

BEGIN OF ltab_values OCCURS 0,

feld(40) TYPE c,

END OF ltab_values.

*&----


**& Form HELP_CHECK

*&----


text

*----


FORM help_check.

Set up fields to retrieve data

ltab_fields-tabname = 'VBRK'.

ltab_fields-fieldname = 'VBELN'.

ltab_fields-selectflag = 'X'.

APPEND ltab_fields.

ltab_fields-tabname = 'VBRK'.

ltab_fields-fieldname = 'FKDAT'.

ltab_fields-selectflag = space.

APPEND ltab_fields.

Fill values

SELECT * FROM vbrk WHERE kunag = 'RICO0US'.

ltab_values-feld = vbrk-vbeln.

APPEND ltab_values.

ltab_values-feld = vbrk-fkdat.

APPEND ltab_values.

ENDSELECT.

CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'

EXPORTING

fieldname = 'VBELN'

tabname = 'VBRK'

title_in_values_list = 'Select a value'

IMPORTING

select_value = pr_vbeln

TABLES

fields = ltab_fields

valuetab = ltab_values

EXCEPTIONS

field_not_in_ddic = 01

more_then_one_selectfield = 02

no_selectfield = 03.

ENDFORM. "fiscal_year

************************************************************************

End of Coding

************************************************************************

Make this coding according to your program.

Reward if helpful..

Rishika

7 REPLIES 7
Read only

Former Member
0 Likes
732

Hi,

Try this FM F4IF_INT_TABLE_VALUE_REQUEST

Read only

Former Member
0 Likes
732

Hi,

Try Using this Function Module

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST' EXPORTING

tabname = 'DEMOF4HELP'

fieldname = 'CARRIER1'

dynpprog = progname

dynpnr = dynnum

dynprofield = 'CARRIER'.

Reward if Helpfull,

Naresh.

Read only

Former Member
0 Likes
733

Hi,

You can do this by two way:

1. Make a help by using SE11 & attach it to your field like this 'parameters abc like zstudent-name matchcode object id = search help name'

&

2. Use Function module to make help on your field by using this coding.

********************************************************************************

DATA: lc_vbeln LIKE vbrk-vbeln,

ltab_fields LIKE help_value OCCURS 0 WITH HEADER LINE,

BEGIN OF ltab_values OCCURS 0,

feld(40) TYPE c,

END OF ltab_values.

*&----


**& Form HELP_CHECK

*&----


text

*----


FORM help_check.

Set up fields to retrieve data

ltab_fields-tabname = 'VBRK'.

ltab_fields-fieldname = 'VBELN'.

ltab_fields-selectflag = 'X'.

APPEND ltab_fields.

ltab_fields-tabname = 'VBRK'.

ltab_fields-fieldname = 'FKDAT'.

ltab_fields-selectflag = space.

APPEND ltab_fields.

Fill values

SELECT * FROM vbrk WHERE kunag = 'RICO0US'.

ltab_values-feld = vbrk-vbeln.

APPEND ltab_values.

ltab_values-feld = vbrk-fkdat.

APPEND ltab_values.

ENDSELECT.

CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'

EXPORTING

fieldname = 'VBELN'

tabname = 'VBRK'

title_in_values_list = 'Select a value'

IMPORTING

select_value = pr_vbeln

TABLES

fields = ltab_fields

valuetab = ltab_values

EXCEPTIONS

field_not_in_ddic = 01

more_then_one_selectfield = 02

no_selectfield = 03.

ENDFORM. "fiscal_year

************************************************************************

End of Coding

************************************************************************

Make this coding according to your program.

Reward if helpful..

Rishika

Read only

Former Member
0 Likes
732

Hi,

We can restrict the values in F4 help of one parameter depending upon the values selected in the previous parameter on the selection screen.

For example: In the following selection-screen if you select a particular value for the field ERNAM (created by) then the F4 help for material should show only the material numbers on the particular date, i.e., the value entered in the ERNAM (created by) field.

Here is a sample code-

DATA : it_return1 LIKE ddshretval OCCURS 0 WITH HEADER LINE,

it_return2 LIKE ddshretval OCCURS 0 WITH HEADER LINE.DATA: BEGIN OF it_ernam OCCURS 0,

ernam LIKE mara-ernam,

END OF it_ernam.DATA: BEGIN OF it_matnr OCCURS 0,

matnr LIKE mara-matnr,

END OF it_matnr.PARAMETERS: p_ernam LIKE mara-ernam,

p_matnr LIKE mara-matnr.DATA m LIKE mara-matnr.AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ernam. SELECT ernam FROM mara INTO TABLE it_ernam. CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'P_ERNAM'

value_org = 'S'

TABLES

value_tab = it_ernam

return_tab = it_return1

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3. p_ernam = it_return1-fieldval. SELECT matnr FROM mara INTO TABLE it_matnr WHERE ernam = p_ernam.AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr. CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'P_MATNR'

value_org = 'S'

TABLES

value_tab = it_matnr

return_tab = it_return2

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

Thanks

Plz reward if useful.

Read only

Former Member
0 Likes
732

Hi Kiran,

A search help describes a standard process of an input help for a field. The special semantics of the field could require that some points deviate from this standard. Such a deviation from the standard can also be implemented with a search help exit.

The input help process should look as much the same as possible throughout the entire system. Search help exits should therefore only be used for exceptions.

A search help exit is a function module that has a predefined interface. A search help exit is called at certain times by the help processor. The administrative data of the help processor are passed to the search help exit using the interface.

You can store your own program logic that manipulates this administrative data in the search help exit. Individual steps of the input help process can be skipped with a search help exit.

Each search help exit must have the same interface as function module F4IF_SHLP_EXIT_EXAMPLE (is used as pattern for all the search help exits to be created). You can find more information about the interface in the documentation for this function module.

Reward points...

Thanks & Regards,

Nagesh.

Read only

Former Member
0 Likes
732

Hi

creating elementary search help

Select the object class Search help in the initial screen of the ABAP Dictionary, enter the name of the search help and choose Create.

A dialog box appears in which you must select the type of search help.

Select Elementary search help and choose Continue.

The maintenance screen for elementary search helps appears.

Enter an explanatory text in the field Short text.

You can search for example for the search help using this short text at a later time with the R/3 Repository Information System (with Utilities ® Infosystem).

Select the selection method of the search help.

You can enter the name of a table or a view (database view, projection view or help view) here. If there is a text table for the specified table, its name is automatically entered in the corresponding field.

In exceptions it could be necessary to change the standard process defined by the search help. You can implement the deviation from the standard using a search help exit.

In this case enter the name of the search help exit in the corresponding field.

Choose the dialog type of the search help.

The dialog type defines how the hit list is displayed in the input help.

Define the parameters for the search help.

All the fields of the chosen selection method are offered by the input help for the field Parameter. Choose the parameters you required from this list. The data element of the parameter is automatically copied from the selection method.

Select the Imp flag if it is an import parameter. Select the Exp flag if it is an export parameter.

You can define the dialog for the input help with the fields LPos, SPos and SDis.

Enter the position in the hit list where the parameter should be displayed in LPos. If you enter nothing or the value 0 here, the parameter is not displayed in the hit list.

You can define the position where the parameter should appear in the dialog box for value selection in SPos. If you enter nothing or the value 0 here, the parameter is not displayed in the dialog box for value selection.

If you set the SDis flag, the parameter will become a pure display field in the dialog box.

In the Default value field you can assign the parameter a default value (see Default Values for Search Help Parameters) that takes effect if the parameter is not explicitly defined when it is attached to a field.

If the search help is to be accessed with a short cut, you must define a one-place ID in the Short cut field.

All the elementary search helps contained in a collective search help should have different short cuts.

Save your entries.

A dialog box appears in which you have to assign a development class to the search help.

Activate the search help.

Information on the activation process can be found in the activation log. You can call the activation log with Utilities ® Activation log. If errors occurred during activation, the activation log is automatically displayed.

reward if useful

Read only

Former Member
0 Likes
732

Check this program.

TABLES : MARA.

DATA: BEGIN OF IT_MARA OCCURS 0,

MATNR LIKE MARA-MATNR,

END OF IT_MARA.

DATA : IT_RETURN TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE.

PARAMETERS : P_MATNR LIKE MARA-MATNR.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.

SELECT MATNR FROM MARA UP TO 10 ROWS INTO TABLE IT_MARA.

SORT IT_MARA BY MATNR.

DELETE ADJACENT DUPLICATES FROM IT_MARA COMPARING MATNR.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'MATNR'

DYNPPROG = SY-REPID

DYNPNR = '1000'

DYNPROFIELD = 'P_MATNR'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = IT_MARA

RETURN_TAB = IT_RETURN

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.

Thanks

Reward

Richa