‎2009 May 07 12:06 PM
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.
‎2009 May 07 12:09 PM
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.
‎2009 May 07 12:13 PM
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
‎2009 May 07 12:25 PM
‎2009 May 07 12:14 PM
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.
‎2009 May 07 12:21 PM
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 ?
‎2009 May 07 12:18 PM
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,
‎2009 May 07 12:19 PM
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,
‎2009 May 07 12:22 PM
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