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: 

Change dynamically text and icon of Pushbutton

Former Member
0 Kudos

Hi,

in a screen of my program i have a pushbutton, and i would like to change dynamically the text and icon of it.

Actually, the name of my pushbutton is BTN_VALID, in the PBO i do this :

CONCATENATE c_icon_invalid text-035 INTO btn_valid SEPARATED BY space.

It's not work

Thanks for your help.

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos

The important thing you must do is you must mark the check output only in the screen attributes.

Check this demonstration by Rich

4 REPLIES 4

MarcinPciak
Active Contributor
0 Kudos

Use FM ICON_CREATE


DATA g_button_str TYPE icons-text.

CALL FUNCTION 'ICON_CREATE'
    EXPORTING
      name   = 'ICON_DISPLAY_MORE'
      text   = 'some_text'
      info   = 'some_text'
    IMPORTING
      RESULT = g_button_str.

"now assign to button PA_BUTT
pa_butt = g_button_str.

Regards

Marcin

former_member320332
Contributor
0 Kudos

Hi,

Have you set the Output field attribute for a pushbutton in screen painter ? If it is set then your code of dynamically changing the text should work please check this.

And for icons you can give the icon code in the text.

Reagrds,

Pawan

kesavadas_thekkillath
Active Contributor
0 Kudos

The important thing you must do is you must mark the check output only in the screen attributes.

Check this demonstration by Rich

0 Kudos

Thanks a lot to all, it's work fine.