cancel
Showing results for 
Search instead for 
Did you mean: 

Creation of satic and dynamic buttons in a view

former_member262988
Active Contributor
0 Kudos

Hi,

I have created a dynamic button using the code..

DATA: lr_container TYPE REF TO cl_wd_uielement_container,
        lr_button TYPE REF TO cl_wd_button.

  CHECK first_time = abap_true.
  lr_container ?= view->get_element( id = 'ROOTUIELEMENTCONTAINER' ).
  cl_wd_matrix_layout=>new_matrix_layout( container = lr_container ).


  lr_button = cl_wd_button=>new_button( id         = 'BUTTON'
                                        text       = 'My Button'
                                        on_action  = 'ACTION' ).


  cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_button ).

  lr_container->add_child( the_child = lr_button ).

its working fine and iam able to see the button .....but when i create another button thorugh layout design its going for dump....whats the reason .?

Cant we create static and dynamic buttons at a time?

Thanks,.

Shailaja Ainala.

View Entire Topic
arjun_thakur
Active Contributor
0 Kudos

Hi Shailaja,

You can have a static and dynamic button in the same view. Make sure that the ID of both the buttons are different. And also make sure that the layout is matix layout , as you are using matix layout in your code to create a button.

If the problem still persists then plz paste the dump message.

Regards

Arjun