cancel
Showing results for 
Search instead for 
Did you mean: 

How to GET/SET column positions for table in webdynpro(not ALV)

Former Member
0 Kudos

Hello

I am displaying a table using webdynpro  ( not alv webdynpro ), then user may change the column positions by drag and drop and he may also hide some columns.

Now after user modifications , say if i click on a buttion, inside the onaction method i want to capture the new positions of the coulumn(so how to get the new column positions ? ) i want to store this in a z table and i want to display the order what he has choosen next time ( so how can i set the column positions ?).

i found some methods in ALV, i also tried with CL_WD_TABLE but nothing works out. Pls help.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

This functionality is already taken care by the Webdynpro Personalization.

Whenever a user changes the column order of a table, it is saved and is reflected when he log in next time.

Warm regards,

Upendra Agrawal

Former Member
0 Kudos

But, I want to do this manually, Because my actual scenario is different.is there any way?

i am doing this as below, But i am getting lt_col as empty.

METHOD WDDOMODIFYVIEW .

*GR_TABLE I have declared as global variable type CL_WD_TABLE
   WD_THIS->GR_TABLE ?= VIEW->GET_ELEMENT( `TABLE` ).
ENDMETHOD.

METHOD ONACTIONGETCOL .
   DATA : LT_COL TYPE CL_WD_TABLE_COLUMN=>TT_TABLE_COLUMN.

   CALL METHOD WD_THIS->GR_TABLE->GET_COLUMNS
     RECEIVING
       THE_COLUMNS = LT_COL.
ENDMETHOD.

amy_king
Active Contributor
0 Kudos

Hi Ramanuja,

I wonder if you would get different results if instead of setting a global reference to the table (wd_this->gr_table) in wddomodifyview, you instead fetch the table reference in the action method...

data lo_view    type ref to if_wd_view.
data lo_table   type ref to cl_wd_table.

* Get a reference to the view, casting to the appropriate interface
   lo_view ?= wd_this->wd_get_api( ).

* Get a reference to the table
   lo_table ?= lo_view->get_element( 'TABLE' ).


* Get the columns

   lt_col = lo_table->get_columns( ).


Cheers,

Amy