Skip to Content
Former Member
Jul 15, 2009 at 06:33 AM

Dynamic tabstrip with embedded view



my task is to create a tabstrip dynamically and assign a view to a dynamically created tab. I created a tabstrip dynamically:

METHOD wddomodifyview .

  DATA: lr_container TYPE REF TO cl_wd_uielement_container.
  DATA: lr_tabstrip TYPE REF TO cl_wd_tabstrip.
  DATA: lr_tab TYPE REF TO cl_wd_tab.
  DATA: lr_caption TYPE REF TO cl_wd_caption.
  DATA: lr_view_container TYPE REF TO cl_wd_view_container_uielement.

  IF first_time = abap_true.

    lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).

    lr_tabstrip ?= lr_container->get_child(
         id        = 'TABSTRIP' ).

    lr_tab = cl_wd_tab=>new_tab(
                id = 'TAB1'
                view = view ).

        the_tab = lr_tab

    lr_caption = cl_wd_caption=>new_caption(
    id = 'CAPTION'
    view = view
    text = 'TAB1' ).

    lr_tab->set_header( the_header = lr_caption  ).



This works fine. In the next step I want to create a view container UI element and assign it to the TAB1.

Does anyone know how to to this?

The last step woud be that I embed a given view from another component to the created view container. I assume that this can be done as described in the following thread:

Link: [dynamic-reusability-of-components]

Is my assumption correct?

Best Regards, Eddy