cancel
Showing results for 
Search instead for 
Did you mean: 

Adding tabs dynamically to tabstrip control

Former Member
0 Kudos

Hi,

I am new to ABAP programming and i want to add tabs to tabstrip control dynamically which i declared in layout.please help me out.

Regards,

Kishore.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I do not know when and how want to add tabs to tabstrip. I am going to just outline in general how you could do this in a generic way.

create a attribute to hold your view object. GO_view type ref to if_wd_view.

in the WDDOMODIFYVIEW method get the reference of your view.

if firsttime.
go_view = view.
endif.

Now write a method to add tab to exisiting tab strip.

data:

lo_tab_strip type ref to CL_WD_TABSTRIP.
lo_tab         type ref to cl_wd_tab.

lo_tab_strip ?= go_view->get_element( id = *'fill in the id of the tabstrip'* ).

if lo_tab_strip is bound.
" use static method to create a tab,use importing parameters like ID.
lo_tab = cl_wd_tab=>new_tab( ) .

 lo_tab_strip->add_tab( the_tab = lo_tab)
endif.