cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Button-Text and Button-Property-Enabled during runtime

former_member211591
Contributor
0 Kudos

Hi All,

I've got a view with a button triggering action onactiondothis. Button-text is bound to context element ct_text and property enabled is bound to ct_enabled.

onactiondothis calls a method "longmethod()" which takes time.

My aim is to change the button text to "being processed..." and button-property- enabled = abap_false before method longmethod() is called and reset text and property-enabled after longmethod() is finished.

So I implemented following onactiondothis (pseudocode):

method onactiondothis.

- set_attribute ct_text = 'being processed'.   "Part1

- set_attribute ct_enabled = abap_false.      "Part1

- call method longmethod()                           "Part2

- set_attribute ct_text = 'Do This'.                  "Part3

- set_attribute ct_enabled = abap_true.        "Part3

endmethod onactiondothis.

But this does not work!

The attributes in Part1 are beeing set, but I can't see any change on my view unstill on actiondothis is not finished. (I think the view is not beeing refreshed till onactiondothis is finished)

Does anybody have a solution for this?

(I tried another approach too. Displaying a "Please wait" popup till onactiondothis does not work either. Realizing with *->open() before Part2 and *->close() after Part2. )

Thanks for your answers!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ismail,

You can use Timer.

- Change text and activate timer.

- In timer call your long method.

- When your long timed method finished change text and enable button.