Skip to Content
author's profile photo Former Member
Former Member

Change dynamically text and icon of Pushbutton

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Oct 12, 2010 at 02:19 PM

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

    Check this demonstration by Rich

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 12, 2010 at 01:15 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 12, 2010 at 01:22 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.