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

Avoid redundancy in dropdownlistbox choice

Hi Experts,

I have a table and a dropdownlistbox.

What's the easiest possibilities to avoid that double entries are shown in the dropdownlistbox?

Thank you very much in advance!

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 13, 2007 at 11:11 AM

    hi,

    you can create an internal table of type Hashed which will not allow the duplicate values...and directly pass the values in DDLB...

    thanks

    jaideep

    *reward points if useful..

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 13, 2007 at 10:19 AM

    Hi ,

    For a DDLB(DropdownListBox) we have to pass an internal table to display values...

    So the best way would be to use select distinct while populating the internal table....

    What we normally do is use a table of type TIHTTPNVP.

    eg.

    <%
      DATA : gt_tab type TIHTTPNVP,
              gs_tab type IHTTPNVP
              itab type standard table of ZTABLE,
              wa type ZTABLE.
    
     select distinct FIELD1 from ZTABLE into corresponding fields of table itab.
    
    loop at itab into wa.
      gs_tab-NAME = wa-FIELD1.
      gs_tab-VALUE = wa-FIELD1.
      append gs_tab to gt_tab.
    endloop.
    %>

    Then pass this gt_tab to ur DDLB...!

    eg.

    <htmlb:dropdownListBox id = "DDLB"
    table             = "<%= gt_tab %>"
    nameOfKeyColumn   = "NAME"
    nameOfValueColumn = "VALUE"
    width             = "100%"
    onSelect          = "onInputProcessing"
     />
    

    Hope this helps.

    <b><i>Do reward each useful answer..!</i></b>

    Thanks,

    Tatvagna.

    Message was edited by:

    Tatvagna Shah

    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.