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

regarding search help exit

Former Member
0 Likes
1,492

Hi for all,

Can you tell me how search help will be used in our program? Please give example. What is the useful of search help exit ? . Please give one example.

thanks&regards

venkat

Hi for all,

Can you tell me how search help will be used in our program? Please give example. What is the useful of search help exit ? . Please give one example.

thanks&regards

venkat

4 REPLIES 4
Read only

Former Member
0 Likes
802
Read only

Former Member
0 Likes
802

hi,

The ABAP Dictionary object search help is used to describe an input help. The definition of a search help contains the information the system needs to satisfy the described requirements.

The interface of the search help controls the data transfer from the input template to the F4 help and back. The interface defines the context data to be used and the data to be returned to the input template when a value is selected.

The internal behavior of the search help describes the F4 process itself. This includes the selection method with which the values to be displayed should be determined as well as the dialog behavior describing the interaction with the user.

As with a function module, search helps distinguish between the interface with which it exchanges data with other software components and the internal behavior (for function modules, the latter is defined by the source text).

It only makes sense to define a search help if there is a mechanism available with which the search help

can be accessed from a screen. This mechanism is called the search help attachment and will be described later.

Like the editor for function modules, the editor for search helps also enables you to test an object. You can thus test the behavior of a search help without assigning it to a screen field.

The possible values displayed for a field by the input help are determined at runtime by a selection from

the database. When a search help is defined, you must define the database object from which the data

should be selected by specifying a table or a view as the selection method.

The possible values are presented in the dialog box for displaying the hit list and the user can select

values from here. If the possible values are formal keys, further information should also be displayed.

If the hit list is very large, the user should be able to define further restrictions for the attributes of the

entry. Restricting the set of data in this way both increases the clarity of the list and reduces the system

load. Additional conditions can be entered in a further dialog window, the dialog box for restricting

values.

The dialog type of a search help defines whether the dialog box for restricting values should be

displayed before determining the hit list.

You must define the characteristics to appear on either (or both) of the dialog boxes as parameters in

the search help. You can use all the fields of the selection method (with the exception of the client field)

and the non-key fields of your text table as parameters.

You define which parameter should appear in which dialog box (in what order) by assigning the

parameters positions in the two dialog boxes. You can thus use different parameters (or different orders)

in the two dialog boxes.

Types must be defined for search help parameters with data elements. These define the display in the

two dialog boxes. If nothing else is defined, a parameter uses the data element of the corresponding

field of the selection method.

When you define a parameter of a search help, you must also define whether it should be used to copy

data to the input help (IMPORT parameter) or whether to return data from the input help (EXPORT

parameter).

The IMPORT and EXPORT parameters of a search help together make up your interface. (This is also

analogous to function modules.)

You can also define interface parameters that do not appear in either the dialog box for displaying the hit

list or the dialog box for restricting values. This is useful for example when screen fields that do not

appear on either of the two dialog boxes are to be updated when you select a value.

The location from which the IMPORT parameters of a search help get their values and the screen fields

in which the contents of the EXPORT parameters of the search help are returned are defined in the

search help attachment.

The search field is a special case. Its contents are only used in the input help if it is a search string (that is, if it contains a ´*´ or a ´+´) and the parameter linked with the search field is an IMPORT parameter.

Parameters that only contain additional information about the search field should not be defined as IMPORT parameters since the user must otherwise empty the corresponding screen fields each time before he can define a new value with the input help.

A search help describes the flow of an input help. The search help can only take effect using a

mechanism that assigns the search help to this field. This mechanism is called the search help

attachment to the field.

Attaching a search help to a field has an effect on the field's behavior. It is therefore considered to be

part of the field definition.

The semantic and technical attributes of a screen field (type, length, F1 help, ...) are not normally defined

directly when the input template is defined. On the contrary, only a reference to an ABAP Dictionary field

(usually with the same name) is specified in the Screen Painter. The screen field takes on the attributes

of this field from the ABAP Dictionary.

The same principle is also used to define the input help of a screen field. The search help is thus attached to the ABAP Dictionary search field and not to the screen field.

In the search help attachment, the interface parameters of the search help and the screen fields providing data for the input help or getting data from the input help are assigned to one another. The search field must be assigned to an EXPORT parameter of the search help at this time. This parameter should also be an IMPORT parameter so that the user can take advantage of search patterns that are

already entered.

Fields that do not have a search help attachment can also have an input help since further mechanisms

(e.g. domain fixed values) are also used for the F4 help.

Hope this is helpful, Do reward.

Read only

Former Member
0 Likes
802

hi,

Follow the link to search help exit creation .

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/creating%2ba%2bsearch%2bhelp%2bexit%2b(C...

Hope this is helpful, Do reward.

Read only

Former Member
0 Likes
802

Hi

Here is the sample code for F4 help in program

--Internal Table to Store Personnel Area Description

DATA: BEGIN OF tbl_werks OCCURS 0,

bukrs LIKE t500p-bukrs, " Division

persa LIKE t500p-persa, " Personnel Area

name1 LIKE t500p-name1, " Personnel Area Name

END OF tbl_werks.

DATA: tbl_tmp_werks LIKE tbl_werks OCCURS 0 WITH HEADER LINE.

DATA: tbl_help_value LIKE help_value OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF tbl_values OCCURS 0,

string(65),

END OF tbl_values.

SELECT-OPTIONS s_persa FOR p0001-werks NO INTERVALS.

-- Value Help for Personnel Area

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_persa-low.

PERFORM get_pers_area_values.

&----


*& Form get_pers_area_values

&----


  • Value Help for Personnel Area

----


FORM get_pers_area_values.

SELECT bukrs persa name1 INTO TABLE tbl_tmp_werks

FROM t500p.

REFRESH: tbl_help_value, tbl_values.

tbl_help_value-tabname = 'T500P'.

tbl_help_value-fieldname = 'BUKRS'.

tbl_help_value-selectflag = ' '.

APPEND tbl_help_value.

tbl_help_value-tabname = 'T500P'.

tbl_help_value-fieldname = 'PERSA'.

tbl_help_value-selectflag = 'X'.

APPEND tbl_help_value.

tbl_help_value-tabname = 'T500P'.

tbl_help_value-fieldname = 'NAME1'.

tbl_help_value-selectflag = ' '.

APPEND tbl_help_value.

LOOP AT tbl_tmp_werks.

tbl_values = tbl_tmp_werks-bukrs.

APPEND tbl_values.

tbl_values = tbl_tmp_werks-persa.

APPEND tbl_values.

tbl_values = tbl_tmp_werks-name1.

APPEND tbl_values.

ENDLOOP.

CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'

EXPORTING

display = ' '

IMPORTING

select_value = s_persa-low

TABLES

fields = tbl_help_value

valuetab = tbl_values.

ENDFORM. " get_pers_area_values

Coming to the second question.

A search help exit is a function module for making the input help

process described by the search help more flexible than possible with

the standard version.

This function module must have the same interface as function module

F4IF_SHLP_EXIT_EXAMPLE. The search help exit may also have further

optional parameters (in particular any EXPORTING parameters).

The type group SHLP must also be declared in the global data of the

search help exit.

A search help exit is called at certain timepoints in the input help

process.

Hope your question is solved.

DOnt forget to reward

BR

Sree