Application Development and Automation 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: 
Read only

tooltip for alv_tree elements

Former Member
0 Likes
1,470

Hello,

i'm using the method:

data: tree type ref to cl_gui_alv_tree,

new_key type lvc_nkey,

l_node_text type lvc_value,

ls_node_layout type lvc_s_layn,

lt_item_layout type lvc_t_layi.

call method tree->add_node

exporting

i_relat_node_key = p_tree_key

i_relationship = cl_gui_column_tree=>relat_last_child

is_outtab_line = p_line

is_node_layout = ls_node_layout

it_item_layout = lt_item_layout

i_node_text = l_node_text

importing

e_new_node_key = new_key.

Now, i want to display an icon instead of text.

include <icons>.

data ok_icon like icons value icon_checked.

lt_item_layout-t_image = ok_icon.

working fine, the problem is, now i'm getting the standard tooltip from the icon, but i want to get my own description. Does anyone know how i cant overwrite the standard tooltip.

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
1,111

Hello Marek

The is a simple trick to get your own tooltip. This trick works for others controls (e.g. ALV grid), too. The icon ICON_CHECKED has '@01@' as internal representation. Thus, simply define your icon as:

  ls_item_layout-t_image = '@01Q My own Tooltip! @'.

In general the logic is:

  '@<2-digit code>Q <own tooltip text> @'

Leave a <b>space</b> between the tooltip text and the preceeding Q and the succeeding @ character. I did not check but believe the length of the tooltip text is limited to about 30 characters.

Regards

Uwe

4 REPLIES 4
Read only

uwe_schieferstein
Active Contributor
1,112

Hello Marek

The is a simple trick to get your own tooltip. This trick works for others controls (e.g. ALV grid), too. The icon ICON_CHECKED has '@01@' as internal representation. Thus, simply define your icon as:

  ls_item_layout-t_image = '@01Q My own Tooltip! @'.

In general the logic is:

  '@<2-digit code>Q <own tooltip text> @'

Leave a <b>space</b> between the tooltip text and the preceeding Q and the succeeding @ character. I did not check but believe the length of the tooltip text is limited to about 30 characters.

Regards

Uwe

Read only

0 Likes
1,111

Great, thank you very much

regards Marek

Read only

0 Likes
1,111

Hello Marek

If the solution works how about appreciating it?

Regards

Uwe

Read only

0 Likes
818

You must use the ICON_CREATE for this purpose.

best regards