Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Color information in CL_GUI_ALV_TREE

Former Member
0 Kudos

Hi all,

I am using an ALV tree object of class CL_GUI_ALV_TREE. I have added color to some cells in this tree. Here is how I add the color to my cells:

* set item-layout : highlight in red the correct cell
refresh lt_change_layout.
ls_change_layout_wa-style =  cl_gui_column_tree=>style_emphasized_negative.
ls_change_layout_wa-u_style = 'X'.
ls_change_layout_wa-fieldname = 'NODE'.  
APPEND ls_change_layout_wa TO lt_change_layout.

CALL METHOD TREE->change_node    "Do Highlighting
      EXPORTING
        i_node_key     = l_key
        i_outtab_line  = ls_outtab
        it_item_layout = lt_change_layout.

Now I would like to add the <b>color information</b> (kind of quick info) to these specific cells. I know that in CL_GUI_COLUMN_TREE there is a method named

add_style_info

that does the trick... But it does not exist in CL_GUI_ALV_TREE! Does someone knows how to do this ?

Thank you very much,

Natalie

2 REPLIES 2

Former Member
0 Kudos

Hi,

To set a tree color style, use one of the following style values:

STYLE_DEFAULT

STYLE_INTENSIFIED

STYLE_INACTIVE

STYLE_INTENSIFD_CRITICAL

STYLE_EMPHASIZED_NEGATIVE

STYLE_EMPHASIZED_POSITIVE

STYLE_EMPHASIZED

STYLE_EMPHASIZED_A

STYLE_EMPHASIZED_B

STYLE_EMPHASIZED_C

and this is the code to add the colors:-

Form SET_TREE_COLOR_TOOLTIPS
data:settings type ref to CL_SALV_FUNCTIONAL_SETTINGS,
tooltips type ref to CL_SALV_TOOLTIPS.
settings = gr_table->get_functional_settings( ).
tooltips = settings->get_tooltips( ).
try.
tooltips->add_tooltip( type = CL_SALV_TOOLTIP=>C_TYPE_TREE_STYLE
value = STYLE_EMPHASIZED_NEGATIVE
tooltip = ‘Delayed delivery’ ).
tooltips->add_tooltip( type = CL_SALV_TOOLTIP=>C_TYPE_TREE_STYLE
value = STYLE_EMPHASIZED_POSITIVE
tooltip = ‘Delivered in time’ ).
catch cx_salv_existing.
endtry.
Endform.

Regards

Sudheer

Former Member
0 Kudos

Sorry but the method

get_functional_settings( )

does not exist in the CL_GUI_ALV_TREE class. So I cannot set the tooltip this way.

Does someone has another idea ?

Thanks and best regards,

Natalie