Search help in dialog modules

Hello gurus
I struck with a problem while designing the search help .  The problem is described as below
Three Screen field in my screen namely
Itab1-vkorg Itab1-kunnr Itab1-vbeln
My Screen flow logic :
PROCESS AFTER INPUT.
  MODULE USER_COMMAND_0100.
PROCESS ON VALUE-REQUEST.
  FIELD ITAB1-VBELN MODULE SALESINVOICE_HELP.
My main Program :SALESINVOICE_HELP
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      INPUT  = ITAB1-KUNNR
    IMPORTING
      OUTPUT = ITAB1-KUNNR.
  SELECT VBRKVBELN VBRKFKDAT
        INTO CORRESPONDING FIELDS OF TABLE INVOICE_SRCHLP
        FROM VBRK INNER JOIN VBRP ON VBRKVBELN EQ VBRPVBELN
        WHERE VBRK~FKART EQ 'ZF2' AND
              VBRK~VKORG EQ ITAB1-VKORG AND
              VBRK~KUNAG EQ ITAB1-KUNNR AND
              VBRK~FKSTO NE 'X'.
  SORT INVOICE_SRCHLP BY FKDAT VBELN.
  DELETE ADJACENT DUPLICATES FROM INVOICE_SRCHLP.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
   DDIC_STRUCTURE         = ' '
       RETFIELD             = 'VBELN'
     VALUE_ORG              = 'S'
    MULTIPLE_CHOICE        = ' '
    DISPLAY                = ' '
    CALLBACK_PROGRAM       = ' '
    CALLBACK_FORM          = ' '
    MARK_TAB               =
  IMPORTING
    USER_RESET             =
    TABLES
      VALUE_TAB              = INVOICE_SRCHLP
    FIELD_TAB              =
       RETURN_TAB             = ITAB_RETURN.
    DYNPFLD_MAPPING        =
  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.
  ITAB1-VBELN = ITAB_RETURN-FIELDVAL.
My problem is unable to retieve the screen fields contents. so kindly provide the solution.

Hi U have to append the field names u want to read.
Put this code before calling FM.
REFRESH dynpro_values[]. CLEAR dynpro_values.
dynpro_values-fieldname = Give ur screen field name u want to read.
APPEND dynp_fields.
Like this u have to append all the screen fields for which u want to read the data.
The finally Call FM.
After calling the FM read the table dynpro_values with key as field name. dynpro_values-FIELDVALUE contains the field content.
Check below sample code for your reference.
PARAMETERS: p_file   LIKE rlgrap-filename MEMORY ID upl.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  DATA: dynp_fields LIKE dynpread OCCURS 0 WITH HEADER LINE.
  REFRESH dynp_fields. CLEAR dynp_fields.
  dynp_fields-fieldname = 'P_FILE'.
  APPEND dynp_fields.
  CALL FUNCTION 'DYNP_VALUES_READ'
       EXPORTING
            dyname               = sy-cprog
            dynumb               = sy-dynnr
       TABLES
            dynpfields           = dynp_fields
       EXCEPTIONS
            invalid_abapworkarea = 1
            invalid_dynprofield  = 2
            invalid_dynproname   = 3
            invalid_dynpronummer = 4
            invalid_request      = 5
            no_fielddescription  = 6
            invalid_parameter    = 7
            undefind_error       = 8
            OTHERS               = 9.
Thanks,
Vinod.
Edited by: Vinod Reddy Vemuru on Jul 25, 2008 3:15 PM

Similar Messages

  • Search help in dialog program

    Hi all,
    Fora search help in dialog program.
    I HAVE TO GET SEARCH FOR A FIELD ZID ON APARTICULAR SCREEN BASED ON DATA, MODIFIED BY AND A PLANT..
    I HAVE A RECORD IN ONE MY ZTABLE.
    I HAVE TO GET THAT BY SEVERAL SEARCH PARAMETERS SAY BY DATE , MODIFIED BY,PLANT ETC.
    each user has been assigned a plant , so in search he has to get records belonging to that plant.
    so i cannot include plant in my search help, because user may type in other plant.
    so i tried two ways
    1) i created a search help in se11 including the plant field again the problem arises if the user types a different plant.
    so i want to know whether we can apassa value to plant field in search help(i.e the plant assigned to the user),
    i have this kind of thing in some standard t -code i.e especially for searching material , the plant field in search help was filled by one plant.
    this should be one of the solution
    2)I tried to write a code in pov of program code.
    this is how my code looks.
    DATA : BEGIN OF ITAB OCCURS 0.
         INCLUDE  STRUCTURE ZXXX.
    DATA : END OF ITAB.
    ITAB HAS FIELDS ID, DATE , MODIFIEDBY , PLANT.
    USER_PLANT = 'ABC'.
    SELECT * FROM ZXXX INTO TABLE ITAB WHERE PLANT = USER_PLANT.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
      DDIC_STRUCTURE         = ' '
        RETFIELD               = 'ZID'
      PVALKEY                = ' '
      DYNPPROG               = ' '
      DYNPNR                 = ' '
      DYNPROFIELD            = ' '
      STEPL                  = 0
        WINDOW_TITLE           = 'TEST'
      VALUE                  = ' '
        VALUE_ORG              = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
      TABLES
        VALUE_TAB              = ITAB
      FIELD_TAB              =
        RETURN_TAB             = IT_RETURN4
      DYNPFLD_MAPPING        =
    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.
    if sy-subrc = 0.
              clear itab.
              read table it_return4 index 1.
                ZXXX-ZID = it_return4-fieldval.
    endif.
    THIS WORKS FINE , BUT HE CANNOT SEARCH BASED ON DATE AND MODIFIEDBY
    ALL i want is is get a pop up window and should be able to search based on data and modifiedby for a predifined plant.
    I hope iam clear.
    Thanks

    Hi,
    Create a FM with the following code..The interface is defined in the code..
    In the Function module top include add the following code.
    <b>TYPE-POOLS: shlp, vrm.</b>
    IN this code I am deleting the records that are not of the currency USD...
    Do the same thing for your requirement...
    FUNCTION Y_SEARCH_HELP_EXIT.
    ""Local interface:
    *"  TABLES
    *"      SHLP_TAB TYPE  SHLP_DESCR_TAB_T
    *"      RECORD_TAB STRUCTURE  SEAHLPRES
    *"  CHANGING
    *"     REFERENCE(SHLP) TYPE  SHLP_DESCR_T
    *"     REFERENCE(CALLCONTROL) LIKE  DDSHF4CTRL STRUCTURE  DDSHF4CTRL
    where z_test is my z table..
    DATA: ITAB LIKE Z_TEST OCCURS 0 WITH HEADER LINE.
    ITAB[] = RECORD_TAB[].
    IF NOT RECORD_TAB[] IS INITIAL.
      DELETE ITAB WHERE WAERS <> 'USD'.
      RECORD_TAB[] = ITAB[].
    ENDIF.
    ENDFUNCTION.
    Thanks,
    Naren

  • Calling search helps dynamically in module pool program

    Hi Experts,
    I have created two search helps. I need to call these search helps in my module pool program dynamically for a single field (i.e ZMATNR).
    you might be known... if it is a single search help, we can assign that in field attributes.
    But here... I need to call different search helps for a single field based on the condition.
    Pls help me.
    Thanks
    Raghu

    Hi,
    Use the below function module and  pass the search help created in search help field according to the condition.
    Process on Value-request.
    if condition = A.
    call function " F4IF_FIELD_VALUE_REQUEST"
    TABNAME           =                                                         
    FIELDNAME        =                                                       
    SEARCHHELP     =  "Mention search help created                                                          
    Elseif  Conditon =B.
    call function " F4IF_FIELD_VALUE_REQUEST"
    TABNAME           =                                                         
    FIELDNAME        =                                                       
    SEARCHHELP     =  "Mention search help created      
    Endif.
    Regards,
    Prabhudas

  • CheckBox in search help restriction dialog.

    Hi Experts,
    I have created one search help with dialog value restrictions. Search help contains 6 fields.
    Out of which three fields has length one character(Data Element XFELD).
    As soon as user press on F4 on particular field, it will display pop-up window with restrictions and displayed 6 fields.
    I would like to show that fields(with Data Element as XFELD) as Check Box in search help restrictions pop-up window.
    Pls help... How can we do this.
    Thanks
    Vinod

    Hi,
    Kindly check the standard search help "F4TESTCHECKBOX".  Copy it and change the dialog type to 'Display with restrictions' . On execution,  you will notice that -
    i) On the restriction screen the checkbox is displayed as textbox .
    ii)  In list display , checkbox is displayed correctly .
    Follow Raymond's suggestion,
    You could define your own selection-screen, and display it in a search-help exit : if step = 'PRESEL', display your screen, modify selected values in table shlp-interface  and force next step as 'SELECT' to bypass standard selection-screen.
    Regards,
    DPM

  • Creating customized search helps in Dialog Programming

    Hello people I have a little predicament here. I need to create search help restricting the results.
    Like lets say I want to create a search help that select material numbers and name for a specific material group. Then use that as a seach help.
    Right now Im playing around with function module <b>HELP_VALUES_GET_WITH_TABLE</b> but it seems to open right when you access call screen.
    Also Since this is dialog programming I am using screen painter. And I need to assign the search help in an I/O Field.
    Well that's all for now take care guys. Take care to you all.

    Hi Chad,
    Is your problem been resolved .
    If not , just try this code
    Copy paste as it is and it will work .
    TYPES: BEGIN OF values,
             carrid TYPE spfli-carrid,
             connid TYPE spfli-connid,
           END OF values.
    DATA: carrier(3) TYPE c,
          connection(4) TYPE c.
    DATA: progname TYPE sy-repid,
          dynnum   TYPE sy-dynnr,
          dynpro_values TYPE TABLE OF dynpread,
          field_value LIKE LINE OF dynpro_values,
          values_tab TYPE TABLE OF values.
    CALL SCREEN 100.
    MODULE init OUTPUT.
      progname = sy-repid.
      dynnum   = sy-dynnr.
      CLEAR: field_value, dynpro_values.
      field_value-fieldname = 'CARRIER'.
      APPEND field_value TO dynpro_values.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE value_carrier INPUT.
      CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
           EXPORTING
                tabname     = 'DEMOF4HELP'
                fieldname   = 'CARRIER1'
                dynpprog    = progname
                dynpnr      = dynnum
                dynprofield = 'CARRIER'.
    ENDMODULE.
    MODULE value_connection INPUT.
      CALL FUNCTION 'DYNP_VALUES_READ'
           EXPORTING
                dyname             = progname
                dynumb             = dynnum
                translate_to_upper = 'X'
           TABLES
                dynpfields         = dynpro_values.
      READ TABLE dynpro_values INDEX 1 INTO field_value.
      SELECT  carrid connid
        FROM  spfli
        INTO  CORRESPONDING FIELDS OF TABLE values_tab
        WHERE carrid = field_value-fieldvalue.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield    = 'CONNID'
                dynpprog    = progname
                dynpnr      = dynnum
                dynprofield = 'CONNECTION'
                value_org   = 'S'
           TABLES
                value_tab   = values_tab.
    ENDMODULE.
    <b>For Screen 100 logic:
    Copy:</b>
    PROCESS BEFORE OUTPUT.
      MODULE INIT.
    PROCESS AFTER INPUT.
      MODULE CANCEL AT EXIT-COMMAND.
    PROCESS ON VALUE-REQUEST.
      FIELD CARRIER MODULE VALUE_CARRIER.
      FIELD CONNECTION MODULE VALUE_CONNECTION.
    <b>Do design the layout also.</b>
    I hope this will help you.
    If this satisfy  you then please close the thread by rewarding appropriate points to the helpful answers.
    Cheers
    Sunny
    Message was edited by: Sunny

  • Problem with respect to Search Help AND Dialog Progg

    Dear All,
                      I have a screen 0100, wherein Input-output field 'Veh_num' is created.
      Also there are another Input-output fields ( S_Date and S_time).
    Now end-user just displays records in screen when puts Veh_num(Vehicle number) in the field and clicks DISPLAY.
    Now problem arises when two Veh_NUM(Vehicle numbers) are present on same date but different on different time.
    i created a SEARCH HELP for the input-out field VEH_NUM(vehecle number).............where both records are displayed. But when user select any record of the two, always only a particular record is displayed on the screen.
    I Think the problem lies when User selects a row from the search help,  Only VEH_NUM gets transferred to the screen. I think If along with the Vehicle number, If S_time is also transferred then the problem will get solved.
    Search Help has 1 input(Veh_num).......and 3 Output fields( Veh_num, S_Date and S_time.).
    Pls suggest.
    Thanks in advance

    hi dsilva,
    Is ur Requirement is, that u need to select vehicle number and values corresponding to that
    number i,e Date and Time should get displayed on the screen?.
    Use Dictionary Fields if U Have, to define ur input/output fields
            OR.
    follow the below steps.
    1) First Check the serach help which u have created works as per ur requirement.
    2) The screen which u have designed has an input field(Vehicle Number).U may Have taken the
    field from Progarm or any other variable to define it.Don't do that.
    3) First Create a structure from SE11 and Define fields Vehicle Number and Date and Time.
    4) Assign Search help to the field Vehicle Number in the Structure.
    5) Use this Struture in your screen desigining.
    6) Then it automatically picks up the values and dislplays on the screen for a corresponding vehicle number.

  • Input Help in Dialog Modules

    HI,
    I have to provide F4 help for many fields that are present in tabstrip control(with 5 tabs). I had set the option "Possible entries" in the layout. In the flow logic, I created a module for POV. How would I get the screen element name (i.e., the field) from which F4 was pressed? While debugging, I dont get the field name in SYST and SCREEN table. For each tab, I am thinking of creating of only one module in POV so that I can avoid hardcoding the field name.
    You can use DEMO_DYNPRO_F4_HELP_MODULE report in IDES if required.

    Try this out it worked for me,
    Will post in in 3 halves.
    1.     First half
    MODULE help_zterm INPUT.  "In POV
      PERFORM help_zterm.
    ENDMODULE.                 " HELP_ZTERM  INPUT
    FORM help_zterm .
      DATA: BEGIN OF svbap OCCURS 12,
              tabix LIKE sy-tabix,
            END OF svbap.
      DATA:   BEGIN OF xvbap OCCURS 125.
              INCLUDE STRUCTURE vbapvb.
      DATA:   END OF xvbap.
      DATA: da_display LIKE ddrefstruc-bool.
      DATA: da_value LIKE vbkd-zterm.
      DATA: da_dynpro_program  LIKE sy-repid.
      DATA: da_dynpro_number   LIKE sy-dynnr.
      DATA: BEGIN OF dynpfield_zterm OCCURS 1.
              INCLUDE STRUCTURE dynpread.
      DATA: END OF dynpfield_zterm.
      da_dynpro_program  = sy-repid.
      da_dynpro_number   = sy-dynnr.
      CLEAR dynpfield_zterm.
      REFRESH dynpfield_zterm.
      MOVE 'ZDEALHD-ZTERM' TO dynpfield_zterm-fieldname.  u201DZDEALHD-ZTERM u2013 screen field name
      APPEND dynpfield_zterm.
      CALL FUNCTION 'DYNP_VALUES_READ'     
        EXPORTING
          dyname     = da_dynpro_program
          dynumb     = da_dynpro_number
        TABLES
          dynpfields = dynpfield_zterm
        EXCEPTIONS
          OTHERS     = 11.
      IF sy-subrc <> 0.
        EXIT.
      ELSE.
        READ TABLE dynpfield_zterm WITH KEY fieldname =
                                    dynpfield_zterm-fieldname.
      ENDIF.
      LOOP AT SCREEN.
        CHECK screen-name = 'ZDEALHD-ZTERM' AND
              screen-input = '0'.
       DA_DISPLAY = CHARX.
      ENDLOOP.
      IF dynpfield_zterm-fieldinp EQ space.
       DA_DISPLAY = CHARX.
      ENDIF.
    Call SD Sales BAdI
      DATA:  da_line    LIKE sy-tabix,
             da_core_inactive TYPE xfeld,
             wa_svbap LIKE svbap,
             wa_xvbap LIKE xvbap.
    Determining Cursor
      CLEAR wa_xvbap.
      GET CURSOR LINE da_line.
      IF da_line GE 1.
        READ TABLE svbap INTO wa_svbap INDEX da_line.
        IF sy-subrc = 0.
          READ TABLE xvbap INTO wa_xvbap INDEX wa_svbap-tabix.
        ENDIF.
      ENDIF.
    Will send the second one and third one  in few seconds.
    Edited by: Abhijit Borkar on Jan 7, 2010 9:11 AM

  • Getting values from screen to search help exit

    Hi Experts,
    I have created a search help in which I am not using selection method but search help exit. Dialog type is 'Dialog with value restriction'. My requirement is to get the values entered in restriction screen into search help exit. Please suggest a parameter which will hold this value in search help exit function module.

    Hi M,
    As you know there are 5 steps in search help exit. For each step, the values in parameter of your search help exit is different.
    For your requirement, you need process in step 'DISP', and get the selection value from 'SHLP-SELOPT'.
    Example:
    *Build range for customer number 
    LOOP AT shlp-selopt INTO ls_selopt WHERE shlpfield = 'KUNNR'.   
      lr_kunnr-sign = ls_selopt-sign.   
      lr_kunnr-option = ls_selopt-option.   
      lr_kunnr-low = ls_selopt-low.   
      lr_kunnr-high = ls_selopt-high.   
    APPEND lr_kunnr.   
    CLEAR: lr_kunnr. 
    ENDLOOP.
    Then using the lr_kunnr range in your select statement.
    regards,
    Archer

  • How to use search help in layout of se51

    how to use search help in layout of se51.

    Hi,
      One of the important features of screens is that they can provide users with lists of possible entries for a field. There are three techniques that you can use to create and display input help:
    Definition in the ABAP Dictionary
    In the ABAP Dictionary, you can link search helps to fields. When you create screen fields with reference to ABAP Dictionary fields, the corresponding search helps are then automatically available. If a field has no search help, the ABAP Dictionary still offers the contents of a check table, the fixed values of the underlying domain, or static calendar or clock help.
    Definition on a screen
    You can use the input checks of the screen flow logic, or link search helps from the ABAP Dictionary to individual screen fields.
    Definition in dialog modules
    You can call ABAP dialog modules in the POV event of the screen flow logic and program your own input help.
    These three techniques are listed in order of ascending priority. If you use more than one technique at the same time, the POV module calls override any definition on the screen, which, in turn, overrides the link from the ABAP Dictionary.
    However, the order of preference for these techniques should be the order listed above. You should, wherever possible, use a search help from the ABAP Dictionary, and only use dialog modules when there is really no alternative. In particular, you should consider using a search help exit to enhance a search help before writing your own dialog modules.
    Input help from ABAP dictoinary
    http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbaa5435c111d1829f0000e829fbfe/content.htm
    Field Help on the Screen
    http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbaa6135c111d1829f0000e829fbfe/content.htm
    Field Help in Dialog Modules.
    http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/content.htm
    Regards,
    Vara

  • Field values are repeating for search help.

    Hello Friends.
    I have a problem. When I create a search help for a field the identical field values are repeating. What should I do to trigger only the first time.
    for example:
    <u>Field-name</u>-                        <u>field-value</u>
    Supplier Nr ---                                 Commodity
    5001 -
                                               casting
    5002 -
                                               casting
    5003 -
                                               casting
    So when I create the search help for commodity it is showing 'casting' 3 times in a pop-up window. It should not repeat. Can you please give me the solution what should I do?

    Hi
    Search helps
    Standard search help
    Types of search helps
    Concept of search help
    Search Help Interface
    Dialog behavior of search helps
    Selection method for search helps
    Performance of search helps
    Attaching search helps
    Hierarchy of search helps
    Standard Search Help
    The input help (F4 help) is a standard function of the R/3 System. It permits the user to display a list of possible values for a screen field. A value can be directly copied to an input field by list selection.
    The fields having an input help are shown in the R/3 System by the input help key to the right of the field. This key appears as soon as the cursor is positioned on the corresponding screen field. The help can be started either by clicking on this screen element or with function key F4.
    If the number of possible entries for a field is very large, you can limit the set of displayed values by entering further restrictions.
    Further meaningful information about the displayed values is included in the display of possible entries, especially if the field requires that a formal key be entered.
    TYPES OF SEARCH HELPS
    Elementary 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).
    Collective search help
    Combine several elementary search helps. A collective search help thus can offer several alternative search paths.
    Search Help Interface
    Search help interface determines how the exchange of values between the screen template and the selection method is implemented.
    The search help interface defines the context data that can be used in the input help and the data that can be returned to the input mask. Analogously to the interface of a function module, the search help interface comprises interface parameters.
    When you define an interface 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 it should be used to return data from the input help (EXPORT parameter). A parameter of a search help can also have both attributes at the same time.
    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 help itself should always be attached to an EXPORT parameter of the search help. If this parameter is also the IMPORT parameter, its contents are only used in the input help if it is a search string (that is, if it contains a ´*´ or a ´+´).
    You must define the parameter types of a search help. You can do this by assigning them data elements.
    Value Transport for Input Helps
    NOTE:In the above example, screen fields A, B and C are linked with parameters of the search help. As a result, values can only be transported between the screen and the search help for these three fields. Existing contents of screen fields A and B can be used for selecting the hit list since they are linked with an import parameter of the search help. The values of parameters A and C can be returned to the screen from the hit list since these parameters are declared as export parameters of the search help.
    Description of dialog behavior
    A hit list might contain plentiful number of entries. A
    dialog provides the user with an option to restrict the
    entries displayed on the hit list.
    In an input help process, the set of possible entries is presented in the dialog box as a list for displaying the hit list. The user selects the required value from this list by double clicking. Since the possible entries are often formal keys, you must be able to display further explanatory information about the possible entries in the list.
    If the set of possible entries is very large, the user should be able to define additional conditions for the attributes of the selected 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.
    Specifying the dialog type of a search help defines whether the dialog box for restricting values should be offered and if so under what conditions.
    The attributes in the dialog box for displaying the hit list or in the dialog box for restricting values must be defined as internal parameters of the search help. An internal parameter can also be used in only one of the two dialog boxes. It can also belong to the search help interface.
    The internal parameter types are also defined with data elements. These data elements define how the parameters are displayed in the two dialog boxes.
    Reward if usefull

  • How to do program for search help

    Hi,
    Please tell me how to do the program for search help in Dialog programming.
    Thanks,
    Sriram.

    Step 1:
    Create a function module (ZZ_TEST_FUNCTION).
    Step 2:
    --> Create a search help(ZSEARCH)
    --> Enter the above function Module(ZZ_TEST_FUNCTION) in search help exit field.
    STEP 3:
    Attach the search help with any field of table.
    Function module Sample Code:
    FUNCTION ZZ_TEST_FUNCTION.               
    ""Local interface:                    
    *"       IMPORTING                 
    *"             VALUE(MCONAME) DEFAULT SPACE *"             VALUE(SELSTR) DEFAULT SPACE
    *"       TABLES                      
    *"              SHLP_TAB TYPE  SHLP_DESCR_TAB_T
    *"              RECORD_TAB STRUCTURE  SEAHLPRES
    *"       CHANGING                   
    *"             VALUE(SHLP) TYPE  SHLP_DESCR_T *"             VALUE(CALLCONTROL) LIKE  DDSHF4CTRL 
    *"                             STRUCTURE  DDSHF4CTRL
    CALL SCREEN 100.
    Return from application back to SAP                   
      CASE save_ok_0100.                                    
        WHEN 'RSTR'.                                        
          callcontrol-step = 'SELONE2'.                     
        WHEN 'CANCEL' OR 'BACK' OR 'EXIT'.                  
          callcontrol-step = 'EXIT'.                        
        WHEN 'SEL'.                                         
            READ TABLE itab.                 
            record_tab = itab-filed1.           
            APPEND record_tab.                              
            callcontrol-step     = 'RETURN'.                
           EXIT.                                           
          ENDIF.                                            
      ENDCASE.                                              
    ENDFUNCTION.

  • How to assign a search help

    Hi
      How to assign a search help for the particular field
    in any screen.
    By
    Prashanth

    Hi,
    **How to assign a search help for the particular field
    in any screen.
    -  insert the event PROCESS ON-VALUE-REQUEST in the program and add a field statement for the field that should trigger the F4 help. In the mdoule called from <b>PROCESS ON-VALUE-REQUEST</b>, call function module
    F4IF_FIELD_VALUE_REQUEST.
    <b>Samples code:</b>
    PROCESS ON VALUE-REQUEST.
    FIELD it_zsd00003-prctr MODULE f4_help_for_pctr.
    MODULE f4_help_for_pctr INPUT.
    CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
    EXPORTING
    tabname = 'ZSD00003'
    fieldname = 'PRCTR'
    SEARCHHELP = ' '
    SHLPPARAM = ' '
    dynpprog = 'ZSD00002_BRUGERKONV_LISTE'
    dynpnr = '0100'
    dynprofield = 'IT_ZSD00003-PRCTR'
    STEPL = 0
    value = '50*'
    MULTIPLE_CHOICE = ' '
    DISPLAY = ' '
    SUPPRESS_RECORDLIST = ' '
    CALLBACK_PROGRAM = ' '
    CALLBACK_FORM = ' '
    TABLES
    RETURN_TAB =
    EXCEPTIONS
    FIELD_NOT_FOUND = 1
    NO_HELP_FOR_FIELD = 2
    INCONSISTENT_HELP = 3
    NO_VALUES_FOUND = 4
    OTHERS = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    There is <b>on more example with code</b> , just copy and paste the code and design the screen and you will be able to find ur search help.
    Find the code:
    Re: Creating customized search helps in Dialog Programming
    Hope this will help you.
    Cheers
    Sunny
    Rewrd points, if found helpful

  • Hi, tell me abt creation of search helps in detail

    hi, tell me abt creation of search helps in detail

    Hi
    Search helps
    Standard search help
    Types of search helps
    Concept of search help
    Search Help Interface
    Dialog behavior of search helps
    Selection method for search helps
    Performance of search helps
    Attaching search helps
    Hierarchy of search helps
    Standard Search Help
    The input help (F4 help) is a standard function of the R/3 System. It permits the user to display a list of possible values for a screen field. A value can be directly copied to an input field by list selection.
    The fields having an input help are shown in the R/3 System by the input help key to the right of the field. This key appears as soon as the cursor is positioned on the corresponding screen field. The help can be started either by clicking on this screen element or with function key F4.
    If the number of possible entries for a field is very large, you can limit the set of displayed values by entering further restrictions.
    Further meaningful information about the displayed values is included in the display of possible entries, especially if the field requires that a formal key be entered.
    TYPES OF SEARCH HELPS
    Elementary 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).
    Collective search help
    Combine several elementary search helps. A collective search help thus can offer several alternative search paths.
    Context data: You first have to define the context data to be used in the input help process. The context contains the information obtained in previous dialog steps and the entries already made by the user in the current input mask. This information is normally used to restrict the possible values for the current input field.
    Dialog behavior: It describes the order of the dialog windows to be displayed during the input help and what they should look like.
    Data collection method: It defines where the values offered to the user for selection come from.
    Return values: When a value is selected from the list of possible entries, it is stored in the search field. This often results in the contents of further screen fields, such as explanatory text, being updated. You therefore should define which values can be returned to the screen.
    In addition to describing an input help, you must define the fields for which it should be used. This is part of the field definition (of the search fields).
    In Release 4.0, the search help was introduced in the ABAP Dictionary as a new object type. A search help is an object that describes the input help process. The individual components of such a description can be defined with attributes of the search help.
    Search helps are subject to the same rules concerning their maintenance, activation and transport as all other objects of the ABAP Dictionary.
    Search helps provide greater flexibility and functionality for defining input helps than the matchcode and help view object types offered up to Release 3.x.
    Search Help Interface
    Search help interface determines how the exchange of values between the screen template and the selection method is implemented.
    The search help interface defines the context data that can be used in the input help and the data that can be returned to the input mask. Analogously to the interface of a function module, the search help interface comprises interface parameters.
    When you define an interface 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 it should be used to return data from the input help (EXPORT parameter). A parameter of a search help can also have both attributes at the same time.
    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 help itself should always be attached to an EXPORT parameter of the search help. If this parameter is also the IMPORT parameter, its contents are only used in the input help if it is a search string (that is, if it contains a ´*´ or a ´+´).
    You must define the parameter types of a search help. You can do this by assigning them data elements.
    Value Transport for Input Helps
    NOTE:In the above example, screen fields A, B and C are linked with parameters of the search help. As a result, values can only be transported between the screen and the search help for these three fields. Existing contents of screen fields A and B can be used for selecting the hit list since they are linked with an import parameter of the search help. The values of parameters A and C can be returned to the screen from the hit list since these parameters are declared as export parameters of the search help.
    creation of Elementary Search Help
    Enter the search help name and click on create.
    Choose elementary search help radio button option as the search help type.
    Enter the search help parameters, the selection method and activate the search help.
    Collective Search Help steps
    Enter the search help name and click on create.
    Choose Collective search help radio button option as the search help type.
    Enter the search help parameters.
    Note that there is no selection method to be entered for a collective search help.
    Instead of the selection method, we enter the included
    search helps for the collective search help.
    We need to assign parameters for each of the included
    search helps.
    Complete the parameter assignment by clicking on the push button
    Collective search help offers the user to obtain F4 help
    using any of the included search helps.
    Attaching a search help to a field
    A search help can influence the behavior of a field when the input help is called. The search help must be assigned to the field in order to do this. You have the following options for this assignment:
    Attach search help to a data element / table or structure field / screen field / check table.
    Conventionally search helps are attached to table fields or data elements. We shall see the same.
    Attaching a search help to a screen element
    A search help can be directly assigned to a screen field in two ways.
    The name of the search help must be entered in the Screen Painter in the Attributes for the field in the field Search help.
    The name of the search help can be defined for selection screens in ABAP reports in the PARAMETERS or SELECT-OPTIONS statement directly following the supplement MATCHCODE OBJECT.
    However, input help is only available for this particular screen.
    In this case, the search help is only available for this screen.
    OR by useing FM
    refer this code
    TYPES : BEGIN OF ST_OBJID_SH,
    OTYPE TYPE HRP1000-OTYPE,
    OBJID TYPE HRP1000-OBJID,
    END OF ST_OBJID_SH.
    DATA : IT_OBJID_SH TYPE STANDARD TABLE OF ST_OBJID_SH.
    DATA : WA_OBJID_SH TYPE ST_OBJID_SH.
    ***********SELECTION SCREEN DESIGN***********************
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    *SELECT-OPTIONS : S_OTYPE FOR HRP1001-OTYPE NO INTERVALS .
    SELECT-OPTIONS : S_OBJID FOR HRP1001-OBJID NO INTERVALS .
    SELECT-OPTIONS : DATE FOR SY-DATUM NO-EXTENSION OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    **********END OF SELECTION SCREEN DESIGN*****************
    *********VALIDATION FOR SCREEN FIELDS********************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_OBJID-LOW.
    IF S_OBJID IS NOT INITIAL.
    SELECT OTYPE OBJID FROM HRP1000
    INTO TABLE IT_OBJID_SH
    WHERE OTYPE = 'D'.
    IF SY-SUBRC EQ 0.
    SEARCH HELP FOR QUALIFICATION.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    DDIC_STRUCTURE = ' '
    RETFIELD = 'OBJID'
    PVALKEY = ' '
    DYNPPROG = SY-REPID
    DYNPNR = SY-DYNNR
    DYNPROFIELD = 'S_OBJID'
    STEPL = 0
    WINDOW_TITLE =
    VALUE = ' '
    VALUE_ORG = 'S'
    MULTIPLE_CHOICE = ' '
    DISPLAY = ' '
    CALLBACK_PROGRAM = ' '
    CALLBACK_FORM = ' '
    MARK_TAB =
    IMPORTING
    USER_RESET =
    TABLES
    VALUE_TAB = IT_OBJID_SH
    FIELD_TAB =
    RETURN_TAB = RETURN_TAB
    DYNPFLD_MAPPING =
    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.
    ENDIF.
    Elementary 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).
    Collective search help Combine several elementary search helps. A collective search help thus can offer several alternative search paths.
    steps
    Elementary Search Help
    1) Goto SE11
    Enter the search help name and click on create.
    2)Choose elementary search help radio button option as the search help type.
    3)Enter the search help parameters, the selection method and activate the search help.
    Collective Search Help
    1)Enter the search help name and click on create.
    2)Choose Collective search help radio button option as the search help type.
    3)Enter the search help parameters.
    Note that there is no selection method to be entered for a collective search help.
    4)Instead of the selection method, we enter the included
    search helps for the collective search help.
    5)We need to assign parameters for each of the included
    search helps.
    6)Complete the parameter assignment by clicking on the push button
    7)Collective search help offers the user to obtain F4 help
    using any of the included search helps.
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee2b446011d189700000e8322d00/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee5f446011d189700000e8322d00/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee86446011d189700000e8322d00/content.htm

  • Search help how to restrict number of hits.

    Hi,
    I have created a search help in SE11, the search help reads a table view and the search help is connected to
    exit HRMC_PREM_EXIT_A in HR. Everything works fine except for that I want to restrict the number of hits to 500, I don't want to get a result of 5000 hits because that search takes too long time.
    Br Benita

    Hello Benita
    Set the dialog type of your search help = 'A' (dialog depends on set of values).
    Regards
      Uwe

  • How to limit results in search help CV01 (incl. COM_SE_F4_HELP_EXIT)

    Hi experts,
    in transaction CV03N I want to limit the result list (table RECORD_TAB) of the search help CV01 using authority check. The user should not even see the document shorttext (from table DRAT) of some TOP SECRET documents in the F4-help result ... Actual solution: no user has rights for CV03N ... :-P
    I found out, that the search help for the dynpro field DRAW-DOKNR is CV01,
    including following search helps:
    CV01T
    CV01O
    CV01C
    CV01B
    CV_TREX
    Also there is a search help exit (function modul) COM_SE_F4_HELP_EXIT for CV01.
    I tried to enhance the search help exit using the prepared BADI COM_SE_F4_RESULT_ITEMS, but after i did a short test with the relevant method, i found that there is something not working as i expected ...
    Problem:
    in the function modul COM_SE_F4_HELP_EXIT there is a step prepared called STEP SELECT.
    * 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'.                 "here i put Session BREAK-POINT
        PERFORM STEP_SELECT
                  TABLES   SHLP_TAB
                           RECORD_TAB
                  CHANGING SHLP
                           CALLCONTROL.
    *                                      Don't process additional STEP. ..
        RETURN.
      ENDIF.
    But after i put a BREAK-POINT and than start CV03N, searching a document via F4 + press ENTER, no debugging (!).
    I have to mention that the search help proceeded was CV01T.
    Question:
    can anyone explain why STEP SELECT is not proceeded in FM COM_SE_F4_HELP_EXIT using F4-help in transaction CV03N?
    I appreciate any hint in my "search help combat"
    regards
    Jörg
    Edited by: Thomas Zloch on Apr 26, 2011 10:11 PM - please do not promise "re-ward"

    INCLUDE with FORM
    ***INCLUDE LZCV_SHLPF01 .
    * nach dem Muster der Suchhilfe SAPBC_GLOBAL_F4_SFLIGHT
    * ausführlich Doku siehe dort und in den einz. incl. FB Dokus
    *&      Form  AUTHORITY_CHECK
    *       text
    *      -->P_RECORD_TAB  text
    *      -->P_SHLP_TAB  text
    *      <--P_SHLP  text
    *      <--P_CALLCONTROL  text
    FORM authority_check
           TABLES   shlp_tab    TYPE      shlp_desct            "#EC NEEDED
                    record_tab  STRUCTURE seahlpres
           CHANGING shlp        TYPE      shlp_descr
                    callcontrol TYPE      ddshf4ctrl.
    * Ablauf:
    * 1. GET Inhalte der Suchilfe Parameter (siehe SE11, CV01T)
    * 2. Feldinhalte in interner Tabelle anpassen (--> no Authority)
    * 3. PUT neue Inhalte der Suchhilfe Parameter an Ergebisliste übergeben
    * Teil 1
    * ¯¯¯¯¯¯
      CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET'   "Inhalte Parameter DOKAR holen
        EXPORTING
          parameter               = 'DOKAR'                     "CV01T
          fieldname               = 'DOKAR'  "it_drat
        TABLES
          shlp_tab                = shlp_tab
          record_tab              = record_tab
          results_tab             = it_drat
        CHANGING
          shlp                    = shlp
          callcontrol             = callcontrol.
      CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET'   "Inhalte Parameter DKTXT holen
        EXPORTING
          parameter               = 'DKTXT'                     "CV01T
          fieldname               = 'DKTXT'  "it_drat
        TABLES
          shlp_tab                = shlp_tab
          record_tab              = record_tab
          results_tab             = it_drat
        CHANGING
          shlp                    = shlp
          callcontrol             = callcontrol.
    * Teil 2
    * ¯¯¯¯¯¯
      LOOP AT it_drat.
        AUTHORITY-CHECK                             " here prepare the change of Paramaters
                 OBJECT 'C_DRAW_DOK'
                     ID 'DOKAR'
                  FIELD it_drat-dokar.
        IF sy-subrc NE 0.
          it_drat-dktxt = text-001.
    *     [!]Text ausgeblendet...Auth.Check(DOKAR)
          MODIFY it_drat.
        ENDIF.
      ENDLOOP.
    * Teil 3
    * ¯¯¯¯¯¯
      CALL FUNCTION 'F4UT_PARAMETER_RESULTS_PUT'
        EXPORTING
          parameter               = 'DKTXT'                     "CV01T
          fieldname               = 'DKTXT'  "it_drat
        TABLES
          shlp_tab                = shlp_tab
          record_tab              = record_tab
          source_tab              = it_drat
        CHANGING
          shlp                    = shlp
          callcontrol             = callcontrol
    *     EXCEPTIONS
    *       PARAMETER_UNKNOWN       = 1
    *       OTHERS                  = 2
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " AUTHORITY_CHECK

Maybe you are looking for