cancel
Showing results for 
Search instead for 
Did you mean: 

About setting color properties to alv table....

Former Member
0 Kudos

Hi experts,

I have scenario in which i have created one node with two columns..one for data and othr for cell design...both dis node attributed are bind to standard table's column's value property and cell design properties respectively...

Bt now..dis is only poss in Standard tables...and i want da same in ALVs..

In which m not gettin where to bind dat cell design attribute of da node to ALV table...lik we bind data..using set_data( ) thg...

Hope u understood ma query...

Please help me out to solve dis.....

Thanks and Regards,

Runali.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Runali,

You can achieve the same in ALV by setting the cell_design property of an ALV column. It would be as follows:

lr_column = lr_column_settings->get_column( ID = id ).

lr_column->set_cell_design( <design> ).

Look into the class cl_salv_wd_column for the enumeration and see the possible values cell_design can take. Each value corresponds to a color. You can set the color of your choice.

<b>Please award points if the answer is useful to you.</b>

Regards,

Nithya

Former Member
0 Kudos

Hey thks Nithya...

Bt da thg is i wanna bind da attribute...as it happens for table...not jus settin the design for da cell...

Hope u understood...

Thks and Regards,

Runali.

Former Member
0 Kudos

Then have a field cell_design in your context. And instead of calling set_cell_design, you should just say

lr_column->set_cell_design_fieldname( 'CELL_DESIGN' ).

In ALV, for every property, a method set_<property>_fieldname is available to bind the proerty to a context attribute. When you initialise your ALV settings, set this attribute and it will be bound to the cell design.

The attribute cell_design should be in the same context node that you bind to the ALV. You can make the column with column ID cell_design as invisible. This way you can set the colors even at an individual cell level. In your internal table, if you wish, you can set a particular color for a set of values etc.

Hope this helps you solve your problem.

Regards,

Nithya

Former Member
0 Kudos

Hey Nithya,

Thanks so much...u solved ma probm..i rewarded you the points...

Thks and Regards,

Runali.

Former Member
0 Kudos

Hey ..

One more doubt ...

See i have an ALV table..nd i select one cell from it...nd den select a color from da dropdown..now i want to set dat color for the cell whch i already selectd...Is dis poss?????????

Thks nd Regards,

Runali.

Answers (1)

Answers (1)

Former Member
0 Kudos

Still not completely answered!!!

Former Member
0 Kudos

Hi Runali,

This is possible only if your cell editor is a button or link. Otherwise, simply clicking on the cell does not mean 'selection' and it will not be set.

Regards,

Nithya