on 09-24-2009 12:17 PM
Hi all,
I have created a table in my WDA application.
I want to add SORTING option for that table.
'That is, it should have the sort symbol in each of the table column and it should get sorted based on the ascending, descending option i choose
How to bring the sorting functionality for each column of the table in WDA
Regards,
Shanthi
hi Shanthi,
for table sorting proceed like this :
1 Go to Attributes Tab, Give TABLE_CONTROL in the Attribute Column , Check the Check Box in the RefTo Column & give IF_WD_TABLE_METHOD_HNDL in the Associated Type. .
2 Then create one Event for onSort Event of the Table by Clicking the Create Button .Then Give the Action Name as ON_TEST_SORT .
3 thn bind ur context node to table in WDDOINIT.
data LO_ND_MARA type ref to IF_WD_CONTEXT_NODE.
data LT_TABLE type WD_THIS->ELEMENTS_NODE.
* Bind Table
LO_ND_NODE->BIND_TABLE( LT_TABLE ).
here NODE is the name of the node to which table is binded
in ur WD DOMDIFY
..
data wd_table type ref to cl_wd_table.
check first_time = abap_true.
* Name of the table UI element to be provided
wd_table ?= view->get_element( 'TABLE' ).
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( 'ATTRIBUTE' ).
HERE ATTRIBUTE is the name of ATTRIBUTE for which u want to apply sorting .
in ur ONACTIONON_TEST_SORT method
..
wd_this->table_control->apply_sorting( ).
I hope it wud solve ur problem
rgds,
amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perhaps you should consider switching from the Table UI element to the ALV component. The ALV has built-in support for sorting - as well as many other features.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.