cancel
Showing results for 
Search instead for 
Did you mean: 

sorting tables in same view but different tabs

Former Member
0 Kudos

Hi All,

We are having a view called view_table. In this view i have 3 tabs namely tab1, tab2 and tab3. tab1 is the intial screen. All the tabs have different tables table1, table2 and table3.

Now i tried to apply sorting using the regular onsort procedure for all the three tables.

My code is something like this shown below. I have written the code in modifyview.

Problem is for the initial screen modify view is called and sorting happens for the initial screen table (table1). But when i select the tab2 in screen modify view is not being called and so the sorting for table2 and table3 never works. How to solve this problem?

I also tried to called modify view method from selecttab method but unable to call modify view also.

Please help us.

Code as follows.

check first_time = abap_true.

IF seltab = tab2.

  • Name of the table UI element to be provided

wd_table ?= view->get_element( 'TABLE2' ).

wd_this->table_control ?= wd_table->_method_handler.

*Name of the key attribute of the context node to which the table binding is done to be provided

wd_this->table_control->set_key_attribute_name( 'ZBILL_ZREFN' ).

ELSEIF seltab = tab3.

  • Name of the table UI element to be provided

wd_table ?= view->get_element( 'TABLE3' ).

wd_this->table_control ?= wd_table->_method_handler.

*Name of the key attribute of the context node to which the table binding is done to be provided

wd_this->table_control->set_key_attribute_name( 'ZBILL_ZREFN' ).

ELSE.

  • Name of the table UI element to be provided

wd_table ?= view->get_element( 'TABLE1' ).

wd_this->table_control ?= wd_table->_method_handler.

*Name of the key attribute of the context node to which the table binding is done to be provided

wd_this->table_control->set_key_attribute_name( 'ZBILL_ZREFN' ).

ENDIF.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi ,

try if this works :

in the WD DOINIT of ur view write the piece of code , which u r writting in WD DOMODIFY

and for the onSort property of ur table UI , make a event and apply sorting


wd_this->table_control->apply_sorting( ).

regards,

amit