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

Module Pool - Push Button text change

Former Member
0 Likes
1,844

Hi All,

According to the requirement, I need to change the text of the push button, can anybody help me to achieve this.

PUSHBUTTON text as 'NEW' by defult and when it is pushed once, PUSHBOTTON text should be as 'MODIFY'. I do not want to add or disabled button. Can we change the text dynamically.

Thanks in advance.

8 REPLIES 8
Read only

former_member195383
Active Contributor
0 Likes
1,184

you can not change the text dynamically,

one thing that can be done is,

you create another push button, with a different name.

then you display any of the push button, as per the requirement.

Read only

Former Member
0 Likes
1,184

You can do it very well.

Check the options in pushbutton where you can write comments.

assign that as sy-ucomm, bring the control to program again, change the text as per your requirement, pass the same fields to pushbutton comments.

Hope this would give you some idea to approach to the assignment.

Regards,

BabuSrinath

Read only

0 Likes
1,184

BabuSrinath,

can you please explain in detail the process.

Read only

Former Member
0 Likes
1,184

Hi

we can change push button text dynamically.

look into below example, here TB_HEADER is push button name in the screen layout

LOOP AT SCREEN.

IF screen-name = 'TB_HEADER'.

CLEAR wa_sctx.

READ TABLE tb_sctx INTO wa_sctx WITH KEY tech_name = screen-name

BINARY SEARCH.

IF sy-subrc EQ 0.

tb_header = wa_sctx-dfe_feild_desc.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

Read only

0 Likes
1,184

Lavanya,

CLEAR wa_sctx.

READ TABLE tb_sctx INTO wa_sctx WITH KEY tech_name = screen-name

BINARY SEARCH.

IF sy-subrc EQ 0.

tb_header = wa_sctx-dfe_feild_desc.

MODIFY SCREEN.

ENDIF.

What is tb_sctx ? where do we define TB_HEADER in the program ?

Read only

Former Member
0 Likes
1,184

Hi Friend,

You can do it.

where you can write comments as per requirment ,check pushbutton options,

assign sy-ucomm, get the control to program again, change the text as per your requirement, pass the same fields to pushbutton comments.

Regards,

Read only

Former Member
0 Likes
1,184

Hi Friend,

You can do it.

where you can write comments as per requirment ,check pushbutton options,

assign sy-ucomm, get the control to program again, change the text as per your requirement, pass the same fields to pushbutton comments.

Regards,

Read only

Former Member
0 Likes
1,184

Create Button>Give a Name>Group Name.

IN PAI.

SET FLAG = 'X'.

In PBO.

IF Flag = 'X'.
<Pushbutton Name> = 'NEW'.                  " Change the Display name of button

Loop at screen.
If Screeen-Group1 = 'AA'.
Screen-Invisible = 1.
ENDIF.
Modify Screen.
ENDloop.
ENDIF.

Regards,

Gurpreet