Skip to Content
author's profile photo Former Member
Former Member

Color a specfic text view in a table dynamically

Hi ,

I have got a SFLIGHT table display , According to the Flight Number I want to change the color of textView in that table .

How should I do ?

I have followed teh following steps :

Created a Attribute colorCode of Type WDUI_TEXTVIEW_SEM_COL .

Then i have set the value of Marked whenvere i get flight no 0017 .

But this is working for the coplete column f flight number .

I want different colors for different flight numbers .

Thanks And Regards

Anuradha Rao

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 26, 2010 at 02:47 PM

    Hi

    You could create attribute celldesign of type WDUI_TABLE_CELL_DESIGN.

    bind this attribute to the columns of the row in your table.

    see example component : SALV_WD_TEST_TABLE_COLORS

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 27, 2010 at 11:04 AM

    Hi

    creat the attribute as baskar mentioned and bind it to the table coloum's cell design property .

    below code will help youto get the color for cell based on condition .

    method WDDOINIT .
    
    * Coding for colouring the cell 
    LOOP AT lt_scarr INTO wa_scarr .                                        "WHERE currcode = cky .
        IF wa_scarr-currcode = cky .                                            " condition checking 
    
          wa_scarr-cell_design = cl_wd_table_column=>e_cell_design-negative.   " Redcolor 
          wa_scarr-img  = '~Icon/GreenLed'.
         ELSE.
     
          wa_scarr-cell_design = 02.
          wa_scarr-cell_design = cl_wd_table_column=>e_cell_design-positive. "Green color 
        ENDIF.
    
            MODIFY lt_scarr FROM wa_scarr TRANSPORTING   cell_design.
    
      ENDLOOP.
    
    endmethod .

    Regards

    chinnaiya P

    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.