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

How to change push button text dynamically

Former Member
0 Likes
5,430

Hi Experts,

Is there any way by which i can change the push button text dynamically in module pool progrramming.

Thanks

Yogesh Gupta

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,156

In  PBO,

IN PBO you can give text  and in PAI you can clear it ,its simple

IF gd_print EQ 'X'.

  gd_text = text-001.

ELSE.

  gd_text = text-002.

else.

ENDIF.

In  USER_COMMAND Module in PA I,

  WHEN 'PRINT'. "

    IF gd_print EQ 'X'.

      CLEAR gd_print.

    ELSE.

      gd_print = 'X'.

    ENDIF.

5 REPLIES 5
Read only

Former Member
0 Likes
2,156

Hi Yogesh,

You can change the text on a pushbutton dynamically. To do this, you must have set the Output field attribute in the Screen Painter to active, and created a global field with the same name in your ABAP program. Because the Screen Painter field and the program field have the same name, any changes to the field contents will be immediately visible on the screen (similarly to input/output fields).

You can write similar code in ur PBO.

g_button1 = 'TEST'.

if v_click eq 'X'.

loop at screen.

if screen-name eq 'G_BUTTON1'.

g_button1 = 'NAVEEN'.

clear v_click.

endif.

endloop.

endif.

Initially TEST will be displayed on pushbutton. based on ur action it will be changed to NAVEEN.

Hope it clarifies your doubt.

Let me know if you need any other inputs.

Regards,

Naveen Veshala

Read only

Former Member
Read only

Former Member
0 Likes
2,156

Answered

Read only

Former Member
0 Likes
2,156

Please check this post, you will definitely get it..

http://theabap.blogspot.in/2013/06/changing-label-of-push-button.html

Read only

Former Member
0 Likes
2,157

In  PBO,

IN PBO you can give text  and in PAI you can clear it ,its simple

IF gd_print EQ 'X'.

  gd_text = text-001.

ELSE.

  gd_text = text-002.

else.

ENDIF.

In  USER_COMMAND Module in PA I,

  WHEN 'PRINT'. "

    IF gd_print EQ 'X'.

      CLEAR gd_print.

    ELSE.

      gd_print = 'X'.

    ENDIF.