cancel
Showing results for 
Search instead for 
Did you mean: 

Avoid redundancy in dropdownlistbox choice

Former Member
0 Kudos

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!

Accepted Solutions (1)

Accepted Solutions (1)

jaideeps
Advisor
Advisor
0 Kudos

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..

Answers (1)

Answers (1)

Former Member
0 Kudos

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