Skip to Content
0
Apr 21, 2009 at 06:10 AM

Creation of satic and dynamic buttons in a view

33 Views

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.