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

HOW DO I USE USER EXIT SEARCH HELP.

I HAVE ROW WITH 4 ELEMENT, IN STANDARD I GET 1 ELEMENT

I WANT TO GET 2 ELEMENT HOW I DO IT?

IF I NEED USER EXIT HOW I USE IT?

pls

2 REPLIES 2

Peter_Inotai
Active Contributor
0 Kudos

You can use FM F4IF_INT_TABLE_VALUE_REQUEST for this.

Look an example here:

*======================================================================*
* Provide F4 help for uflag-low
*======================================================================*
  METHOD get_f4_help_uflag_low.

    TYPES: BEGIN OF ty_s_uflag,
             uflag TYPE usr02-uflag,
*             txt50 TYPE ttext-text1,
              txt50 TYPE pdrhct-rtext,
           END OF ty_s_uflag.

    DATA: lwa_uflag TYPE          ty_s_uflag,
          lit_uflag TYPE TABLE OF ty_s_uflag.

    DATA: lwa_return TYPE          ddshretval,
          lit_return TYPE TABLE OF ddshretval.

    DATA: lwa_suflag LIKE LINE OF s_uflag.

* Fill lit_uflag
    lwa_uflag-uflag = '00'.
    lwa_uflag-txt50 = 'User not locked'(uf0).
    APPEND lwa_uflag TO lit_uflag.
    CLEAR lwa_uflag.

    lwa_uflag-uflag = '32'.
    lwa_uflag-txt50 =
           '(Hex 20) Locked by central administrator of CUA'(uf1).
    APPEND lwa_uflag TO lit_uflag.
    CLEAR lwa_uflag.

    lwa_uflag-uflag = '64'.
    lwa_uflag-txt50 = '(Hex 40) Locked by administrator'(uf2).
    APPEND lwa_uflag TO lit_uflag.
    CLEAR lwa_uflag.

    lwa_uflag-uflag = '128'.
    lwa_uflag-txt50 = '(Hex 80) Locked due to incorrect messages'(uf3).
    APPEND lwa_uflag TO lit_uflag.
    CLEAR lwa_uflag.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
         EXPORTING
              retfield        = 'UFLAG'
              value_org       = 'S'
         TABLES
              value_tab       = lit_uflag
              return_tab      = lit_return
         EXCEPTIONS
              parameter_error = 1
              no_values_found = 2
              OTHERS          = 3.

    IF sy-subrc <> 0.
      lwa_suflag-low = space.
      APPEND lwa_suflag TO i_suflag.
      CLEAR  lwa_suflag.
    ELSE.

*---> Get selected entry
      READ TABLE lit_return INTO lwa_return INDEX 1.
      IF sy-subrc = 0.
        lwa_suflag-sign = 'I'.
        lwa_suflag-option = 'EQ'.
        lwa_suflag-low = lwa_return-fieldval.
        REFRESH i_suflag.
        APPEND lwa_suflag TO i_suflag.
        CLEAR  lwa_suflag.
        CLEAR  lwa_return.
      ENDIF.

    ENDIF.

  ENDMETHOD.                    " get_f4_help_uflag_low

former_member927251
Active Contributor
0 Kudos

Hi Liat,

Refer the following information about Search Help Exit.

Search help exit : 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).

A search help exit is called at certain time points in the input help process.

Note: The source text and long documentation of the above-specified function module (including the long documentation about the parameters) contain information about using search help exits.

Function modules are provided in the function library for operations that are frequently executed in search help exits. The names of these function modules begin with the prefix F4UT_. These function modules can either be used directly as search help exits or used within other search help exits. You can find precise instructions for use in the long documentation for the corresponding function module.

A search help exit is called repeatedly in connection with several

Events during the F4 process. The relevant step of the process is passed on in the CALLCONTROL step. If the module is intended to perform only a few modifications before the step, CALLCONTROL-STEP should remain unchanged.

However, if the step is performed completely by the module, the following step must be returned in CALLCONTROL-STEP.

For more detailed information please refer to the documentation describing the concept of the search help exit.

The module must react with an immediate EXIT to all steps that it does not know or does not want to handle.

Time Points :

During the input help process, a number of time points are defined that each define the beginning of an important operation of the input help process.

If the input help process is defined with a search help having a search help exit, this search help exit is called at each of these time points. If required, the search help exit can also influence the process and even determine that the process should be continued at a different time point.

The following time points are defined:

1. SELONE

Call before selecting an elementary search help. The possible elementary search helps are already in SHLP_TAB. This time point 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. You may not change the next time point.

The time point 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 time point 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 time point 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 time point with a search help exit. DISP should be set as the next time point.

5. DISP

Before displaying the hit list. This time point is suitable for restricting the values to be displayed, e.g. depending on authorizations.

6. RETURN (usually as return value for the next time point)

The RETURN time point 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 time point 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 time point if the input help is controlled by a collective search help. It directly follows the time point RETURN. The search help exit of the collective search help, however, is called at time point RETTOP.

8. EXIT (only for return as next time point)

The EXIT time point 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 time point 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 time points are introduced. They are accessed when the user presses the corresponding pushbutton.

Note: If the F4 help is controlled by a collective search help, the search help exit of the collective search help is called at time points SELONE and RETTOP. (RETTOP only if the user selects a value.) At all other time points the search help exit of the selected elementary search help is called.

If the F4 help is controlled by an elementary search help, time point RETTOP is not executed. The search help exit of the elementary search help is called at time point SELONE (at the moment). This search help exit should not do anything at this time point. Any preparatory work should be carried out at time point PRESEL1.

Steps for creating search help :

1. Run Transaction SE11

2. Give search help name

3. Click on Create

4. Make selection for Elementary or Collective search

Help

For Elementary Search Help

5. Elementary search Help screen.

6. Give short description.

7. Dialog type specifies the data display in the hit

list.

8. Give selection method

A] Search for database tables

B] Search for Views

9. Hot key specifies the letter or number displayed with every elementary search help.

10. Search help Exit: Specify the function module developed for the search of data for the elementary search help.

11. Search help parameter

A] Specify the input and output fields in the search help parameter column.

B] IMP column is input parameter for the search help.

C] EXP column is output parameter of the search help, to be displayed in the Hit list after selection.

D] LPos specifies the order in which fields are displayed in the hit list.

E] SPos specifies the order in which fields are displayed in the search help pop up screen.

F] Specify Data element in the field.

G] Specify the default value for any field required.

For Collective Search Help :

12. Search help exit: Specify the function module developed for the search of data for the elementary search help.

13. Search help parameter: Specify the import and export parameters.

14. Search help: Specify the elementary search help and the short text.

15. Parameter Assignment: Select the elementary search help and click on the parameter assignment. System proposes fields. User has to select the fields as per requirement, fields to be displayed in the output

hit list. Parameter assignment has to be done compulsorily for every elementary search help designed for the collective search help.

<b>Reward points if it helps.</b>