cancel
Showing results for 
Search instead for 
Did you mean: 

Image in Tableview using Iterator

Former Member
0 Kudos

I am using a tableview iterator.

In my tableview one of the column should render Images / icons.

Using tableviewcontrol structure in column definition method I need to set the property of column so that it display Image instead of text.

In normal tableviewColumn HTMLB tag we have an attribute as TYPE where we set it to "IMAGE".

Can we any of that kind in tableviewcontrol structure.

Please help

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member184111
Active Contributor
0 Kudos

Hi John,

Try the bellow code..

Data: bee_table              type ref to cl_bsp_bee_table,
         img                       type ref to cl_htmlb_image.
 
create object bee_table.
img ?= cl_htmlb_image=>factory( id = p_cell_id src = '...'  alt = '... ' ).
bee_table->add( element = img level = 1 ).
 
p_replacement_bee ?= bee_table.

Regards,

Anubhav.

former_member188685
Active Contributor
0 Kudos

you can use the logic to get the image in the iterator cell_start method.

case p_column_key.
    when 'IMAGE'.  "column name
      create object wa_html.

      if wa_flight-hier = 'C'.
        tmptext = wa_flight-carrid.
        wa_html->add( html = `<img src = "TopPlus.gif" width = 25% >` ).
        wa_html->add( html =  `&nbsp` ).
        wa_html->add( html = `<font color="blue">` ).

        wa_html->add( html =  tmptext  ).

        wa_html->add( html = `</font>` ).

        p_replacement_bee = wa_html.

also check this standard iterator class

CL_SBSPEXT_ITERATOR