cancel
Showing results for 
Search instead for 
Did you mean: 

Color an ALV cell with two different colours

Former Member
0 Kudos

Dear experts,

Is it possible to color an ALV cell with two different colors by splitting like into two half's and coloring each with a different color.

Kindly advice.

Thanks,

Nalla B.

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

It's not possible to have two different colors( for first half value one color and second half other color) in a single Cell.

One work around is to create two columns and split the value and assign to two different columns and then for first column set one color and for second column set another color. Then remove the gird lines in ALV by using SET_GRID_MODE method of IF_SALV_WD_TABLE_SETTINGS. And play with the width of columns, So that it may look like your required output( not exactly and remember to remove the header for second column).

Another option is, to use Multi Editor Cell and create two link to action/ link_to_url UI in a single column and assign the first half value to one link_to_action and second half to another link_to_action and make one enable/ disable and play with design property. You can refer this document where I demonstrated Multi Editor Cell for Table: http://scn.sap.com/docs/DOC-47237 .  You can this in ALV as mentioned in above SAP help

Hope this helps u,

Regards,

Kiran

Former Member
0 Kudos

Hi Kiran,

Thanks for your valuable response.

It is highly useful.

Thanks,

Nalla B.

Answers (2)

Answers (2)

Former Member
0 Kudos
venkat_ratnam3
Explorer
0 Kudos

Hi Nallasivam ,

Since in web-dynpro abap  we assign color based on the color code getting the column reference .

like

*Assigning column reference
call method lv_value->if_salv_wd_column_settings~get_column
exporting
  
id    = 'EBELN'
receiving
  
value = lr_column.

*Assign color

call method lr_column->set_cell_design
exporting
  
value = 1.

splitting color might be achieved by updating two column cells at time.


Thanks ,

Venkat Ratnam Naidu .