Skip to Content
author's profile photo Former Member
Former Member

Column Texts for an ALV Grid Control.

Hi all,

I would like to know if it is possible to display an icon along with the column text in my ALV Grid. I'm using the class CL_GUI_ALV_GRID.

I am able to display either an icon or some text but not both on the column header.

Example code which has <i><b>not</b></i> worked for me:

1. If I use : CONCATENATE '@06@' 'Text' INTO COLTEXT.

The column header just shows the icon (corresponding to the code @06@).

2. If I use : CONCATENATE 'Text' '@06@' INTO COLTEXT.

The column header shows up as : Text @06@.i.e., the icon code is not being recognized and is showing up as text.

Hope I'm clear in expressing my doubt.

Thanks very much,

Anand Mandalika.

Add comment
10|10000 characters needed characters exceeded

4 Answers

  • Posted on Jun 30, 2004 at 01:25 PM

    Have you tried this yet?

    WRITE ICON_DISPLAY AS ICON TO ICONBUTTON.

    CONCATENATE ICONBUTTON 'Display' INTO ICONBUTTON

    SEPARATED BY SPACE.

    Regards,

    Rich Heilman

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 30, 2004 at 03:06 PM

    Not sure if this will work the same for the ALV column, but here is some code which adds an icon to a selection screen button using the function module ICON_CREATE.

    http://www.sapdevelopment.co.uk/reporting/selscr/but_buticon.htm

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 01, 2004 at 07:08 AM

    Hello,

    Thanks to <u>Rich Heilman</u> and <u>Mart</u> for your responses.

    Unfortunately none of the two solutions worked for me. The problem that I had originally had still persists.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Rich Heilman

      Hello Mr.Heilman,

      I have not ( yet ) seen such a display in any of the Standard SAP screens that I have come across.

      But well, I got this requirement, and I thought it should be possible to do it. If you have several columns which contain some values, then it is reasonable for the user to expect to see the overall status derived from the values in the column in the column-header. Don't you think so ?

  • author's profile photo Former Member
    Former Member
    Posted on Jul 02, 2004 at 02:04 AM

    HI:

    please use this solution and try it.

    1. creat the field for icon with iconname (frist you must type-pool:icon.)

    2. assign value to icon.The value is like '@08Qconfirm@'.

    So you can get you want.If you get it ,please send mail to me: songzc3@sohu.com

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Doh! please except my appologies, for some reason i had got it into my head that you simply wanted to display an icon in the colum header and not the text as well.

      Is there any way of creating new icons, if so you could create one with the icon and text you want and then add that.

      sorry again

      Regards

      Martin