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: 

How to add icon to pushbutton?

0 Kudos
451

Hi guys,

i make 16 pushbuttons in screen painter. In PBO i need to set their icon as icon_cancel, but when i tried to use icon_create i can't set icon to pushbutton. Please help.

2 REPLIES 2

Sandra_Rossi
Active Contributor
0 Kudos
311

Is there a reason why you want to do it at runtime? Don't you want to define it statically inside the screen painter?

Sandra_Rossi
Active Contributor
311

Example for dynamic definition, it returns @0V\Qwhatever you want@ hello

 DATA l_icon TYPE string.
 CALL FUNCTION 'ICON_CREATE'
   EXPORTING
     NAME   = 'ICON_OKAY' "icon left-aligned in button
     TEXT   = 'hello' "text right-aligned in button
     INFO   = 'whatever you want' "tooltip
   IMPORTING
     RESULT = l_icon
   EXCEPTIONS
     OTHERS = 3.