cancel
Showing results for 
Search instead for 
Did you mean: 

Drop-DownListbox in TableView Control

Former Member
0 Kudos

Hello All,

I tried to incorporate drop-downlist box in one of the columns of tableview.The column which contains this drop-downlistbox is dynamic column i.e. it gets populated on an event. I had tried using text box using the concept of iterator which works fine by using following code:

p_replacement_bee = CL_HTMLB_INPUTFIELD=>FACTORY(

id = p_cell_id

value = f_name

type = 'string'

size = '20'

).

For implementing the drop-downlist I tried to populate an internal table in IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS method (since this method is fired only once) and use the same in above code i.e.

p_replacement_bee = CL_HTMLB_DROPDOWNLISTBOX=>FACTORY(

id = p_cell_Id

table = myItab

selection = myString

nameOfKeyColumn =

nameOfValueColumn =

).

but it gives error while compiling iteslf giving type mismatch error for table parameter..I had used in the layout where it works fine passing internal table as parameter.Also it does not allow to type-caste using ?= operator.

How to implement the iterator concept in this case?

Thanks in advance.

Thanks And Regards

Rajeev Patkie

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Brian and Bernhard,

It worked..thanks for your help..

Thanks And Regards

Rajeev Patkie

0 Kudos

Hello Rajeev,

the problem is the parameter mismatch. You want to give a internal table to parameter which is declared as "type ref to data" - that means you have to create a data reference (to your table) and pass it to the parameter of the factory method.

Hth, Bernhard

former_member181879
Active Contributor
0 Kudos

Hallo Rajeev,

I did answer your question previously in another with some links to the actual code. Don't know why it missed this thread.

Bernhard is correct that you need to get a reference on the data. Please check ABAP documentation for the command "GET REFERENCE OF".

The relevant bits and pieces of source code is:


data M_CURRENCIES_REF type ref to DATA.

GET REFERENCE OF me->m_currencies INTO me->m_currencies_ref.

p_replacement_bee = CL_HTMLB_DROPDOWNLISTBOX=>FACTORY(
   id                = p_cell_id
   table             = me->m_currencies_ref
   ... ).

++bcm