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 on pushbutton

Former Member
0 Likes
2,428

hi all gurz,

i want to put icon on push button without menu painter,Is there is any property of pushbutton on which i can assign icon name,using include<icons>

or if another way pls! help me.

thank you.

5 REPLIES 5
Read only

former_member194669
Active Contributor
0 Likes
1,369

Hi,


REPORT DEMO_DYNPRO_STATUS_ICONS.

DATA VALUE TYPE I VALUE 1.

DATA: STATUS_ICON TYPE ICONS-TEXT,
      ICON_NAME(20),
      ICON_TEXT(10).

CALL SCREEN 100.

MODULE SET_ICON OUTPUT.

  SET PF-STATUS 'SCREEN_100'.

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.

  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.

  CASE SY-SUBRC.
    WHEN 1.
      MESSAGE E888(BCTRAIN) WITH TEXT-004.
    WHEN 2.
      MESSAGE E888(BCTRAIN) WITH TEXT-005.
    WHEN 3.
      MESSAGE E888(BCTRAIN) WITH TEXT-006.
  ENDCASE.

ENDMODULE.

MODULE CANCEL INPUT.
  LEAVE PROGRAM.
ENDMODULE.

MODULE CHANGE.
CASE VALUE.
    WHEN 1.
      VALUE = 2.
    WHEN 2.
      VALUE = 3.
    WHEN 3.
      VALUE = 1.
  ENDCASE.
ENDMODULE.


aRs

Read only

Former Member
0 Likes
1,369

Hi Pawan

Pushbuttons have a label - the text that you specify statically in the attributes - and can also have icons. If you set the Output field attribute for a pushbutton, you can also set its text dynamically in the ABAP program. To do this, you must create a field in the ABAP program with the same name as the pushbutton. You must then assign the required text to the field before the screen is displayed. You can also assign icons to dynamic texts on pushbuttons by including the icon code in the text. The icon codes are all contained in the include program <ICON>. For example, the ICON_CANCEL () icon has the code @0W@.

regards,

Gaurav

Reward points if helpful

Read only

0 Likes
1,369

>

> Pushbuttons have a label - the text that you specify statically in the attributes - and can also have icons. If you set the Output field attribute for a pushbutton, you can also set its text dynamically in the ABAP program. To do this, you must create a field in the ABAP program with the same name as the pushbutton. You must then assign the required text to the field before the screen is displayed. You can also assign icons to dynamic texts on pushbuttons by including the icon code in the text. The icon codes are all contained in the include program <ICON>. For example, the ICON_CANCEL () icon has the code @0W@.

>

Nice.

How to do not to be view "@xx@" of "@xx@ TEXTLABEL" in button hint?

Read only

Former Member
0 Likes
1,369

hi

good

create push button . created a folder

set the location of icons at the regedit variable:

\hkey_local_machine\software\oracle\ui_icon

set this to "d:\icon"

then forms search the icons files at this directory!

if you have many applications, you can set more than one directory separate by ";" like:

"d:\icon;e:\icon;
my_share_pc\production\icons"

thanks

mrutyun^

Read only

Former Member
0 Likes
1,369

i think no way in menu bar.

selection screen it possable.

see se37

ICON_CHECK

ICON_CREATE

ICON_SHOW

ICON_TRANSLATE

ICON_TRANSLATION_PREPARE