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: 

Table control in custom infotypes

Former Member
0 Kudos

Hi,

I have a requirement to add table control in a custom defined infotype. The fields include two date fields, one icon field, number and name fields. I also need to populate my icon field with three different icons according to the modification in the records of the table control fields.

Please suggest regarding adding icons as a field of the table control and any suggestions about this are welcome.

Thanks in advance,

Saipriya

1 ACCEPTED SOLUTION

former_member31961
Contributor
0 Kudos

Hi,

Use FM 'ICON_CREATE' to add the icon to your table control field. (Give your table control field in Result parameter). Check the demo program DEMO_DYNPRO_STATUS_ICONS to display icon in the screen field.

Hope this helps,

Shrinivas

6 REPLIES 6

former_member31961
Contributor
0 Kudos

Hi,

Use FM 'ICON_CREATE' to add the icon to your table control field. (Give your table control field in Result parameter). Check the demo program DEMO_DYNPRO_STATUS_ICONS to display icon in the screen field.

Hope this helps,

Shrinivas

Former Member
0 Kudos

add this include <icon>.

we have a standard table called icon

go to that table and check which icon u want to display and directly give that icon_name in the table control so that i will display the icon.

0 Kudos

Hi,

I tried out as u said.. using the function module icon_create. The function module works if the field is a input/output field. But I want to create icons in a input/output field in the table control. I tried the same way but a runtime error is coming. Please help me.

Former Member
0 Kudos

Hi Saipriya,

Use FM 'ICON_CREATE' to add the icon to your table control field. (Give your table control field in Result parameter). Check the demo program DEMO_DYNPRO_STATUS_ICONS to display icon in the screen field.

This may be helpful,

thanks,

swaroop

0 Kudos

Hi,

I tried out as u said but am gettin a run time error. I had created a tablecontrol and a field by the name of icon1. when i call the function module icon_create am getting a runtime error. please help me.

This is my coding.

tables: icon.

DATA : icon_name(20) TYPE c,

icon_text(10) TYPE c.

DATA : flag TYPE i.

DATA : icon1 TYPE icon_text.

in flow logic,

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

LOOP AT WI_TABLE1 WITH CONTROL TABLE1.

ENDLOOP.

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0100.

LOOP AT WI_TABLE1.

ENDLOOP.

module icon_pai.

module icon_pai input.

if flag = 1.

icon_name = 'ICON_GREEN_LIGHT'.

icon_text = 'green'.

CALL FUNCTION 'ICON_CREATE'

EXPORTING

name = icon_name

TEXT = icon_text

INFO = 'Status'

ADD_STDINF = 'X'

IMPORTING

RESULT = icon1

EXCEPTIONS

ICON_NOT_FOUND = 1

OUTPUTFIELD_TOO_SHORT = 2

OTHERS = 3

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

endif.

endmodule. " icon_pai INPUT

Please help me out....

Former Member
0 Kudos

Hi

we have a standard table ICON

In the program use this as an include.

In the data browser go to that particular table and check which icon best suits ur requirement and use it.

In ur program give the relevant icon name in the table control u are using so that the icon will be displayed.

Hope this helps you.

reward if useful.

regs

krish