Skip to Content
avatar image
Former Member

Add columns to a table

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 ??

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 10, 2011 at 04:52 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 10, 2011 at 05:07 PM
    
    
    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

    Add comment
    10|10000 characters needed characters exceeded