cancel
Showing results for 
Search instead for 
Did you mean: 

CL_WD_TABLE_POPIN_TGL_CELL --> how to add to column ??

Former Member
0 Kudos

Hello,

I have created dynamically a table with a popin, because the structure of table in known at runtime. Following the example of WD WDR_TEST_TABLE I have to add a column to my table and add an element to it of type TablePopinToggleCell. I have added dynamically the column and I have created the element. The problem is that I don´t know how to assign the element to the column per code:

DATA: popin_col       TYPE REF TO cl_wd_table_popin_tgl_cell,
        lr_column_name  TYPE REF TO cl_wd_table_column.


* create popin column:
  lr_column_name = 
   cl_wd_table_column=>new_table_column( id = 'COL_POPIN' 
                            SELECTED_CELL_VARIANT = 'TOGGLECELL' ).

* popin toggle cell:
  popin_col ?= 
   cl_wd_table_popin_tgl_cell=>new_table_popin_tgl_cell( id = 'popintogglecell' 
                             VARIANT_KEY = 'TOGGLECELL' ).

* add popin toggle cell to the column:
  lr_column_name-> ???

* Add column to the table:
  lr_table->add_column( the_column = lr_column_name ).

I don´t find in the classe a corresponding method for that task.

can somebody help ?? thanks.

Accepted Solutions (1)

Accepted Solutions (1)

gill367
Active Contributor
0 Kudos

Hello Jorge,

i guess you can add it as a cell variant.

try this.


DATA: popin_col       TYPE REF TO cl_wd_table_popin_tgl_cell,
        lr_column_name  TYPE REF TO cl_wd_table_column,
        cell_var type ref to CL_WD_ABSTR_TABLE_CELL_VAR.


* create popin column:
  lr_column_name =
   cl_wd_table_column=>new_table_column( id = 'COL_POPIN' 
                            SELECTED_CELL_VARIANT = 'TOGGLECELL' ).

* popin toggle cell:
  popin_col ?=
   cl_wd_table_popin_tgl_cell=>new_table_popin_tgl_cell( id = 'POPINTOTOGGLECELL'
                             VARIANT_KEY = 'TOGGLECELL' ).
cell_var ?= popin_col.                                  "<<<<--------------------------------------
* add popin toggle cell to the column:
 lr_column_name->ADD_CELL_VARIANT(
cell_var
  ).

* Add column to the table:
  lr_table->add_column( the_column = lr_column_name ).


thanks

sarbjeet singh

Former Member
0 Kudos

Hi,

thanks, it works.

question: how can I make so that the column is displayed on the left ?? so far it shows up on the right of my table and there´s no way to change this.

gill367
Active Contributor
0 Kudos
lr_column_name->set_fixed_position( '02' ).

to set the column to the left side.

thanks

sarbjeet singh

Answers (0)