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: 

ALV functions using the class cl_salv_gui_table_ida for ALV display

Former Member
0 Kudos

Hi Gurus,

I am trying to use some ALV functionalities using the class : CL_SALV_GUI_TABLE_IDA. My requirement is to get the column-width optimize functionality and also, I have a column with various icons, for which I need to have tool tips.

Could please specify its use via this class ?

Thanks

7 REPLIES 7

fabianlupa
Contributor
0 Kudos

Icon tooltips seem to work like this:

go_alv->field_catalog( )->display_options( )->set_tooltip_for_icons(
  iv_field_name = 'ICON_COL'
  its_tooltips  = VALUE #( ( icon = icon_oo_class tooltip = 'Text' ) )
).

Regarding column width optimization: In my testing it seems to be always on. Also in the layout settings there is no tab to enable / disable it. I assume because of the grouping / paging functionality there is no setting for it. Anyways you can optimize column width on demand using the context menu.

0 Kudos

Hi Fabian,

Can you please show the output in the ALV of the Tool tip over the column 'ICON_COL' you mentioned as a snippet. For me, I am not getting the desired text in the output. I already tried this way !!

And, for the col-width optimize, you are absolutely right. I just checked. but how do you pull up the entire column header in output using this class.

Thanks

0 Kudos

Here's the full example.

REPORT z_fl_salv_ida_test.

TYPES: gty_tab TYPE STANDARD TABLE OF zfl_idatest WITH DEFAULT KEY.

DATA(gt_tab) = VALUE gty_tab(
  ( icon = icon_oo_class     text = 'Class' )
  ( icon = icon_oo_interface text = 'Interface' )
  ( icon = icon_oo_attribute text = 'Attribute' )
).

MODIFY zfl_idatest FROM TABLE @gt_tab.
COMMIT WORK AND WAIT.

DATA(gi_alv) = cl_salv_gui_table_ida=>create( 'ZFL_IDATEST' ).
gi_alv->field_catalog( )->display_options( )->set_tooltip_for_icons(
  iv_field_name = 'ICON'
  its_tooltips  = VALUE #( ( icon = icon_oo_class     tooltip = 'This is a class' )
                           ( icon = icon_oo_interface tooltip = 'This is an interface' )
                           ( icon = icon_oo_attribute tooltip = 'This is an attribute' ) )
).

go_alv->fullscreen( )->display( ).

0 Kudos

Hi,

It is not working for me. Is there any settings related to it ?

0 Kudos

Not that I would know of, at least I did not change anything. What data element are you using for the icon column in the database table? I used ICON_D.

0 Kudos

I think you are right... There might be a issue with the data-element !!

The icons are extracted from a CDS view, and the field is calculated in the view.

I will try with another one and get back to you...

Thanks,

Fabian...

Former Member
0 Kudos

bonjour