cancel
Showing results for 
Search instead for 
Did you mean: 

ICON centered in ALV?

Former Member
0 Kudos
1,871

Hi everybody,

is it possible to center a ICON in an ALV?

The default seems to be left aligned.

Thx, Regards

Mario

Accepted Solutions (1)

Accepted Solutions (1)

naveenvishal
Contributor

Hi Mario,

Use SET_ALIGNMENT method of the column while setting the column properties.

  lr_column ?= lr_columns->get_column( 'ICON' ).

  lr_column->set_icon( if_salv_c_bool_sap=>true ).

  lr_column->SET_ALIGNMENT( IF_SALV_C_ALIGNMENT=>CENTERED).

  lr_column->set_long_text( 'ICON' ).

Refer following for a brief outline of the same.

displaying icons in alv using class cl_salv_table - Code Gallery - SCN Wiki

Hope this helps.

Regards,

Naveen

Former Member
0 Kudos

Hi Naveen,

could you pls help:

Where do I have to implement this?

When I am looping over the fieldcat?


* change fieldcatalog

  LOOP AT gt_fieldcat ASSIGNING <fc>.

Thx, Regards

Mario

Former Member
0 Kudos

Hi,

I found it in

Thanks

Mario

naveenvishal
Contributor
0 Kudos

Hi Mario,

Try this.

just(1)        type c,        " (R)ight (L)eft (C)ent.

when setting catalog.

Hope this resolves.

Regards,

Naveen

Answers (0)