cancel
Showing results for 
Search instead for 
Did you mean: 

How can set colour for a particular row?

Former Member
0 Kudos

Hi all,

in my context ,i have a field like epi_type.i want to set entire row in red colour wherever epi_type = emergency.

How can i aceieve this?

Regards,

Ravi

Accepted Solutions (0)

Answers (2)

Answers (2)

Sm1tje
Active Contributor
0 Kudos

I'm assuming that you are using this ALV for WD, else I don't think it is possible in 'normal' table view.

It seems not to be opening the thread I tried to provide when clicking so I will give the answer (copy from above mentioned thread):

U will be having one Node for that ALV Table Know.Add one Attribute for eg., CELL_DESIGN of type WDUI_TABLE_CELL_DESIGN.In the Properties of Table Column Properties there is one Field Called CellDesign.U Map the Attribute CELL_DESIGN for the Column which u want Color.If u want for a Row then map that attribute for each column.

U cant set ur own colors for the Cell.In the CellDesign Property u will be having a Dropdown in which a list of values will be present u can make use of that colors.

U can give the CellDesign Colors from the Documentation such as badvalue_dark,badvalue_light,etc.,

During the Runtime,based on the condition u can set the Values for that Attribute Using SET_ATTRIBUTE.

For Eg.,

DATA lo_nd_table TYPE REF TO if_wd_context_node.

DATA lo_el_table TYPE REF TO if_wd_context_element.

DATA lt_table TYPE wd_this->elements_table.

DATA ls_table TYPE wd_this->element_table.

lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).

get element via lead selection

lo_el_table = lo_nd_table->get_element( ).

lo_nd_table->get_static_attributes_table(

IMPORTING

table = lt_table ).

loop at lt_table into ls_table.

if ls_table-text = '1'.

lo_el_table->set_attribute(

name = `CELL_DESIGN`

value = 'negative' ).

elseif ls_table-text = '2'.

lo_el_table->set_attribute(

name = `CELL_DESIGN`

value = 'positive' ).

endif.

endloop.

Edited by: Micky Oestreich on Apr 16, 2008 10:56 PM

Former Member
0 Kudos

Hi

In the Properties of Table Column Properties there is one Field Called CellDesign.U Map the Attribute CELL_DESIGN for the Column which u want Color.If u want for a Row then map that attribute for each column.

what can i do for the above?

can u plz send me the code snippet?

Regards,

Ravi

Former Member
0 Kudos

Hi,

I think you have to download perticular themes i guess. Not sure boss.