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?

Thanks,

Sergio.

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
    lo_el_supp_table->get_static_attributes(
    IMPORTING
    static_attributes = ls_supp_table ).


    IF ls_supp_table-supplier IS NOT INITIAL.
    READ TABLE shlp-selopt
    TRANSPORTING NO FIELDS
    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'.
    ELSE.
    ls_sel_criteria-option = 'EQ'.
    ENDIF.
    APPEND ls_sel_criteria TO shlp-selopt.
    CLEAR ls_sel_criteria.
    ENDIF.
    ENDIF.

    ENDIF.

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

    Hope it helps.

    Regards

    Swati

    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.