08-22-2006 2:01 PM
Hi,
How can i Change the ICON of Button in Module Pool dynamically in my program.While designing screen, in Button attribute I have assigned an ICON. But in my program if some condition is satisfied I need to change the ICON of the same button.
Thanks,
Santosh S.
08-22-2006 8:56 PM
First, create the button on the screen. Give a name like 'THISBUTTON' in the name field of the button(not the text field), click the OUTPUT Only checkbox. Now, in your ABAP program, define a field for this button that you created and set the value of the icon in the PBO.
* In this sample program, there is a button on screen 100
* which has the name of THISBUTTON, and is set as output
* only.
report zrich_0001.
<b>type-pools: icon.
data: thisbutton(30) Type c.</b>
call screen 100.
*&---------------------------------------------------------------------*
*& Module status_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module status_0100 output.
<b>write icon_green_light as icon to thisbutton.
concatenate thisbutton 'This is the button' into thisbutton
separated by space.</b>
endmodule. " status_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module user_command_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module user_command_0100 input.
leave program.
endmodule. " user_command_0100 INPUT
Please be sure to award points for helpful answer and mark as solved when solved completely. thanks.
Regards,
Rich Heilman
08-22-2006 8:49 PM
Hi,
use the ICON_CREATE FM to change the ICON dynamically..
Thanks,
Naren
08-22-2006 8:56 PM
First, create the button on the screen. Give a name like 'THISBUTTON' in the name field of the button(not the text field), click the OUTPUT Only checkbox. Now, in your ABAP program, define a field for this button that you created and set the value of the icon in the PBO.
* In this sample program, there is a button on screen 100
* which has the name of THISBUTTON, and is set as output
* only.
report zrich_0001.
<b>type-pools: icon.
data: thisbutton(30) Type c.</b>
call screen 100.
*&---------------------------------------------------------------------*
*& Module status_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module status_0100 output.
<b>write icon_green_light as icon to thisbutton.
concatenate thisbutton 'This is the button' into thisbutton
separated by space.</b>
endmodule. " status_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module user_command_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module user_command_0100 input.
leave program.
endmodule. " user_command_0100 INPUT
Please be sure to award points for helpful answer and mark as solved when solved completely. thanks.
Regards,
Rich Heilman
04-09-2012 2:44 AM
Hi Rich,
This works correctly for normal button.
Is it possible to change text of pushbuttons in a table control dynamically.
Please let me know.
Regards,
Ravi