Skip to Content

color a column based on value in another column in tableview

I am using a tableview iterator to display data in a bsp page. I want to color a cell in particular column (column 4), when a value in another column (column 2) on that same row is greater than 20. I can color the cell in column 2 but am not able to color the cell in column 4. How can I accomplish this?

This is what I have. Looks like val1 is losing it's value.

CASE p_column_index.

WHEN 2.

ASSIGN p_row_data_ref->* TO <row>.

ASSIGN COMPONENT 'ZTGT' OF STRUCTURE <row> TO <col>.

VAL = <col>.

IF VAL GT '20'.

val1 = p_row_index.

p_style = 'celldesign:CRITICALVALUE_DARK'.

ENDIF.

WHEN 4.

if p_row_index = val1.

p_style = 'celldesign:CRITICALVALUE_DARK'.

endif.

WHEN OTHERS.

  • do nothing

ENDCASE.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jul 15, 2011 at 05:02 AM

    The reason val1 is "loosing its' value" is presumably because you have defined it in the method as a local variable. So each time you call the RENDER_CELL_START method it is is newly initialised. So if you make this an instance attribute it will retain its' contents across method calls.

    Cheers

    Graham Robbo

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.