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 Exit

Former Member
0 Likes
3,524

Hello,

I am trying to build a search help for a custom table. I know that I have to build a search help in se11 and to implement a search help exit in order to do complex calculations. The problem is that I don't know hos to use the template 'F4IF_SHLP_EXIT_EXAMPLE'. I tried to write code to the SELECT step and I filled in the table record_tab. Everithing goes well, the problem is that I manually set callcontrol-step = 'SELECT' at the beginning of the FM, otherwise the code is not executed. Is this ok? The results are displayed well, the problem is that the selected record is not exported to the calling field.

A simple example would be very usefull.

Thank you!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,949

Hi

The STEP should be setted by the system, you need to implement the step SELECT if you want to overwrite the data selected, if you need to change the data to be displayed you should use DISP step.

Max

7 REPLIES 7
Read only

Former Member
0 Likes
1,950

Hi

The STEP should be setted by the system, you need to implement the step SELECT if you want to overwrite the data selected, if you need to change the data to be displayed you should use DISP step.

Max

Read only

0 Likes
1,949

I forgot to say that all my data operations is inside the screen help exit FM, I don't have a selection method for my elementary search help.

Read only

0 Likes
1,949

In my case is not handled by the system. What should I do?

Read only

0 Likes
1,949

Hi

I created a searchhelp without a method to select the vendor code. It has only the vendor code (LIFNR) and description as fields of input/output.

In my exit I use this code in the SELECT step:

*"----------------------------------------------------------------------
* STEP SELECT    (Select values)
*"----------------------------------------------------------------------
* This step may be used to overtake the data selection completely.
* To skip the standard seletion, you should return 'DISP' as following
* step in CALLCONTROL-STEP.
* Normally RECORD_TAB should be filled after this step.
* Standard function module F4UT_RESULTS_MAP may be very helpfull in this
* step.
  IF CALLCONTROL-STEP = 'SELECT'.
    DATA: BEGIN OF MY_DATA,
            LIFNR LIKE LFA1-LIFNR,
            NAME1 LIKE LFA1-NAME1,
          END   OF MY_DATA.

    DATA RC TYPE SY-SUBRC.

    DO 6 TIMES.
      MOVE SY-INDEX TO MY_DATA-LIFNR.
      WRITE: 'Vendor' TO MY_DATA-NAME1,
             SY-INDEX TO MY_DATA-NAME1+6.
      APPEND MY_DATA TO RECORD_TAB.
    ENDDO.

    RC = 0.

    IF RC = 0.
      CALLCONTROL-STEP = 'DISP'.
    ELSE.
      CALLCONTROL-STEP = 'EXIT'.
    ENDIF.
    EXIT. "Don't process STEP DISP additionally in this call.
  ENDIF.

It works fine

Max

Read only

Former Member
0 Likes
1,949

refer....

http://help.sap.com/saphelp_40b/helpdata/en/9f/dbad1135c111d1829f0000e829fbfe/content.htm

Context-sensitive Value Help

Value help is an integral function within the R/3 System. It provides help for users when they do not know (or only partially know) the value that they want to enter in a field.

To ensure that this function behaves in the same way throughout the system, there are several standard mechanisms within the R/3 System that are used to define value help for a screen field. In many cases, these standard procedures are sufficient to produce the desired results.

To assign value help to a field, you can either create it explicitly for the current screen, or use the attributes of the ABAP Dictionary field that underlies the screen field.

Linking Value Help to a Screen

The system contains the following mechanisms:

User-defined input help in the PROCESS ON VALUE-REQUEST (POV) section of the flow logic.

A module assigned to a field in the Screen Painter has the highest priority when the system is working out what to display as F4 help.

Example:

PROCESS ON HELP-REQUEST.

FIELD SPFLI-AIRPFROM

MODULE VAL_REQ_AIRPORT.

The PROCESS ON VALUE-REQUEST event allows you to program your own value help. If you specify a FIELD statement for the input field after PROCESS ON VALUE-REQUEST, the corresponding module is executed.

After this keyword, you can define what happens when the user presses F4.

Development class SDWA contains an example program demonstrating user-defined input help with PROCESS ON VALUE-REQUEST.

We recommend that, from Release 4.0, you use search helps as an alternative to PROCESS ON VALUE-REQUEST, even though the POV method is still possible. Defining search helps is much easier than PROCESS ON VALUE-REQUEST, since the system takes over some of the standard operations, such as getting field contents from the screen. It also ensures that the F4 help has a uniform look and feel throughout the system. Furthermore, it means that you do not have to reassign input help to fields on each screen.

For further information about search helps, see the online documentation for the ABAP Dictionary.

Despite the introduction of search helps (and search help exits), there are still cases in which you need to use parts of the standard F4 functions directly. Within user-defined input help, you can use function modules that support not only search helps, but also the other forms of input help. These all have the prefix F4IF_.

Automatic input help for input check "FIELD... SELECT... " in the flow logic.

The "FIELD... SELECT..." construction only allows the user to input values that are contained in a check table. You can place the values already entered into further screen fields or into global fields.

For more information about how to use the SELECT statement, refer to the keyword documentation in the flow logic editor.

The selection and formatting of the hit list can be affected by a text table or a search help for the check table.

Automatic input help for the input check "FIELD... VALUES..." in the flow logic.

Just like "FIELD... SELECT...", "FIELD... VALUES..." restricts the permitted input values to certain values or intervals. The values and intervals are displayed in the input help.

If you use the keyword NOT, the input help is no longer available.

Linking Value Help to the ABAP Dictionary

The system contains the following mechanisms:

Direct link of a search help to the ABAP Dictionary field.

Value help using a check table.

The value help is provided for all fields that are checked against the table. If the check table has a search help, it is displayed. Otherwise, only the key values for the check table are displayed. If there is a text table for the check table, the texts are displayed in the logon language.

Linking a search help to a data element

For details about how to link a search help to an ABAP Dictionary element, refer to the Linking a Search Help with a Screen Field section of the ABAP Dictionary documentation.

Fixed value help for fields that refer to a domain with fixed values.

The fixed values defined in the domain are displayed. When the user selects a value, it is copied directly into the screen field. You can enter fixed values in the ABAP Dictionary; choose Goto ® Fixed values.

Fixed input help for fields with a certain elementary type.

The system automatically provides special input help for date (DATS) and time (TIMS) fields. These allow users to select values from calendar or configurable clock.

As a rule, value help programmed from a screen takes precedence over that in the ABAP Dictionary. If more than one type of ABAP Dictionary input help conflict, the one listed higher in the above list takes priority.

The technique of displaying a value table as input help has been withdrawn in Release 4.0, since it sometimes led to unexpected results, especially where the value table had several key fields. It was not possible to restrict the other key fields, which meant that the environment of the field was not considered, as is normal with check tables.

If you used this kind of search help and found it useful, you can recreate it by attaching a search help to the data elements of the domain. If you used to use a help view, use this as the selection method. Otherwise, you can enter the value table as the selection method.

Using Search Helps to Adapt the Value Help

If you need more flexibility than standard search helps provide, you can use a search help exit to call a function module in which you design the value help you need.

A search help exit is a function module, provided by the developer, which you can call at predetermined points during F4 processing. It allows you to affect how the help display is processed, or replace steps in it with your own.

The function module can change the attributes of the search help, the selection options that are used to preselect the hit list, the hit list itself, and also the subsequent steps in the F4 processing.

The function module that you build into your search help as a search help exit must have the same interface as the function module F4IF_SHLP_EXIT_EXAMPLE. It may also have further optional parameters (in particular, any number of EXPORTING parameters).

The appropriate place to call the search help exit is always before the interaction steps when you call the value help. This is the point at which the input help is displayed for the user, and thus where only actions relevant to the user are possible. The following events are defined at which you can call the search help exit:

Before the elementary search help is displayed (in the case of collective search helps). Event SELONE.

For details of the events, refer to the documentation for function module F4IF_SHLP_EXIT_EXAMPLE.

This makes it possible to make the search help dependent on the transaction, on other system variables, or even on the state of the radio buttons on the screen.

(This is the only event in which the search help exit is called for collective search helps. All other events call the search help exit for the selected elementary search help.)

After an elementary search help has been selected (event PRESEL1).

Before the value selection dialog box is displayed (event PRESEL).

This enables you to change the contents of the dialog box, or to suppress it altogether.

Before the value selection (event SELECT).

The value selection involves no user interaction. However, it is a step that must often be taken over completely by the function module because the data cannot be selected easily from a table or view.

Before the hit list is displayed (event DISP).

This makes it possible, for example, to hide certain entries or fields of a table from the user depending on his or her authorization.

To be able to work effectively in any of the above steps, the function module needs to receive all of the internal information that depends on a search help and the tables of the F4 processor as its parameters. For more information, see the function module documentation for F4IF_SHLP_EXIT_EXAMPLE.

Certain search help functions are requested repeatedly in similar ways. One example of this is the possibility to set the search help that will be used dynamically. Standard function modules have been written for these cases, which you can use either directly as search help exits, or call from within a search help exit. Such function modules all have the prefix F4UT_.

Read only

Former Member
Read only

Former Member
0 Likes
1,949

Thank you all for your help.