Application Development and Automation 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: 
Read only

icon change

Former Member
0 Likes
457

Hello Gurus ,

hw to change the Icon of a button in run time (module pool program ) .

regards .

Joy .

Hello Gurus ,

hw to change the Icon of a button in run time (module pool program ) .

regards .

Joy .

1 REPLY 1
Read only

Former Member
0 Likes
398

Hello Joy,

We use the function module for icon creation...

CALL FUNCTION 'ICON_CREATE'

EXPORTING

NAME = ICON_NAME

TEXT = ICON_TEXT

INFO = 'Status'

ADD_STDINF = 'X'

IMPORTING

RESULT = STATUS_ICON

EXCEPTIONS

ICON_NOT_FOUND = 1

OUTPUTFIELD_TOO_SHORT = 2

OTHERS = 3.

use it as follows ...

based on the requirement in PAI or PBO fill the icon_name

CASE VALUE.

WHEN 1.

ICON_NAME = 'ICON_GREEN_LIGHT'.

ICON_TEXT = TEXT-003.

WHEN 2.

ICON_NAME = 'ICON_YELLOW_LIGHT'.

ICON_TEXT = TEXT-002.

WHEN 3.

ICON_NAME = 'ICON_RED_LIGHT'.

ICON_TEXT = TEXT-001.

ENDCASE.

then call the function module and pass them

CALL FUNCTION 'ICON_CREATE'

EXPORTING

NAME = ICON_NAME

TEXT = ICON_TEXT

INFO = 'Status'

ADD_STDINF = 'X'

IMPORTING

RESULT = STATUS_ICON

EXCEPTIONS

ICON_NOT_FOUND = 1

OUTPUTFIELD_TOO_SHORT = 2

OTHERS = 3.

there is a detailed explanation with sample program for status icon given below in the link

http://help.sap.com/saphelp_nw04/helpdata/en/59/348efa61c611d295750000e8353423/content.htm

Pls check and revert

Reward if helpful

Regards

Byju