cancel
Showing results for 
Search instead for 
Did you mean: 

Add columns to a table

Former Member
0 Kudos

Hello,

I have a table with 2 columns on my view. The design of the table is statics (drag&drop) and these 2 columns come from data binding (field DataSource).

Now I have to add dynamically more columns at runtime. There´s method

lr_table->add_column( the_column = lr_column_name ).

for that but I do not know how to reference my table using LR_TABLE. I find no method for getting data regarding my table. In other view I created the table dynamically with

lr_table = cl_wd_table=>new_table

What should I do ??

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

you can get the reference to the table UI element in the following way:

lr_table ?= view->get_element( 'TABLE_ID' ). "TABLE_ID is the id of the table UI element you gave in the view

Hope this helps!

Regards,

Srilatha

Answers (1)

Answers (1)

gill367
Active Contributor
0 Kudos



Data lr_table type ref to Cl_wd_table.

lr_table ?= view->get_element( '<Table id>' ).  " pass the table id here


.

P.S. you can get the view instance only in wddomodifyview method.

thanks

sarbjeet singh

Former Member
0 Kudos

ok guys, thanks a lot !!