‎2008 Feb 06 2:05 PM
Hi All,
I got a button in my custom transaction in ABAP. I want to change the text/Label of the button dynamically based on some conditions. How to achieve the same.
Thanks & Regards,
Navneeth K.
‎2008 Feb 06 2:09 PM
Hello,
Declare a global variable in TOP include as gv_pb_text(20). And then have one push button in the screen with name gv_pb_text and then mark it as Output only.
In your PBO, fill gv_pb_text based on your conditions,
IF gv_button_clicked EQ 'X'.
gv_pb_text = 'Start'(001).
ELSE.
gv_pb_text = 'Stop'(002).
ENDIF.
In your USER_COMMAND Module in PAI (or whatever your Fcode handling module is),
WHEN 'STARTSTOP'. "Assuming this pb's function code
IF gv_button_clicked EQ 'X'.
CLEAR gv_button_clicked.
ELSE.
gv_button_clicked = 'X'.
ENDIF.
Cheers,
Vasanth
‎2008 Feb 06 2:09 PM
Hello,
Declare a global variable in TOP include as gv_pb_text(20). And then have one push button in the screen with name gv_pb_text and then mark it as Output only.
In your PBO, fill gv_pb_text based on your conditions,
IF gv_button_clicked EQ 'X'.
gv_pb_text = 'Start'(001).
ELSE.
gv_pb_text = 'Stop'(002).
ENDIF.
In your USER_COMMAND Module in PAI (or whatever your Fcode handling module is),
WHEN 'STARTSTOP'. "Assuming this pb's function code
IF gv_button_clicked EQ 'X'.
CLEAR gv_button_clicked.
ELSE.
gv_button_clicked = 'X'.
ENDIF.
Cheers,
Vasanth
‎2008 Feb 06 2:17 PM
Data: gs_toolbar TYPE stb_button,
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
*----
METHOD to handle_toolbar
*----
METHOD handle_toolbar.
append a separator to normal toolbar
CLEAR gs_toolbar.
MOVE your text TO gs_toolbar-TEXT.
APPEND gs_toolbar TO e_object->mt_toolbar.
Try this.
Thanks & Regards,
Harsha.