cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro ALV grid column colour

Former Member
0 Kudos

Hi,

I have tried to set the colour of a column for my web dynpro alv with the below code but it the colour for this column has not changed - it seems to remain the standard colour. Is there something else i need to do?

DATA: lt_columns TYPE salv_wd_t_column_ref

, ls_columns TYPE salv_wd_s_column_ref

, lr_column TYPE REF TO cl_salv_wd_column

.

lt_columns = lo_value->if_salv_wd_column_settings~get_columns( ).

LOOP AT lt_columns INTO ls_columns.

IF ls_columns-id CS 'TOTAL_'.

lr_column = ls_columns-r_column.

lr_column->set_cell_design( cl_wd_abstr_master_table_col=>e_cell_design-positive ). "CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-GROUP_LEVEL1

ENDIF.

ENDLOOP.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Samir,

You will have to create an attribut WDUI_TABLE_CELL_DESIGN and bind this attribute with the cell design property of the column. Check this wiki link [https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP%20Web%20Dynpro%20ALV%20-%20Change%20Cell%20Colour%20based%20on%20Content], it will solve your issue.

Regards,

Radhika.

Former Member
0 Kudos

Hi,

That seems like a lot to do just to change the column color. I just need to do it for the total columns. There is no reference to the method lr_column->set_cell_design( ) in the wiki, but instead it has lr_column->set_cell_design_fieldname( ). What does this mean?

Former Member
0 Kudos

Hi Samir,

lr_column->set_cell_design_fieldname( 'CELL_DESING' )

This means that we are binding our attribute 'CELL_DESIGN' ( which has to be create ) with our column .

Now just pass your color to this attribute and the column would be colored.

This is the correct approach.

Radhika.

Former Member
0 Kudos

Hi,

I just tried to add the attribute but my alv grid columns are part of a structure and it doesnt like me adding an field cell_design to the structure with that type

Former Member
0 Kudos

Hi

Goto Context, select the node and scroll at the bottom and remove the structure name from there and then try adding the attribute.

Radhika.