Validate values while displaying search help records

Hi Experts,
I have created one serach help. This search help was using by so many programs.
Based on the material type I need to restrict some values while displaying search help.
Suppose search help contain three rows.
Material type   ---   Material   --- Material Desc
A1                    ---    12345       --- XXXXXXXXXXX
A2                    ---    4586         --- XXXXXXXXXXX
A3                    ---     2345       ---  XXXXXXXXXXX
A1                     ---    852        ---  XXXXXXXXXXXX
In my module pool program, I need to display A2 and A3 material type records only.
How can we acheive this?
I checked search help exit by creating new. none of the table contains those records. What code I need to write in search help exit?.
Pls help me.
Thanks in advance
Raghu

Hi check[ My wiki|https://wiki.sdn.sap.com/wiki/x/du0] for the code

Similar Messages

  • How to add Value Table or Search Help for a field which is on Standard SAP?

    Hi All,
        I have a field HERST (tcode IE01) which doesnt have any value table or search Help. I have the same field in a Z table which I should display for the standard screen field in tcode IE01. So Pls suggest me on this.
        Thanks in advance.
    Regards
    Jaker.

    Hi, Tamas,
    I found the reason. The function Z_WEBRFC_READ_DATA_SH had a string concatenation error.
    CONCATENATE '{"results":[{"key": "shlpname", "value": "' l_shlp '"},"key": "fieldname", "value": "' l_field '"}]}' INTO htmldoc-line.
    The correct code is like:
    CONCATENATE '{"results":[{"key": "shlpname", "value": "' l_shlp '"},{"key": "fieldname", "value": "' l_field '"}]}' INTO htmldoc-line.
    Another question is, I can't get any words in Chinese from WebRFC. It returns error when I try it. How can I configure it?
    Xin

  • Selecting multiple values from a search help

    Hi Experts
    Anyone knows if it is possible to select multiple values from a search help?
    Thanks
    Gaurav

    Hi,
    You cannot select mutiple values from search help as it is linked to inputfield and hence it will accept single value only. But at the same time, you may able to pass row of values to different inputfields.
    Refer http://help.sap.com/saphelp_dm40/helpdata/en/3d/e53642e2a3ab04e10000000a1550b0/content.htm
    Thanks,
    Chandra

  • How Can I get multi column values from dynamic search help?

    Hi Gurus;
    I'm using dynamic search help in my program.
    I want to get multi column values from search help. But I dont know solution for this issue.
    I'm using F4IF_INT_TABLE_VALUE_REQUEST FM.
    How Can I get multi column values from dynamic search help?
    Thanks.

    Believe it or not, the same FM worked for me in a dynpro. I will try to explain here how it works in custom screen and then you can do your work for other screens or program types. I am not going to write my actual work but will explain in general.
    I have 4 fields (FLD1, FLD2, FLD3, FLD4) and i made the search based on FLD2 and when user click on a line (could be any field), then this would bring the line on to the screens.
    There are like 3 steps.
    You have your value_tab for my fields FLD1, FLD2, FLD3 and FLD4. This is just the data that we pass into the FM. (data: IT_VALTAB type table of ZVAL_TABLE)
    Next map the screen fields into an internal table (data: It_dynpfld type table of dselc ). I also have other internal tables defined  (just to keep it straight, i will be putting here) data:  It_return type standard table of ddshretval.
    Next step is to call the function module. Make sure you have values in IT_VALTAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
            retfield        = 'FLD2'
            value_org       = 'S'
          tables
            value_tab       = It_VALTAB
            return_tab      = It_return
            dynpfld_mapping = It_dynpfld
          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.
        else.
          perform get_selected_fields tables It_return.
        endif.
    The code within the perform GET_SELECTED_FIELDS  - We need to map the result fields after user selects it. The code goes like this. This is step is to update the dynpro fields.
    I need a internal table as well as a work area here. like,
    data: lt_fields type table of dynpread,
            la_fields type dynpread.
      field-symbols: <fs_return> type ddshretval.
    so fill out LT_FIELDS from the IT_RETURN table
    loop at lt_return assigning <fs_return>.
        la_fields-fieldname = <fs_return>-retfield.
        la_fields-fieldvalue = <fs_return>-fieldval.
        append la_fields to lt_fields.
        clear: la_fields.
      endloop.
    Call the FM to update the dynpro
    call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname               = sy-repid
          dynumb               = '1002' "This is my screen number. You could use 1000 for selection screen (hope so)
        tables
          dynpfields           = lt_fields
        exceptions
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          others               = 8.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    good luck

  • Process On Value Request with Search Help Problem

    I have a screen with a field that has a custom search help attached to it.  I am using Process On Value-Request which ultimately uses function module F4IF_FIELD_VALUE_REQUEST to return the selected value from the search help. The value is then moved to the screen field.
    THE PROBLEM: If I enter a value in a field on the screen, then use the search help from a different field the first value I entered gets cleared. Here is a code sample. Any suggestions as to why this is happening?
    NOTE: The values that get cleared are fields on the screen that I do not reference at all in user_command_2501.
    *****SCREEN 2500 FLOW LOGIC*********
    PROCESS BEFORE OUTPUT.
      MODULE status_2500.
    PROCESS AFTER INPUT.
      MODULE user_command_2500.
    PROCESS ON VALUE-REQUEST.
      FIELD makt-matnr MODULE user_command_2501.
    MODULE user_command_2501 INPUT.
      ok_code = sy-ucomm.
      CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
           EXPORTING
                searchhelp      = 'ZWS_ASSETMATR'
                fieldname       = ' '
                tabname         = ' '
           TABLES
                return_tab      = search_itab
           EXCEPTIONS
                no_values_found = 1.
      MOVE search_itab-fieldval TO: makt-matnr.
      REFRESH search_itab.
      SELECT SINGLE maktg FROM makt INTO crea_description
        WHERE matnr = search_itab-fieldval.
      MOVE 'I' TO scrn_attr_sw.
      sy-ucomm = 'ENTER'.
      LEAVE SCREEN.
      CALL SCREEN 2500.
    ENDMODULE.                 " user_command_2501  INPUT
    Message was edited by: Jason DeLuca
    Message was edited by: Jason DeLuca

    Hi Jason
    It seems you should first revise your code since your POV is not implemented so good.
    Regards
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • Error while creating search help

    Hi,
    I am getting an error "Elementary search help without hit list is meaningless" while creating a search help,.what could be the problem?
    Thanks,
    Rakesh.

    Elementary search help without hit list is meaningless
    Diagnosis
    The flag that they should appear in the hit list is not set for any of the parameters in the elementary search help in question. An elementary search help without a hit list is meaningless because it is not possible to select a value from the set of possible values in the input help process which it describes.
    System Response
    The action is terminated abnormally.
    Procedure
    In the maintenance screen for the search help, assign at least one parameter a position in the hit list.

  • Default multiple values in custom search help

    Hi All,
    I created a custom search help for the vendor. The fields in the search help are LIFNR (Vendor) and KTOKK (Account Group).
    I would like to be able to set three default values for the account group. That is, when the user clicks on the dropdown to display the search help, I would like to have three values populated in the KTOKK field. Is this possible?
    Any help would be appreciated.
    Thanks!

    Hi,
    I am not sure abt default values, but if you are using this search help in any report than you can set hot keys in your search help and using hot keys, you can set some default filter values in you report's parameter.
    you can set variant in your report where parameter is having values like :: =,<hotkey>,<sel1>,<sel2>
    here <hotkey> : wht you have assingned in search help.
           <sel1>    : one of those default values you want to display.
           <sel2>    : one of those default values you want to display for the second field.
    hope it helps,
    Regards,
    Sagar

  • How to get the short text values from F4 SEARCH HELP

    Hi Friends,
       My requirement is in  Module -pool Screen Programming,  i have Designed one field in a custom screen and  provided a F4 search help to that field..
    For eg the F4 help is displayed as below.
    Value                   short text
      1                    A          
      2                              B
      3                       C
      4                              D
      5                       E
      6                       F
      7                          G
    When i select the first option (1) then value 1 appears in the field.
    now i want the text relevant to the value 1 to appear by the side of the field.
    Eg :            1                  A      (A should appear by the side of the value 1)
    How do i achieve it?
    Kindly help me.
    Regards,
    K.S.Kannan.
    Edited by: kannan ks on Dec 8, 2008 4:05 PM

    hi
    1) place a field adjacent to your value field on which F4 is operated
    so now you will have 2 fields.
    iam considering it as for ex: field1 & field2
    2)
    BOLD one is import in FM call
    CLEAR: t_dynpfld_mapping,
    e_dynpfld_mapping.
    e_dynpfld_mapping-fldname = 'F0001'.           
    e_dynpfld_mapping-dyfldname =      -
    > name of field1  (for ex: your 1 value field name)
    APPEND e_dynpfld_mapping TO t_dynpfld_mapping.
    e_dynpfld_mapping-fldname = 'F0002'.
    e_dynpfld_mapping-dyfldname =   -
    > name of field2  (for ex: your short text field name)
    APPEND e_dynpfld_mapping TO t_dynpfld_mapping.
    3))))))))
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield =    
    dynpprog = sy-repid
    dynpnr = sy-dynnr
    dynprofield = -
    > name of field1  (for ex: your 1 value field name)
    value_org = 'S'
    TABLES
    value_tab = itab
    dynpfld_mapping = t_dynpfld_mapping
    EXCEPTIONS
    PARAMETER_ERROR = 1
    NO_VALUES_FOUND = 2
    OTHERS = 3

  • Value table as search help

    Hi Experts,
    I am new to WebDynpro ABAP.
    I want to assign a search help to one of the UI elements in WebDynpro ABAP component.
    The search help is attached as a value table in a domain LAND1.
    Now while creating an attribute i am creating it from a data element which is attached to this domain.
    Still i can not see the value help being shown.
    May be i am missing something.
    Can you please help me to find out what am i missing?
    Regards,
    Ashish Shah

    Hi  Ashish,
    For getting a search help for the drop down by key UI element, here i am mentioning the logic using the flight demo.
    1.Add attribute PLANETYPE to the context of the component controller.
    Locate the Component Controller node in the project structure that is located immediately under the component. Double click on Component Controller to open the Custom Controller editor.
    - Add attribute PLANETYPE to context node FLIGHTINFO
    Hint: Select Create Using Wizard -> Attributes form Components of Structure from context menu of node FLIGHTINFO.
    2.Navigate to the Context tab of view controller Iof your view. Choose Update Mapping from the context menu of node FLIGHTINFO to add the attribute PLANETYPE.
    3.Add Label and DropDownByKey for PLANETYPE to the layout of ur view.
    Go to tab Layout and add a label named PLANETYPE_LABEL_1 and a DropDownByKey named PLANETYPE_DROPDOWN_1 to group GROUP_1. The two new elements should be placed between the input field for the Date and the button. Bind the DropDownByKey to the context attribute PLANETYPE.
    4..Adjust component controller method FLIGHTTAB_FILL
    Navigate to the Methods tab of the component controller and double-click on the method FLIGHTTAB_FILL to open the editor.
    Adjust the method:
    - Get also the context value for PLANETYPE
    - Use PLANETYPE also in the where clause of the select statement
    METHOD flighttab_fill .
      DATA:
        cond(72)                            TYPE c,                                    
        itab_where                          LIKE TABLE OF cond,                        
        context_node                        TYPE REF TO if_wd_context_node,
        elem_flightinfo                     TYPE REF TO if_wd_context_element,
        stru_flightinfo                     TYPE if_componentcontroller=>element_flightinfo ,
        item_carrid                         LIKE stru_flightinfo-carrid,
        item_connid                         LIKE stru_flightinfo-connid,
        item_fldate                         like stru_flightinfo-fldate,
        item_planetype                      like stru_flightinfo-fldate,
        itab_flighttab                      TYPE if_componentcontroller=>elements_flighttab.
    navigate to <FLIGHTINFO>
      context_node = wd_context->get_child_node( name = `FLIGHTINFO` ).
    get element at lead selection
      elem_flightinfo = context_node->get_element(  ).
    get connid
      elem_flightinfo->get_attribute(
        EXPORTING
          name =  `CARRID`
        IMPORTING
          value = item_carrid ).
    get carrid
      elem_flightinfo->get_attribute(
        EXPORTING
          name =  `CONNID`
        IMPORTING
          value = item_connid ).
    get fldate
      elem_flightinfo->get_attribute(
        EXPORTING
          name =  `FLDATE`
        IMPORTING
          value = item_fldate ).
    get planetype
      elem_flightinfo->get_attribute(
        EXPORTING
          name =  `PLANETYPE`
        IMPORTING
          value = item_planetype ).
    create where condition
      IF NOT item_carrid EQ ''.
        CONCATENATE 'CARRID = ''' item_carrid '''' INTO cond.
        APPEND cond TO itab_where.
      ENDIF.
      IF NOT item_connid EQ '0000'.
        CONCATENATE 'CONNID = ''' item_connid '''' INTO cond.
        IF item_carrid NE ''.
          CONCATENATE 'AND' cond INTO cond separated by space.
        ENDIF.
        APPEND cond TO itab_where.
      ENDIF.
      IF NOT item_fldate is initial.
        CONCATENATE 'FLDATE = ''' item_fldate '''' INTO cond.
        IF not itab_where is initial.
          CONCATENATE 'AND' cond INTO cond separated by space.
        ENDIF.
        APPEND cond TO itab_where.
      ENDIF.
      IF NOT item_planetype eq ''.
        CONCATENATE 'PLANETYPE = ''' item_planetype '''' INTO cond.
        IF not itab_where is initial.
          CONCATENATE 'AND' cond INTO cond separated by space.
        ENDIF.
        APPEND cond TO itab_where.
      ENDIF.
    read data
      IF itab_where IS NOT INITIAL.
        SELECT * FROM sflight
          INTO CORRESPONDING FIELDS OF TABLE itab_flighttab
          WHERE (itab_where).
      ELSE.
        SELECT * FROM sflight
          INTO CORRESPONDING FIELDS OF TABLE itab_flighttab.
      ENDIF.
    navigate to <FLIGHTTAB>
      context_node = wd_context->get_child_node( name = `FLIGHTTAB` ).
    Bind table to context node <FLIGHTTAB>
      CALL METHOD context_node->bind_table
        EXPORTING
          new_items = itab_flighttab.
    ENDMETHOD.
    5.Navigate to the Methods tab of the ur view and create a new method with the name VS_PLANETYPE. Double-click on the name of the newly created method to navigate in the editor.
    Add coding for:
    -     Get nodeinfo for node FLIGHTINFO
    -     Build the value set table. Create the following entries:
    Key     Value
    747-400     747-400
    A310-300     A310-300
    A319     A319
    DC-10-10     DC-10-10
    -     Set the values to context attribute PLANETYPE of node FLIGHTINFO
    method VS_PLANETYPE .
    data:
      lr_node_flightinfo type ref to if_wd_context_node,
      lr_nodeinfo_flightinfo type ref to if_wd_context_node_info,
      lt_value_set       type wdy_key_value_table,
      ls_value_set       type wdy_key_value.
    get nodeinfo of node flightinfo
      lr_node_flightinfo = wd_context->get_child_node( name = `FLIGHTINFO` ).
      lr_nodeinfo_flightinfo = lr_node_flightinfo->get_node_info( ).
    fill values into value set table
      ls_value_set-key   = '747-400'.
      ls_value_set-value = '747-400'.
      append ls_value_set to lt_value_set.
      ls_value_set-key   = 'A310-300'.
      ls_value_set-value = 'A310-300'.
      append ls_value_set to lt_value_set.
      ls_value_set-key   = 'A319'.
      ls_value_set-value = 'A319'.
      append ls_value_set to lt_value_set.
      ls_value_set-key   = 'DC-10-10'.
      ls_value_set-value = 'DC-10-10'.
      append ls_value_set to lt_value_set.
    set values to context attribute
      lr_nodeinfo_flightinfo->set_attribute_value_set( name = 'PLANETYPE' value_set = lt_value_set ).
    endmethod.
    6.Invoke method VS_PLANETYPE in method WODOINIT in ur view.
    Hint: Use Web Dynpro Code Wizard.
    method WDDOINIT .
      DATA:
       node_flightinfo                     TYPE REF TO if_wd_context_node,
       elem_flightinfo                     TYPE REF TO if_wd_context_element,
       stru_flightinfo                     TYPE if_input_view=>element_flightinfo,
       item_carrid                         LIKE stru_flightinfo-carrid.
    navigate from <CONTEXT> to <FLIGHTINFO> via lead selection
      node_flightinfo = wd_context->get_child_node( name = `FLIGHTINFO` ).
    get element via lead selection
      elem_flightinfo = node_flightinfo->get_element(  ).
    set single attribute
      elem_flightinfo->set_attribute(
        EXPORTING
          name =  `CARRID`
          value = 'AA' ).
    Create Value Selector for PLANETYPE
      wd_this->vs_planetype( ).
    endmethod.
    Regards
    Manoj Kumar

  • Return multiple values from a search help

    Dear All,
    I have a table control on screen with fields:
    doc.no
    doc.type
    doc.ver
    doc.part
    I've coded a search help for doc. no. which returns a single value i.e. doc. no from the search help.
    But my reqmt. is that when the user selects a particular doc.no from search help, it should also return doc. type/ver/part
    and the corresponding table control field should be populated.
    I mean i require multiple values to be returned and populated in my screen.
    Thanks in anticipation

    Hi ,
    Please check this thread where i had done some coding and the OP himself has found the solution
    automatic population of search help value to another field in module pool ... if its a table control you have get the selected line by  using fm DYNP_GET_STEPL. Then update the values to the respective fields using DYNP_VALUES_UPDATE.

  • Transfer values from one search help to another

    Is it possible to transfer values from screen of one search help to another. For example if I have the vendor master search help (XK02) and I go to the elementary search help "Vendors by Material" . On this screen I enter some data in the Material number field. Now  when I do an F4 on the material field on this search help I will get the collective search help for Material number. My requirement is to have the material number from the first search help to be carried over to the second search help. Is there any way possible. I am manipulating my custom search helps through the search help exits(fetching data etc).

    Hi Deepak,
    Not very sure, but I think if you write code in search help exit, this may be possible. Use GET PARAMETER... SET .. in the exit to pass the values between search help.
    Regards,
    Atish

  • Import Export value of enhanced search help

    Hi
    i have created an elementary search help and inserted in VMVA which is standard search help for Sales order selection.
    its working properly but when i select the value it doesn't pass to vbeln on va02 tcode  kindly help me in this regard .
    did i need to transport the value through programing  ???
    Regards
    Ammad

    done ............. parameter was not set

  • Automatically populate other fields on screen while applying search help on

    Hi,
    There is some urgent requirement
    I have one screen in which 3 fields are there
    Functionality is like this when I apply search help for one field it will call a FM which populate a internal table in which value for all 3 fields will be there and it should be populated in all 3 fields.
    I am assigning proper value to all 3 fields in POV event but only one feild is getting populated on which I am applying search help.
    Anybody can sort this out.
    will be thankful to U.

    Hi..,
    just copy, paste and execute this code..
    Check this code..will be helpful for u..
    tables:mara,makt,mseg.
    parameters: p_bukrs type t001-bukrs,
    p_butxt type t001-butxt,
    p_ort01 type t001-ort01,
    p_land1 type t001-land1.
    data: dynfields type table of dynpread with header line.
    data: return type table of ddshretval with header line.
    at selection-screen on value-request for p_bukrs.
    call function 'F4IF_FIELD_VALUE_REQUEST'
    exporting
    tabname = 'T001'
    fieldname = 'BUKRS'
    dynpprog = sy-cprog
    dynpnr = sy-dynnr
    dynprofield = 'P_BUKRS'
    tables
    return_tab = return
    exceptions
    field_not_found = 1
    no_help_for_field = 2
    inconsistent_help = 3
    no_values_found = 4
    others = 5.
    refresh dynfields.
    read table return with key fieldname = 'P_BUKRS'.
    Add it back to the dynpro.
    dynfields-fieldname = return-retfield.
    dynfields-fieldvalue = return-fieldval.
    append dynfields.
    Get the company code from db and add to dynpro
    data: xt001 type t001.
    clear xt001.
    select single * into xt001
    from t001
    where bukrs = return-fieldval.
    dynfields-fieldname = 'P_BUTXT'.
    dynfields-fieldvalue = xt001-butxt.
    append dynfields.
    dynfields-fieldname = 'P_ORT01'.
    dynfields-fieldvalue = xt001-ort01.
    append dynfields.
    dynfields-fieldname = 'P_LAND1'.
    dynfields-fieldvalue = xt001-land1.
    append dynfields.
    Update the dynpro values.
    call function 'DYNP_VALUES_UPDATE'
    exporting
    dyname = sy-cprog
    dynumb = sy-dynnr
    tables
    dynpfields = dynfields
    exceptions
    others = 8.
    <b>
    plz do remember to close your thread, when ur problem is solvedd !! reward all helpful answers !!
    regards,
    sai ramesh</b>

  • To populate another alv grid's field with value selected from search help

    Hi,
    I have two fields in alv grid, first column holds code and the second one holds code's description. Also I have a search help includes these two fields. The search help is attached to the first column. The requirement is, when I select a code from the search help, second column should be populated with selected code's description.
    Any help will be appreciated. Thanks..

    Hi,
    have a look into Report: BCALV_EDIT_03.
    Regards, Dieter

  • XML based Adobe form is not allowing to input values while display on IE

    Hi Experts
    I have intergarted an XML based adobe form in webdynpro with inputs fields and submit button.
    But on display on Internet expolrer it doesn't allow to input values even button dosen't work.
    Please help me how would it will allow to input values .
    Many thanks in advance

    hi dear
    yes the enabled property is checked but still form doesn't allow to enter value and submit button is also disabled.
    Is there any setting or some program code is required.
    It would be great if some body can help us in this ....
    many thanks in advance.
    thanks

Maybe you are looking for