Showing results for 
Search instead for 
Did you mean: 

Color a specfic text view in a table dynamically

Former Member
0 Kudos

Hi ,

I have got a SFLIGHT table display , According to the Flight Number I want to change the color of textView in that table .

How should I do ?

I have followed teh following steps :

Created a Attribute colorCode of Type WDUI_TEXTVIEW_SEM_COL .

Then i have set the value of Marked whenvere i get flight no 0017 .

But this is working for the coplete column f flight number .

I want different colors for different flight numbers .

Thanks And Regards

Anuradha Rao

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos


creat the attribute as baskar mentioned and bind it to the table coloum's cell design property .

below code will help youto get the color for cell based on condition .

method WDDOINIT .

* Coding for colouring the cell 
LOOP AT lt_scarr INTO wa_scarr .                                        "WHERE currcode = cky .
    IF wa_scarr-currcode = cky .                                            " condition checking 

      wa_scarr-cell_design = cl_wd_table_column=>e_cell_design-negative.   " Redcolor 
      wa_scarr-img  = '~Icon/GreenLed'.
      wa_scarr-cell_design = 02.
      wa_scarr-cell_design = cl_wd_table_column=>e_cell_design-positive. "Green color 

        MODIFY lt_scarr FROM wa_scarr TRANSPORTING   cell_design.


endmethod .


chinnaiya P

Former Member
0 Kudos


You could create attribute celldesign of type WDUI_TABLE_CELL_DESIGN.

bind this attribute to the columns of the row in your table.

see example component : SALV_WD_TEST_TABLE_COLORS