Skip to Content
author's profile photo Former Member
Former Member

Search Help in ALV component

Hi Guys,

I would like to set a predefined value to search criteria in a Dictionary Search Help assigned to an attribute of my context that I visualize in an ALV. The main idea is when I click in this cell, it should appear a Search Help with a value assigned to a parameter in the search criteria, and getting all these values corresponding to this parameter. Is this possible? How could I do this?



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on May 28, 2013 at 04:48 AM

    Hi Sergio

    This is possible with the help of search help exit.

    I had a similar requirement.This is what I have done.

    In the callcontrol step 'PRESEL1, we can set the default search criteria.

    cl_wdr_value_help_handler=>m_context_element contains the current context element reference from which the search help is triggered.

    IF callcontrol-step EQ 'PRESEL1'.

    * Get the context element from which the F4 has been called.
    lo_el_supp_table = cl_wdr_value_help_handler=>m_context_element.

    * get all declared attributes
    static_attributes = ls_supp_table ).

    IF ls_supp_table-supplier IS NOT INITIAL.
    READ TABLE shlp-selopt
    WITH KEY shlpfield = 'NAME1'.
    IF sy-subrc <> 0.
    * Add selection criteria in case not added earlier.
    ls_sel_criteria-sign = 'I'.
    TRANSLATE ls_supp_table-supplier TO UPPER CASE.
    ls_sel_criteria-low = ls_supp_table-supplier.
    ls_sel_criteria-shlpfield = 'NAME1'.
    IF ls_supp_table-supplier CA '*'.
    ls_sel_criteria-option = 'CP'.
    ls_sel_criteria-option = 'EQ'.
    APPEND ls_sel_criteria TO shlp-selopt.
    CLEAR ls_sel_criteria.


    Then in the call control step 'SELECT', I prepared my hit list.

    Hope it helps.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.