on 09-24-2008 1:20 PM
Hi,
I'm doing a sorting in my table.
I want to know what is the propose of the method set_key_attribute_name of the interface IF_WD_TABLE_METHOD_HNDL ?
What parameter do I have to pass?
Thanks a lot.
Hi Jorge,
This method is used to specify the name of the column based on which you want to sort the table data.
So suppose you chose to sort the data by field MEINS then the table would sort the unit of measurement column in ascending/descending. The rest of the columns wouldn't be in sorted order. Below is an extract of the same coding. Hope that this answers your question.
Regards,
Uday
(table_control is an view attribute of type CL_WD_TABLE & the reference of the table has been saved in to it in the WDDOMODIFYVIEW method)
METHOD wddomodifyview .
DATA wd_table TYPE REF TO cl_wd_table.
CHECK first_time = abap_true.
wd_table ?= view->get_element( 'TABLE_ELEMENT' ).
wd_this->table_control ?= wd_table->_method_handler.
wd_this->table_control->set_key_attribute_name( 'MATNR' ).
ENDMETHOD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jorge,
On the top of every column in the table you will have a small triangle displayed for you. You will just have to click on this to switch between ascending/descending orders. However note that it would work properly only for the column on which you had set as the key attribute using set_key_attribute_name.
Regards,
Uday
I want to do this (ascending/descending orders) in code.
"However note that it would work properly only for the column on which you had set as the key attribute using set_key_attribute_name."
Uday,
The sorting is working fine for all columns, not only for that I set as the key attribute. I haven't understood the method set_key_attribute_name yet.
Thanks.
column name
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.
Hi Jorge,
This method is used to sort the table contents according to the attribute which you will be passing to the parameter attribute_name of the method.
Regards...
Arun.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
check some of the sample components
HRRCF_C_APPLICATIONS_UI
HRRCF_C_JOB_FAVO_UI
HRRCF_C_SEARCH_UI
that method is used in views
Thanks
Bala Duvvuri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
pass the coloum id (attribute name)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.