cancel
Showing results for 
Search instead for 
Did you mean: 

Problem that tooltip has text from header and tooltip of a column in ALV.

Former Member
0 Kudos

Hello,

I am using an ALV and have 2 problems with the settings of the text from header and tooltip of a column. I set the texts with following code:

lr_column = l_value->if_salv_wd_column_settings~get_column( 'XY').

lr_column_header = lr_column->get_header( ).

lr_column_header->set_text( 'Head text.' ).

lr_column_header->set_tooltip( 'Tooltip text' ).

But than I have the problem that this don't overwrite the text bind from the DDIC of the column. So I change the code:

delete: lr_column_header = lr_column->get_header( ).

new: lr_column->delete_header( ).

lr_column_header = lr_column->create_header( ).

Than the text from header and tooltip are the new I set by programming.

Now I have the problem or better phenomenon, that in case of use:

if_salv_wd_table_settings~set_fixed_table_layout( 'X' )

the tooltip contains the text from the header plus the proper text of the tooltip!

I.e. like above set: "Head text Tooltip text" as the tooltip for the column XY.

It can't be right, or?

I cant find any help in the SDN or SAP notes.

We are now on the SAPKB70010.

Thanks or any help.

regards Christian

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Solving this problem took me a while

DATA: col_header TYPE REF TO cl_salv_wd_column_header.

First disable dddic binding for textelements:

CALL METHOD col_header->set_ddic_binding_field

EXPORTING

value = IF_SALV_WD_C_DDIC_BINDING=>DDIC_BIND_NONE.

Afterwards you can set your own text. If you do not disable ddic binding

you can set your set as long as you like you will be ****.

Former Member
0 Kudos

Hi Christian

You can either specify a new DDIC data element whose field label is to be used as the column header or you can set your own text without DDIC reference.

1. You use the SET_DDIC_BINDING_FIELD method to set the field label that you want to use for your column title. If you want to use your own text without DDIC reference as column title, you have to set this characteristic to DDIC_BIND_NONE.

lr_column = l_value->if_salv_wd_column_settings~get_column( 'XY').

lr_column_header = lr_column->get_header( ).

lr_column_header->SET_DDIC_BINDING_FIELD(DDIC_BIND_NONE).

lr_column_header->set_text( 'Head text.' ).

lr_column_header->set_tooltip( 'Tooltip text' ).

2. For specifying new DDIC data element

A DDIC data element can contain the following field labels:

  • Header

  • Short text

  • Medium-length text

  • Long text

To set a particular field label specify any of the below parameters in the SET_DDIC_BINDING_FIELD method.

Field label Constant

No field label DDIC_BIND_NONE

Header DDIC_BIND_TITLE

Short text DDIC_BIND_SHORT

Medium-length text DDIC_BIND_MEDIUM

Long text DDIC_BIND_LONG

Hope it Helps

Regards

Rakesh

Former Member
0 Kudos

Hello Rakesh,

thanks for very helpfull answer.

But one problem is still there. In both cases the text of the tooltip contain the text of the header!?!!

> in case of use:

> if_salv_wd_table_settings~set_fixed_table_layout( 'X' )

> the tooltip contains the text from the header plus the proper text of the tooltip!

> I.e. like above set: "Head text Tooltip text" as the tooltip for the column XY.

Is there an interface where I have to set an attribute for the tooltip?

Regards

Christian

Former Member
0 Kudos

Hi Christian Breitenbach

Try using the method SET_DDIC_BINDING_ELEMENT() instead of SET_DDIC_BINDING_FIELD(). Change the binding element to a different one or specify it as DDIC_BIND_NONE. Think it ll work for tooltip.

Regards,

Rakesh.

Former Member
0 Kudos

Thanks for your prompt answer.

In the use of

lr_column_header->SET_DDIC_BINDING_ELEMENT( 'Name of DDIC Element' ).

It is still the same!

I also tried 'DDIC_BIND_NONE' also with the same result. In all cases the text of header and tooltip are add together in the tooltip.

But only in case of fix set table layout.

l_value->if_salv_wd_table_settings~set_fixed_table_layout( 'X' ).

Any other suggestions?

Regards

Christian