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: 

Search help

Former Member
0 Kudos

Can i know i n detail abt the functionality and types of search help

pls explain me with some examples.

ie how it can be created and all

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Anju,

Check this info. Hope this will prove satisfactory.

There are 3 ways to create search help :

1)In the PAI of the screen, add a module Process on value request.For example:

PROCESS AFTER INPUT.

MODULE USER_COMMAND_100.

PROCESS ON VALUE-REQUEST.

FIELD field_name MODULE value_request_for_field_name.

*field_name is the field for which you require search help.

In the Module value_request_for_field_name call this function 'F4IF_INT_TABLE_VALUE_REQUEST'.

2)The above procedure can be used if the field you have defined doesnt have an existing search help.If it already has search help and the field in the screen is taken from the dictionary,then in the attributes,u can check from from dictionary under the dictionary tab.

3)A manual search help can also be created in the se11 transaction by clicking on the search help radio button and giving the table and field name for which search help is required.

Creating Elementary Search Helps

Procedure

In the initial screen of the ABAP Dictionary, select object class Search help, 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 .

The maintenance screen for elementary search helps appears.

Enter an explanatory text in the field Short text.

You can for example find the search help at a later time using this short text.

In the Definition tab page enter 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 you enter a table that has a text table, the name of the text table is automatically entered in the corresponding field.

Using the input help (F4 help), select fields of the selection method as parameter in the Search help parameter area. Select the fields that should be used in the dialog box for value selection or in the hit list.

If the selection method is a table that has a text table, both the fields of the table and the fields of the text table are offered in the input help.

The data element of the parameter is automatically copied from the selection method. The data element defines the output attributes and the F1 help of the parameter in the hit list and in the dialog box for value selection.

You can assign the parameter another data element. To do so, select the Mod flag. The Data element field is now ready for input. Then select a data element with the input help (F4 help). Only data elements whose data type, length and number of decimal places is the same as those of the previous data element can be assigned.

This removes the link between the data element of the search help parameter and the data element of the selection method field having the same name. If you cancel the Mod flag, the data element of the assigned table field is used again.

Define the attributes of the search help parameters.

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 parameter position in the hit list in LPos. If you enter nothing or the value 0 here, the parameter is not displayed in the hit list.

Enter the parameter position 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.

Set the SDis flag if the parameter should be a pure display field in the dialog box for value selection. The user is thus informed that the contents of the parameter restrict the value, but he cannot change this restriction. This makes sense for example when the parameter is an import parameter or if it has a default value.

You can assign the parameter a default value in the Default value field.

Select the dialog type of the search help.

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

Save your entries.

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

Choose .

Do not forget to link the search help to a screen field. The search help attachment is not part of the search help definition; it is part of the object definition to which the search help is attached.

Result

The search help is activated. You can find information about the activation flow in the activation log, which you can display with Utilities ® Activation log. If errors occurred during activation, the activation log is automatically displayed.

Other Options

Assign a hot key: If the search help is to be accessed with a hot key, you must enter a one-place ID in the Hot key field. All the elementary search helps contained in a collective search help should have different short cuts.

Assign a search help exit: In exceptions, you might have to change the standard flow defined by the search help with a search help exit. In this case enter the name of the search help exit in the corresponding field.

Test the search help: You can test the flow of an input help defined by the elementary search help with . A dialog box appears in which you can simulate the behavior of the search help under different conditions. You can obtain information about the options provided in this window with.

See also:

Structure of an Elementary Search Help

An elementary search help defines the standard flow of an input help. You can define the following components of this flow in the search help:

where does the data displayed in the hit list come from (selection method)

what information should be displayed in the dialog box for value selection and in the hit list (search help parameters)

what field contents can be taken into account for hit list selections and which values in the hit list can be returned to the screen fields (search help parameters)

what dialog steps should be executed in the input help (dialog behavior)

Selection Method

The possible input values displayed for a field in the hit list are determined at runtime by database selection.

If all the data required in the hit list comes from one single table, you only have to select this table (or a projection view on this table) as selection method. If there is a text table for the table, its fields are also available in the input help. A table entry is linked with the corresponding text by the existing foreign key.

If the data needed in the hit list comes from more than one table, you must link these tables with a view (database view or help view). This view must be defined as the selection method.

If the underlying tables are client-specific, the client field must be contained in the view. Otherwise selection for the input help would be for all clients.

Search Help Parameters

A search help has an interface consisting of parameters. These parameters define the fields of the selection method that should be used in the input help.

A parameter of the search help must correspond to each field in the dialog box for value selection and to each field of the hit list. The parameters are copied from the corresponding selection method, that is they always have the same name as the corresponding field of the selection method.

If the search is restricted with a parameter of the search help, this is used in the data selection for formulating a WHERE condition for the field of the selection method with the same name. Vice versa, the parameters of the search help are assigned the contents of the fields of the selection method having the same name.

The search help should not contain any parameters for the clients. In the input help, selection is automatically in the logon client of the user.

A data element must be assigned to each search help parameter, that is a type is always defined for the search help parameters.

A search help can contain further parameters that do not correspond to any field of the selection method. This is normally only necessary if the standard flow of the input help described by the search help still has to be modified by with a search help exit.

Import and Export Parameters

When an input help is called, the entries that the user already made in the input template are taken into consideration. For example, if a user calls the input help for the flight number and already specified the carrier, of course only the numbers of flights of this carrier should be offered.

On the other hand, if the user selects one row of the hit list, more than one field of the input template might have to be filled with data from the selected row of the hit list. For example, if the flight number is obtained from the hit list, the city of departure and the destination should also be returned in the screen template.

The interface of a search help defines the context data that can be used in the input help and the data that can be returned in the input template.

A parameter of a search help can be classified as:

Import parameters: Parameters with which context information from the processed input template (screen) may be copied to the help process.

Export parameters: Parameters with which values from the hit list may be returned to the input template.

A parameter can simultaneously be an input and an export parameter. A search help can also contain parameters that are neither import nor export parameters. Such parameters could be required for the internal input help process, for example.

When you attach a search help, you must define where the import parameters of the search help get their values from and the fields in which the contents of the export parameters are returned. See also Value Transport for Input Helps.

Description of the Online Behavior

The online behavior defines the steps executed in the input help process and the structure of the hit list and dialog box for value selection.

The dialog type defines whether or not the dialog box for value selection should be displayed. If you want to skip the dialog box for value selection, the hit list is displayed directly after calling the input help.

When you define an elementary search help, you can define how the dialog box for value selection and the hit list should look. For example, you can define the position of a parameter in the dialog box for value selection here. The column position in which the values of a parameter are displayed in the hit list can also be defined here.

Structure of a Collective Search Help

A collective search help combines several elementary search helps. The user can thus choose one of several alternative search paths with a collective search help.

When you define a collective search help, you only have to specify the search helps that are to be combined in the collective search help. In the input help, the values are transported between the elementary search help selected by the user and the input template using the collective search help. This is why a collective search help also has an interface for transporting the values.

Interface of the Collective Search Help

Like an elementary search help, a collective search help has an interface of import and export parameters. The data is exchanged between the screen template and the parameters of the assigned elementary search helps using this interface.

Assigned Search Helps

A collective search help comprises several elementary search helps. It combines all the search paths that are meaningful for a field.

The interface parameters (import and export parameters) of the included search helps must be assigned to the parameters of the collective search help. Not all of the parameters need to be assigned, that is the assignment can be open for some of the parameters.

Both elementary search helps and other search helps can be included in a collective search help. If other collective search helps are contained in a collective search help, they are expanded to the level of the elementary search helps when the input help is called.

Append Search Helps

An append search help is used to enhance a collective search help (that is not the original in the current system) by further search paths (elementary search helps) without modifications. This technique can be used for example by special developments, country versions, SAP partners and SAP customers to add further search paths to a collective search help in the SAP standard version.

An append search help has a fixed assignment to a collective search help (of your appending object). This appending object is enhanced with an append search help. The structure of an append search help corresponds to the structure of a collective search help.

The append search help takes on the parameters of your appending object. An append search help is automatically included in your appending object. The parameters of both search helps having the same name are assigned to one another.

Append search helps can also be used themselves to describe an input help. In this case they are used like collective search helps. A search help exit cannot be assigned to an append search help.

Elementary search helps without modifications can be hidden in an SAP collective search help with an append search help. You have to include the search help to be hidden in the append search help as well and hide the inclusion there. The search path defined with this search help is no longer offered in the appending search help.

If the parameters of the appending object change, this change is not automatically made in the append search help. Instead, you are informed that you should adjust the parameters of the append search help. In this case you should check if you want to change the assignments between the parameters of the append search help and the search helps included in them.

It would not make sense to automatically change the interface of the appending objects since if the interface of the collective search help changes, some of the contained elementary search helps normally have to be adjusted to this change.

Please check this link on how to create search help.

http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_basic.htm

1) after creation of search help, you can assign this to database field in change mode of table and double clicking of the field name.

2) in screen field, double click to see the attributes and give your search help there.

Refer this link

http://help.sap.com/saphelp_erp2005/helpdata/en/cf/21ee93446011d189700000e8322d00/frameset.htm

Hope this resolves your query.

Reward all the helpful answers.

Regards

7 REPLIES 7

Former Member
0 Kudos

hi,

chk this link:

http://help.sap.com/saphelp_nw04/helpdata/en/97/24a23fa34ffb47e10000000a114084/content.htm

Basic Search Help

Creating a basic search help which allows you to provide the user with a selection help to select specific fields from

a table or view is very straight forward. Simply create a search help with the desired table as the selection method

and add the fields you want them to see/select into the search help parameters section. See below for details of how

to create a search help for table TRDIR

steps:

Step1: Execute transaction SE11

Step2: Create new search help called 'ZSH' (must be less than 5 chars long to be used as matchcode)

Step3: Enter the following details:

http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_basic.htm

Step4: Save and activate

Step5: Add following line into your program: PARAMETER p_prog LIKE trdir-name MATCHCODE OBJECT zsh.

Or see other methods of adding a search help.

diff ways to implement search helps:

http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_imp.htm

ex:to attach a search help to the screen field

Use this functionality to get help.

FORM HELP_CHECK.

*-- Set up fields to retrieve data

ltab_fields-tabname = 'ZFI_PMNTADV'.

ltab_fields-fieldname = 'CHECT'.

ltab_fields-selectflag = 'X'.

APPEND ltab_fields.

ltab_fields-tabname = 'ZFI_PMNTADV'.

ltab_fields-fieldname = 'PMNT_ADV'.

ltab_fields-selectflag = 'X'.

APPEND ltab_fields.

SORT ltab_fields.

DELETE ADJACENT DUPLICATES FROM ltab_fields.

*-- Fill values

SELECT chect

INTO TABLE ltab_values

FROM zfi_pmntadv

WHERE pmnt_adv NE space.

SORT ltab_values.

DELETE ADJACENT DUPLICATES FROM ltab_values.

CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'

EXPORTING

fieldname = 'chect'

tabname = 'zfi_pmntadv'

title_in_values_list = 'Select a value'

IMPORTING

select_value = so_chect

TABLES

fields = ltab_fields

valuetab = ltab_values

EXCEPTIONS

field_not_in_ddic = 01

more_then_one_selectfield = 02

no_selectfield = 03.

ENDFORM. "fiscal_year

**reward if helpful

regards,

madhu

Former Member
0 Kudos

hi,

Refer

Regards,

Santosh

Former Member
0 Kudos

Hi Anju,

Try this link for detailed Search Helps..

If you need something specific just ask.

http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ee93446011d189700000e8322d00/frameset.htm

CHECK THIS LINK TO CREATE A SEARCH HELP.

http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_basic.htm

more details...

Regards,

Priyanka.

Former Member
0 Kudos

HI,

Have a look at these threads-

Mark useful answers.

Kishi.

Former Member
0 Kudos

Hi Anju,

Check this info. Hope this will prove satisfactory.

There are 3 ways to create search help :

1)In the PAI of the screen, add a module Process on value request.For example:

PROCESS AFTER INPUT.

MODULE USER_COMMAND_100.

PROCESS ON VALUE-REQUEST.

FIELD field_name MODULE value_request_for_field_name.

*field_name is the field for which you require search help.

In the Module value_request_for_field_name call this function 'F4IF_INT_TABLE_VALUE_REQUEST'.

2)The above procedure can be used if the field you have defined doesnt have an existing search help.If it already has search help and the field in the screen is taken from the dictionary,then in the attributes,u can check from from dictionary under the dictionary tab.

3)A manual search help can also be created in the se11 transaction by clicking on the search help radio button and giving the table and field name for which search help is required.

Creating Elementary Search Helps

Procedure

In the initial screen of the ABAP Dictionary, select object class Search help, 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 .

The maintenance screen for elementary search helps appears.

Enter an explanatory text in the field Short text.

You can for example find the search help at a later time using this short text.

In the Definition tab page enter 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 you enter a table that has a text table, the name of the text table is automatically entered in the corresponding field.

Using the input help (F4 help), select fields of the selection method as parameter in the Search help parameter area. Select the fields that should be used in the dialog box for value selection or in the hit list.

If the selection method is a table that has a text table, both the fields of the table and the fields of the text table are offered in the input help.

The data element of the parameter is automatically copied from the selection method. The data element defines the output attributes and the F1 help of the parameter in the hit list and in the dialog box for value selection.

You can assign the parameter another data element. To do so, select the Mod flag. The Data element field is now ready for input. Then select a data element with the input help (F4 help). Only data elements whose data type, length and number of decimal places is the same as those of the previous data element can be assigned.

This removes the link between the data element of the search help parameter and the data element of the selection method field having the same name. If you cancel the Mod flag, the data element of the assigned table field is used again.

Define the attributes of the search help parameters.

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 parameter position in the hit list in LPos. If you enter nothing or the value 0 here, the parameter is not displayed in the hit list.

Enter the parameter position 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.

Set the SDis flag if the parameter should be a pure display field in the dialog box for value selection. The user is thus informed that the contents of the parameter restrict the value, but he cannot change this restriction. This makes sense for example when the parameter is an import parameter or if it has a default value.

You can assign the parameter a default value in the Default value field.

Select the dialog type of the search help.

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

Save your entries.

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

Choose .

Do not forget to link the search help to a screen field. The search help attachment is not part of the search help definition; it is part of the object definition to which the search help is attached.

Result

The search help is activated. You can find information about the activation flow in the activation log, which you can display with Utilities ® Activation log. If errors occurred during activation, the activation log is automatically displayed.

Other Options

Assign a hot key: If the search help is to be accessed with a hot key, you must enter a one-place ID in the Hot key field. All the elementary search helps contained in a collective search help should have different short cuts.

Assign a search help exit: In exceptions, you might have to change the standard flow defined by the search help with a search help exit. In this case enter the name of the search help exit in the corresponding field.

Test the search help: You can test the flow of an input help defined by the elementary search help with . A dialog box appears in which you can simulate the behavior of the search help under different conditions. You can obtain information about the options provided in this window with.

See also:

Structure of an Elementary Search Help

An elementary search help defines the standard flow of an input help. You can define the following components of this flow in the search help:

where does the data displayed in the hit list come from (selection method)

what information should be displayed in the dialog box for value selection and in the hit list (search help parameters)

what field contents can be taken into account for hit list selections and which values in the hit list can be returned to the screen fields (search help parameters)

what dialog steps should be executed in the input help (dialog behavior)

Selection Method

The possible input values displayed for a field in the hit list are determined at runtime by database selection.

If all the data required in the hit list comes from one single table, you only have to select this table (or a projection view on this table) as selection method. If there is a text table for the table, its fields are also available in the input help. A table entry is linked with the corresponding text by the existing foreign key.

If the data needed in the hit list comes from more than one table, you must link these tables with a view (database view or help view). This view must be defined as the selection method.

If the underlying tables are client-specific, the client field must be contained in the view. Otherwise selection for the input help would be for all clients.

Search Help Parameters

A search help has an interface consisting of parameters. These parameters define the fields of the selection method that should be used in the input help.

A parameter of the search help must correspond to each field in the dialog box for value selection and to each field of the hit list. The parameters are copied from the corresponding selection method, that is they always have the same name as the corresponding field of the selection method.

If the search is restricted with a parameter of the search help, this is used in the data selection for formulating a WHERE condition for the field of the selection method with the same name. Vice versa, the parameters of the search help are assigned the contents of the fields of the selection method having the same name.

The search help should not contain any parameters for the clients. In the input help, selection is automatically in the logon client of the user.

A data element must be assigned to each search help parameter, that is a type is always defined for the search help parameters.

A search help can contain further parameters that do not correspond to any field of the selection method. This is normally only necessary if the standard flow of the input help described by the search help still has to be modified by with a search help exit.

Import and Export Parameters

When an input help is called, the entries that the user already made in the input template are taken into consideration. For example, if a user calls the input help for the flight number and already specified the carrier, of course only the numbers of flights of this carrier should be offered.

On the other hand, if the user selects one row of the hit list, more than one field of the input template might have to be filled with data from the selected row of the hit list. For example, if the flight number is obtained from the hit list, the city of departure and the destination should also be returned in the screen template.

The interface of a search help defines the context data that can be used in the input help and the data that can be returned in the input template.

A parameter of a search help can be classified as:

Import parameters: Parameters with which context information from the processed input template (screen) may be copied to the help process.

Export parameters: Parameters with which values from the hit list may be returned to the input template.

A parameter can simultaneously be an input and an export parameter. A search help can also contain parameters that are neither import nor export parameters. Such parameters could be required for the internal input help process, for example.

When you attach a search help, you must define where the import parameters of the search help get their values from and the fields in which the contents of the export parameters are returned. See also Value Transport for Input Helps.

Description of the Online Behavior

The online behavior defines the steps executed in the input help process and the structure of the hit list and dialog box for value selection.

The dialog type defines whether or not the dialog box for value selection should be displayed. If you want to skip the dialog box for value selection, the hit list is displayed directly after calling the input help.

When you define an elementary search help, you can define how the dialog box for value selection and the hit list should look. For example, you can define the position of a parameter in the dialog box for value selection here. The column position in which the values of a parameter are displayed in the hit list can also be defined here.

Structure of a Collective Search Help

A collective search help combines several elementary search helps. The user can thus choose one of several alternative search paths with a collective search help.

When you define a collective search help, you only have to specify the search helps that are to be combined in the collective search help. In the input help, the values are transported between the elementary search help selected by the user and the input template using the collective search help. This is why a collective search help also has an interface for transporting the values.

Interface of the Collective Search Help

Like an elementary search help, a collective search help has an interface of import and export parameters. The data is exchanged between the screen template and the parameters of the assigned elementary search helps using this interface.

Assigned Search Helps

A collective search help comprises several elementary search helps. It combines all the search paths that are meaningful for a field.

The interface parameters (import and export parameters) of the included search helps must be assigned to the parameters of the collective search help. Not all of the parameters need to be assigned, that is the assignment can be open for some of the parameters.

Both elementary search helps and other search helps can be included in a collective search help. If other collective search helps are contained in a collective search help, they are expanded to the level of the elementary search helps when the input help is called.

Append Search Helps

An append search help is used to enhance a collective search help (that is not the original in the current system) by further search paths (elementary search helps) without modifications. This technique can be used for example by special developments, country versions, SAP partners and SAP customers to add further search paths to a collective search help in the SAP standard version.

An append search help has a fixed assignment to a collective search help (of your appending object). This appending object is enhanced with an append search help. The structure of an append search help corresponds to the structure of a collective search help.

The append search help takes on the parameters of your appending object. An append search help is automatically included in your appending object. The parameters of both search helps having the same name are assigned to one another.

Append search helps can also be used themselves to describe an input help. In this case they are used like collective search helps. A search help exit cannot be assigned to an append search help.

Elementary search helps without modifications can be hidden in an SAP collective search help with an append search help. You have to include the search help to be hidden in the append search help as well and hide the inclusion there. The search path defined with this search help is no longer offered in the appending search help.

If the parameters of the appending object change, this change is not automatically made in the append search help. Instead, you are informed that you should adjust the parameters of the append search help. In this case you should check if you want to change the assignments between the parameters of the append search help and the search helps included in them.

It would not make sense to automatically change the interface of the appending objects since if the interface of the collective search help changes, some of the contained elementary search helps normally have to be adjusted to this change.

Please check this link on how to create search help.

http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_basic.htm

1) after creation of search help, you can assign this to database field in change mode of table and double clicking of the field name.

2) in screen field, double click to see the attributes and give your search help there.

Refer this link

http://help.sap.com/saphelp_erp2005/helpdata/en/cf/21ee93446011d189700000e8322d00/frameset.htm

Hope this resolves your query.

Reward all the helpful answers.

Regards

former_member196299
Active Contributor
0 Kudos

HI ,

I have a good document which can solve all your queries .

here you go ...

Complete Documentation for Search Helps :

Structure of the document:

Introduction

What are Search helps and their use?

• How many types of Search helps are available?

• How to create search helps?

• Examples of different search helps.

• What are search helps exits? Creation procedure of search help exits and

• How to use them in search helps according to need?

• Example of search help exits.

Introduction :

There is a standard way of providing input values to any screen field in ABAP reporting. This way of providing input values can be defined by creating the search helps in ABAP dictionary and using them in reports .

Search helps: Search helps are used to assign an input help ( F4 help ) to screen fields. You can do this by creating a search help for that screen field. And these search helps has only to be assigned to the corresponding screen fields.

There are 2 types of search helps according to their use are available in SAP.

They are : 1) Elementary search helps ( ESH )

2) Collective search helps ( CSH )

1) Elementary search helps ( ESH 😞 These kind of search helps describe a search path. The elementary search help must define where the data of the hit list should be read from (selection method), how the exchange of values between the screen template and selection method is implemented (interface of the search help) and how the online input help should be defined (online behavior of the search help).

An ESH defines the standard flow of an input search. The following components of this flow can be defined in the search helps.

• Where does the data displayed in the list come from( selection method ).

• What information should be displayed in the dialog box for value selection and the in hit list ( search help parameters ) .

• What field contents can be taken into account for hit list selection and which values in the hit list can be returned to the screen fields (import and export parameters).

• What dialog step should be executed in the input help ( Dialog behavior ) .

Selection Method: The possible input values of fields displayed in the hit list are determined at runtime by a database selection. In Selection method we provide the

Table name from where the data is being selected. If data retrieval is from more than

two tables then we can create a view ( database view or help view ) and then use it in Selection method . If the tables are client specific then the client field must be copied to the view or else the selection will be for all the clients.

Sear help parameters: A search help has an interface consists of parameters. These parameters defines the fields of the selection method that should be used in the input field. The parameters are copied from the corresponding selection method, that is they always have the same name as the corresponding field of the selection method.

If the search is restricted with a parameter of the search help, this is used in the data selection for formulating a WHERE condition for the field of the selection method with the same name. A data element should be assigned to each search help parameter in other words you define a type for the search help parameter.

Import and Export parameters: The interface of a search help defines the context data that can be used in the input help (import) and the data that can be returned in the input template (export) .

When an input help is called, the entries that the user already made in the input template are taken into consideration. For example, if a user calls the input help for the flight number and already specified the carrier, of course only the numbers of flights of this carrier should be offered. On the other hand if the user selects one row of the hit list, more than one field of the input template might have to be filled with data from the selected row of the hit list. For example, if the flight number is obtained from the hit list, the city of departure and the destination should also be returned in the screen template.

The sample screen is provided for better understanding of screen description of search helps.

• Import parameters: Parameters with which context information from the processed input template (screen) may be copied to the help process.

• Export parameters: Parameters with which values from the hit list may be returned to the input template.

How does the value gets transferred to the input helps ? The values already entered on the screen are used as restrictions for a selection from the hit list. Only those hits that are consistent with the values already entered are displayed. When the input help is called, the system tries to find a field with the same name on the screen for each import parameter of the search help that is attached to a table or structure field. If such a field is found, the contents of the screen field are copied to the search help parameter.

There are at most four steps when searching for the screen field with the same name:

• If the input help is called in a step loop, a field with the same name is searched for in this step loop.

• If the step loop does not contain a field with the same name, the corresponding sub-screen is searched.

• If the sub-screen does not have a field with the same name, the main screen is searched.

• If the main screen does not contain a field with the same name either, the module pool of the corresponding screen is searched.

Values are only returned at the level where the input help was called. The values are only returned to the export parameters.

Collective Search helps ( CSH 😞 These kind of search helps are the combination of various elementary search paths, so they can provide a some alternative search paths.

While defining the CHS we need to provide all the ESH we want to include in that

CSH .A collective search help also has an associated interface for transporting the values they use both the ESH parameter and the input template.

A CSH is a collection of single or multiple elementary search helps and it combines all the meaningful search paths. While linking the elementary search helps with the collective search help there must be at-least one parameter assignment done for linking both of them. This parameter assignment should be done between the interface parameters of the collective search help with that of the included search helps.

Creation of Elementary Search Help:

The creation of an elementary search help is described below with example.

1. Open TCode – SE11 for DDIC objects -> select the radio button for Search helps -> give the name of the search help you want to create, ex – ZSH004.Click on Create .

2. In the next screen select the option “ Elementary search help “ .

3. Now you need to provide the short text for your search help.

4. In the selection method provide the table or view name you want to use for data retrieval. Ex. ZMARA_01.

5. Select the dialog type according to your scope, ex. “ display values immediately’.

6. Then provide the search help parameters i.e. the interface parameters for the search help .

7. The ZMARA_01 table fields MATNR, ERSDA,MHDHB,MHDHT,MHDRZ are provided by selecting the table fields , by doing this the data elements for these fields are automatically copied to the interface from the selection method.

8. Now define the type of parameter ( import or export ) here for the selection and return of values in runtime.

9. Provide the positions to these parameters to specify how they will be arranged in the hit list display.

10. Now save the object in the respective development class and check the same for errors and then activate .Finally the creation of a ESH ( ex: ZSH004 ) is complete and can be used for providing the input help.

You can test the operation of your search help by clicking F8.

The appearance of your search help will be like the fig. provided below.

Creation of Collective Search Helps:

The creation of an elementary search help is described below with example.

1. Open TCode – SE11 for DDIC objects -> select the radio button for Search helps -> give the name of the search help you want to create, ex – ZSH005.Click on Create .

2. In the next screen select the option “ Collective search help “ .

3. Now you need to provide the short text for your search help.

4. Select the dialog type according to your scope, ex. “ display values immediately’.

5. Then provide the search help parameters i.e. the interface parameters for the search help .

6. The ZMARA_01 table fields MATNR, ERSDA,MHDHB are provided by selecting the table fields . Define the types for the parameters of a collective search help by assigning a data element. Enter the name of the data element that describes the contents of the search help parameter in the Data element field.

7. In the Definition tab page enter the parameters of the collective search help.

Select the Imp flag if it is an import parameter. Select the Exp flag if it is an export parameter. Optional-You can assign the parameter a default value in the Default value field.

8.

Next, Select the tab “ Included Search help “ and provide the elementary search helps you want to include here . In the current example 2 elementary search helps ZSH004 and ZSH003 are being included.

9. Create a parameter assignment between all the included search helps and the collective search help here ( Note that at-least one of the parameter assignment must be done for linking the includes ) .This can be done by clicking on the tab

10. “Parameter assignment “ .ex. we have done the parameter assignment here by using the MATNR field for both the includes i.e. the selection paths should be based on the provided material number.

11. After performing the steps save the search help and activate for use in the later stage.

Additions to the Search helps :

There are few additional functionalities which can be achieved by providing the following :

• Hot Key: The hot key is used to select the elementary search help from the collective search help and to enter the restrictions in the dialog box for restricting values directly from the entry field. If the user often searches for values using the same search help, this procedure can save time. The hot key is available only if for the relevant screen field there is an entry in the Screen Painter in the Search help attribute, that is, if this attribute is not initial.

• Search Help Exits: In exceptions, you might have to change the standard flow defined by the search help with a search help exit. In this case enter the name of the search help exit in the corresponding field. In the later part of the document one example has been provided for describing and understanding Search Help Exits.

Search Help Exits: A search help describes the standard input help process. In exceptions it could be necessary to deviate in some points from this standard. Such a deviation from the standard can also be implemented using a search help exit. The search helps should look as much same as possible through out the entire system so all the exceptions only should be put in the search help exits.

The 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 and the administrative data of the help processors are passed to the search help exit using the interface.

There are some of the search help exits provided by the SAP system and they are used when needed. All the search help exits are stored under the function group SDHI.

A list of function modules provided by SAP for reference are :

F4UT_OPTIMIZE_COLWIDTH – this search help exit adjusts the column width in the hit list to the contents of the column. It makes sense to use this search help exit when the columns of the hit list have to be made very wide.

Any search help exit created should have the same interface as the F4IF_SHLP_EXIT_EXAMPLE. The module is well documented with all the conditions and should be considered as a sample example for understanding the logics involved.

The various parameters involved here are:

TABLE parameters:

• SHLP_TAB - contains information about the search help fields and structures.

• RECORD_TAB – contains the hit list.

CHANGING parameters:

• SHLP – additional information about the parameters. (Deep structure)

• CALLCONTROL – instructions for controlling the search help process.

There are several logics involved in using the CALLCONTROL-STEP.

CALLCONTROL-STEP: This field can be set by your system and can be changed by your code. The function module will be called for each step of the process for each conditional exceptions noted below.

1. SELONE: Call before selecting an elementary search help. The possible elementary search helps are already in SHLP_TAB. This can be used in a search help exit of a collective search help to restrict the selection possibilities for the elementary search helps. Entries that are deleted from SHLP_TAB in this step are not offered in the elementary search help selection. If there is only one entry remaining in SHLP_TAB, the dialog box for selecting elementary search helps is skipped. This code is not accessed again if another elementary search help is to be selected during the dialog.

2. PRESEL1:After selecting an elementary search help. Table INTERFACE has not yet been copied to table SELOPT, at this timepoint in the definition of the search help (type SHLP_DESCR_T). This means that you can still influence the attachment of the search help to the screen here. (Table INTERFACE contains the information about how the search help parameters are related to the screen fields).

3. PRESEL: Before sending the dialog box for restricting values. This timepoint is suitable for predefining the value restriction or for completely suppressing or copying the dialog.

4. SELECT: Before selecting the values. If you do not want the default selection, you should copy this timepoint with a search help exit. DISP should be set as the next timepoint.

5. DISP: Before displaying the hit list. This timepoint is suitable for restricting the values to be displayed, e.g. depending on authorizations.

6. RETURN (usually as return value for the next timepoint): The RETURN timepoint should be returned as the next step if a single hit was selected in a search help exit.

It can make sense to change the F4 flow at this timepoint if control of the process sequence of the Transaction should depend on the selected value (typical example: setting SET/GET parameters). However, you should note that the process will then depend on whether a value was entered manually or with an input help.

7. RETTOP: You only go to this timepoint if the input help is controlled by a collective search help. It directly follows the timepoint RETURN. The search help exit of the collective search help, however, is called at timepoint RETTOP.

8. EXIT (only for return as next timepoint):The EXIT timepoint should be returned as the next step if the user had the opportunity to terminate the dialog within the search help exit.

9. CREATE:The CREATE timepoint is only accessed if the user selects the function "Create new values". This function is only available if field CUSTTAB of the control string CALLCONTROL was given a value not equal to SPACE earlier on.

The name of the (customizing) table to be maintained is normally entered there. The next step returned after CREATE should be SELECT so that the newly entered value can be selected and then displayed.

10. APP1, APP2, APP3:If further pushbuttons are introduced in the hit list with function module F4UT_LIST_EXIT, these timepoints are introduced. They are accessed when the user presses the corresponding pushbutton.

If there is a search help linked to a dictionary field (either directly to the field or to its data element), then defining a report parameter LIKE the dictionary field will bring in the search help functionality for you.

Please refer the below screen1 and screen2 to notice the difference :

Screen1:

Screen2:

You can program your own possible values directly. Code the event AT SELECTION-SCREEN ON VALUE REQUEST FOR <field name>, then write the code to produce the list. The system creates the possible values button for you.

Example for creation of search help exits.

Object : The scope of this object is to calculate the gross remaining shelf life for a material, where we don’t have a field for the gross remaining shelf life in the table

Used. Create and test the search helps on this table. And provide a search help exit

Using which you can do the calculation for the gross remaining shelf life .

Created a table ZMARA_01 using the table fields MATNR , ERSDA,ERNAM,MTART,MHDHB,MHDRZ of std table MARA.

Created a field MHDHT with the same attributes of field MHDRZ in table ZMARA_01 .

Created an Elementary search help ZSH003 in SE11 using the selection method as the table ZMARA_01. Provided all the parameters with Import and Export functionality .

A screen shot is provided below to show the custom search help object ZSH003:

Created a report Z_SHLP_PRG_02 which uses the above search help .

Created report Z_FILL_TAB_ZMARA_01 to fill the custom table ZMARA_01.

The logic used here for filling the table ZMARA_01 is given below:

SELECT MATNR ERSDA ERNAM MBRSH MHDHB MHDRZ

FROM MARA INTO TABLE itab_flat.

LOOP AT itab_flat TO 100.

MODIFY ZMARA_01 FROM itab_flat.

ENDLOOP.

The data of table MARA are populated to table ZMARA_01.The table ZMARA_01 is finally filled with values.

Created the search help exit Z_SHLP_ZMARA_01 in SE37 under the function group ZFGP and following process is being taken into consideration. The function module interface of the exit are defined same as the interface of function module exit SAPBC_GLOBAL_F4_SFLIGHT.

The detailed documentation of this function module is provided along with the code of the function module as well .

The steps used in this function module are described below.

At the beginning one internal table I_CALC is created which is parallel to record_tab and contains the fields MHDHB, MHDHT MHDRZ . By default out of these two fields MHDHB and MHDRZ are not displayed on the list of possible entries. So we have saved some area for these fields in the F4 processing logic so that it will be used for calculation.

As we do not want to do the default value selection, a code for the same has been written in the SELECT part of the CALLCONTROL –STEP( For CALLCONTROL-STEPs please refer the documentation for search helps ). In this part of code we are supposed to reserve spaces for the fields which do not appear as hit list in the selection i.e fields MHDHB and MHDRZ.

To serve the same purpose we can call a std. function module ‘F4UT_PARAMETER_ALLOCATE’.The functionality of this function module is, here the F4 processor manages the data selected to be displayed or returned in the screen in table RECORD_TAB ( provides search help result structure ).In some of the cases a search help exit also needs the contents of additional fields of the selection method . Calling this function module ensures that space is reserved for this field in RECORD_TAB and its contents are also selected. This parameter should be of the same name as the corresponding field. This parameter does not have to be an Export Parameter and need not to be displayed in the hit-list. For further description on this refer the documentation for ‘F4UT_PARAMETER_ALLOCATE’ the doc. part.

After performing the section of code for value selection the contents of the parameters can be defined by calling the function module ‘F4UT_PARAMETER_VALUE_GET’.By calling this function module in a search help exit you can find out the current contents of a search help parameter. You must distinguish between the parameter contents that are used in the selection process of the input help process and the parameter contents that are determined by the selection process and the user selection.

As all the calculation are suppose to be done before displaying the hit list we can write the corresponding code for calculation in the next step i.e. in the DISP part of the CALLCONTROL-STEP . Perform the above steps for both of the screen fields.

Now after getting the values into the internal table I_CALC, we can do the calculations needed. In our example we have to calculate the value of total shelf life i.e. MHDHT.

After doing the calculation populate this value into the search help data.

For populating this data we can use a standard function module ‘F4UT_PARAMETER_RESULTS_PUT'. If you call this function module in a search help , you can change the results for a search help parameter. The results of the input help process are managed by the F4 processor in RECORD_TAB. In this module you can define whether you want to change the header of RECORD_TAB or the body of the RECORD_TAB.