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: 

Is it possible to add icons to a field in the table control ?

0 Kudos

Dear Gurus,

Greetings..............

Is it possible to add icons to the line item of a field in the table control ?

Thanks in advance

Raj Kumar

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI

YES IT IS POSSIBLE.

DO THE FOLLOWING

1.DECLARE INCLUDE <ICON>.

2.IN YOUR INTERNAL TABLE DECLARE FIELD ICON

icon(4) TYPE c,

3. POPULATE YOUR INTERNAL TABLE WITH APPROPRIATE ICONS BY SELECTING FROM INCLUDE SPECIFIED ABOVE.

EG:

wa2-icon = '@5C@'.

4.PASS IT TO FIELDCAT

wa_fieldcat-fieldname = 'ICON'.

wa_fieldcat-icon = 'X'. " Displayed as Icon

wa_fieldcat-tabname = ' '.

wa_fieldcat-seltext = 'Status'.

wa_fieldcat-coltext = text-001.

APPEND wa_fieldcat TO it_fieldcat.

6 REPLIES 6

Former Member
0 Kudos

hi ,

you can add icons provided like icon_incomplete, Icon_complete etc to a table control output,ALV output etc..

what you have to do is populate the internal table with required icon which you will get from standard include ICON then show it up in the table control .

I think this anws your Question.

Shyam.

Former Member
0 Kudos

Yes , it is possible.

To display icon in a field ,

set the following properties

out_filed = 'X'

output_only = 'x'

both of thses properties should be checked to display the field values as icon.

Former Member
0 Kudos

<b>Declaraion of internal tab;</b>data: begin of it_ekko occurs 0 .

include structure ekko.

<b> data: icon(4) type c,</b>

end of it_ekko.

<b>while filling the tab_ctrl in PBO</b>.

MODULE fill_tab OUTPUT.

SELECT * FROM ekko INTO TABLE it_ekko.

Loop at it_ekko into wa_ekko.

if wa_ekko-bstyp = 'F'.

<b> wa_ekko-icon = '@10@'.

wa_ekko-zterm = wa_ekko-icon.</b>

modify it_ekko from wa_ekko transporting icon

zterm.

endif.

endloop.

DESCRIBE TABLE it_ekko LINES tab_ctrl-lines.

tab_ctrl-lines = tab_ctrl-lines + 1.

ENDMODULE.

And in the layout set the following properties for the filed ZTERM

<b>output filed</b>

and

<b>output only</b>

Former Member
0 Kudos

HI

YES IT IS POSSIBLE.

DO THE FOLLOWING

1.DECLARE INCLUDE <ICON>.

2.IN YOUR INTERNAL TABLE DECLARE FIELD ICON

icon(4) TYPE c,

3. POPULATE YOUR INTERNAL TABLE WITH APPROPRIATE ICONS BY SELECTING FROM INCLUDE SPECIFIED ABOVE.

EG:

wa2-icon = '@5C@'.

4.PASS IT TO FIELDCAT

wa_fieldcat-fieldname = 'ICON'.

wa_fieldcat-icon = 'X'. " Displayed as Icon

wa_fieldcat-tabname = ' '.

wa_fieldcat-seltext = 'Status'.

wa_fieldcat-coltext = text-001.

APPEND wa_fieldcat TO it_fieldcat.

0 Kudos

This message was moderated.

0 Kudos

>

> Thank You

It took you over 3 years to post a thank you but the most strangest thing is: you ask about table control and give points to someone who is mentioning ALV?