cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the property of UI element

Former Member
0 Kudos

Hi all,

I have an UI element 'submit' of type button which is not enabled,

now i do some calculations and based on the output of the calculation i want to enable the button?

i found out the class CL_WD_BUTTON and method SET_ENABLED for this,

now how do i set the property for this ui element dynamically?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, Gerad,

In you view, there's the WDDOMODIFYVIEW. It has a VIEW parameter. Now, assuming your button is named SUBMIT, you would do something like this:


  data: lr_button type ref to cl_wd_button.

  lr_button ?= view->get_element( 'SUBMIT' ).

  if <condition to enable>.
    lr_button->set_enabled( abap_true ).
  else.
    lr_button->set_enabled( abap_false ).
  endif.

Regards,

Andre

Former Member
0 Kudos

Thanks lot Andre.

Answers (0)