07-24-2017 10:24 AM
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
07-24-2017 9:44 PM
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.
07-25-2017 9:18 AM
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
07-25-2017 7:56 PM
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( ).
07-27-2017 8:27 AM
Hi,
It is not working for me. Is there any settings related to it ?
07-27-2017 8:37 AM
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.
07-27-2017 11:07 AM
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...
07-27-2017 8:55 AM