Skip to Content
author's profile photo
Former Member

Drop-DownListbox in TableView Control

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Posted on Jul 14, 2004 at 01:17 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Hallo Rajeev,

      I did answer your question previously in another Different Listboxes in Tableview-Colum 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

  • author's profile photo
    Former Member
    Posted on Jul 14, 2004 at 06:58 PM

    Hello Brian and Bernhard,

    It worked..thanks for your help..

    Thanks And Regards

    Rajeev Patkie

    Add comment
    10|10000 characters needed characters exceeded