Skip to Content
0

ALV functions using the class cl_salv_gui_table_ida for ALV display

Jul 24, 2017 at 09:24 AM

202

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Fabian Lupa Jul 24, 2017 at 08:44 PM
0

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.


salvida.png (7.9 kB)
Show 5 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

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( ).

ida.png (4.7 kB)
0
Former Member

Hi,

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

0

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
Former Member

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...

0
avatar image
Former Member Jul 27, 2017 at 07:55 AM
0

bonjour

Share
10 |10000 characters needed characters left characters exceeded