2008 Dec 03 12:21 PM
hi friends ,
I wanna to place a command with the icon changing when the status changed .Pls show me how .Thks .
hi friends ,
I wanna to place a command with the icon changing when the status changed .Pls show me how .Thks .
2008 Dec 03 1:09 PM
Hello,
based on your criteria pass the icon name to Function Module as shown below.
I have just created an example program.
let the declaration of wa_vbrp-icon be type string.
loop at it_vbrp into wa_vbrp.
if wa_vbrp-posnr = '000020'.
v_name = 'ICON_GREEN_LIGHT'.
else.
v_name = 'ICON_YELLOW_LIGHT'.
endif.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
NAME = v_name
IMPORTING
RESULT = wa_vbrp-icon
EXCEPTIONS
ICON_NOT_FOUND = 1
OUTPUTFIELD_TOO_SHORT = 2
OTHERS = 3.
modify it_vbrp from wa_vbrp index sy-tabix.
endloop.
Please note that the output parameter should be input disabled or else you will get the native format instead of the icon
Hope this helps.
Regards,
Ravi Kiran
2008 Dec 04 7:29 AM
I try it ,but failed .I don't know how to display the icon in the command .but i get it in text not in graphic .
2008 Dec 04 7:46 AM
Hi,
What do you mean by command? In table control you can make one of your column for displaying the ICON. Create a column of type Text field. Give a name to this field.
Give a name exmaple, your internal table is IT_STATUS and field name is ICON.
Loop at IT_STATUS into WA_STATUS.
if WA_STATUS-STATUS = 'X'.
WA_STATUS-ICON = 'ICON_GREEN_LIGHT'. "U can use ICON_CREATE fm also
else.
WA_STATUS-ICON = 'ICON_RED_LIGHT'.
endif.
This code should be written in PBO of the screen. The screen field should be given the name WA_STATUS-ICON.
Thanks,
Lakshmi
Edited by: Santhanalakshmi V on Dec 4, 2008 1:16 PM
2008 Dec 04 8:13 AM
2008 Dec 04 1:12 PM
As earlier told to you.
Make the field input disabled , then you would be able to see the image and not the text.
Regards,
Ravi Kiran
2008 Dec 04 1:48 PM
I'm afraid I couldn't undstand the way to sovle this promble ,for the field is not inputable at all .So as if it missed again .I want to diplay a command with the icon changed when the status changed .Someone told me the way using FM 'ICON_CREATE' .yes ,it seems suitable ,but when I try it ,it diplay the text on the button ,not the icon itself . I dont know whether there is somthing wrong with my declaration for the variable .
2008 Dec 05 6:17 AM
hI jACK
I am trying to get it .
as these text store in the table D021T and able to modify the table where the text can be modified to the ICON from PUSHBUTTON.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
DATA RESULT(60).
LOOP AT SCREEN.
IF screen-name = 'BB'.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = 'ICON_GREEN_LIGHT'
TEXT = ' '
INFO = ' '
ADD_STDINF = 'X'
IMPORTING
RESULT = RESULT
EXCEPTIONS
ICON_NOT_FOUND = 1
OUTPUTFIELD_TOO_SHORT = 2
.
UPDATE D021T SET DTXT = RESULT WHERE PROG = 'ZMTEST_99'.
MODIFY SCREEN.
endif.
ENDLOOP.
ENDMODULE. " STATUS_0100 OUTPUT
still i am trying .
I will come back to you.
Regards
Ramchander Rao.K
2008 Dec 05 8:10 AM
2009 Mar 05 9:47 AM
Hi
If your program displays the text (icon-name) instead of the icon,
you have to change the field-type from CHAR to STRG in the dynpro.
Best regards
2008 Dec 04 8:28 AM
Hi
Use the FM ICON_CREATE
pass 'icon_green_light' to the FM you will get the icon displayed
take the help of KEY word documenation on ICON key word there is an example tooo
regards
Ramchander Rao.K
Edited by: ramchander krishnamraju on Dec 4, 2008 9:30 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |