cancel
Showing results for 
Search instead for 
Did you mean: 

color row in alv table

Former Member
0 Kudos

i want to color specific rows in table. those which have a special key entry..

data: lr_column_x TYPE ref to cl_salv column.

lr_column_x->set_cell_design_filedname( value = 'negative').

Somebody has an idea?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

Create an Attribute 'DESIGN' of type WDUI_TABLE_CELL_DESIGN in your Context Node which is binded to the ALV.

Fill this attribute with different values 00 is for Standard, 01 is for negative ( see the value range of the domain WDUI_TABLE_CELL_DESIGN )

and use your code

data: lr_column_x TYPE ref to cl_salv column.

lr_column_x->set_cell_design_filedname( value = 'DESIGN' ).

give the Context Attribute name

Abhi

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Hi

>

> Create an Attribute 'DESIGN' of type WDUI_TABLE_CELL_DESIGN in your Context Node which is binded to the ALV.

>

> Fill this attribute with different values 00 is for Standard, 01 is for negative ( see the value range of the domain WDUI_TABLE_CELL_DESIGN )

>

> Abhi

Just some advice. Don't use the codes for attribute values directly. Although you can generally look up the values via a ddic domain, there should always be a class constant with the values as well. SAP doesn't make any promises that we won't change the value meanings - only that we will keep the class constants the same. I have seen this in the past where values had to be adjusted after shipping for consistency with WDJ (and for the NWBC and UR consistency). In this case the constant is CL_WD_TABLE_COLUMN=>E_CELL_DESIGN. For instance if you wanted to set standard you would use CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-STANDARD not 00. I think it also has the added vaule of making your cod emore readable.

Answers (0)