Skip to Content
0
Former Member
Aug 12, 2007 at 11:37 AM

How insert a Group into RootUIElement dynamically?

13 Views

Hi,

how is it possible to add a dynamically created UI Element (Group) to ROOTUIELEMENTCONTAINER? I try it with the following piece of code but i get always the error message: <b> Access via 'NULL' object reference not possible. </b>

  IF FIRST_TIME EQ ABAP_TRUE.

    DATA: lr_root TYPE REF TO cl_wd_uielement_container,
          lr_groupbox TYPE REF TO cl_wd_group.
                                
    lr_root ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).

    lr_groupbox ?= cl_wd_group=>new_group( id = 'GROUP' ).

    cl_wd_flow_data=>new_flow_data( lr_groupbox ).

    lr_root->add_child( lr_groupbox ).

  ENDIF.

What is my mistake?

regards,

Sharam

Message was edited by:

Sharam Pourmir