cancel
Showing results for 
Search instead for 
Did you mean: 

Table Functionalities....

Former Member
0 Kudos

Hi Guys,

I have a requirement with table having functionalities of filtering table-row and making the table-column in ascending order (sorting) having icon on table-column field. Anyone having idea about it? plz, let me know.

Thanks,

Ravin.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi ravin,

In alv we can define functions on the toolbar and each column can be sorted( default ).

Regards,

janakiram.

Former Member
0 Kudos

Hi Jankiram,

Thanks for below help, i know in alv it's possible but any idea about table?

thanks,

Ravin

Former Member
0 Kudos

Hi Ravin,

For Table you have to create seperate buttons and write logic for the functionalities.

Regards

Sarath

Former Member
0 Kudos

hi ravin,

In table we can perform sorting by follwed code.

Declare attribute in attributes tab

table_control type if_wd_table_method_hndl

In modifyview method

data wd_table type ref to cl_wd_table

check first_time = abap_true.

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

wd_this->table_control ?= wd_table->_method_handler.

  • This attribute is the node attribute to which table field is binded.

wd_this->table_control->set_key_attribut_name( 'ATR1' ).

*create an action handler for sort event in table

In Onsort Action handler

wd_this->table_control ->apply_sorting( ).

For creating functions

first create toolbar for the table

then add buttons to the table and at the same time define action also.

this will serve u r requirement

Regards,

janakiram

Former Member
0 Kudos

Hi ravin,

go to the table properties.

there is a events called sort & filter .

write the method for your requirment.

thanks

vijay

Former Member
0 Kudos

Dear Jankiraman,

Whenever, i'm applying your code for sorting it gives me following dump error.

Access via 'NULL' Object reference not possible in the following line although i have already declared TABLE_CONTROL type IF_WD_TABLE_METHOD_HNDL in the attributes tab.

wd_this->table_control ?= wd_table->_method_handler.

Kindly provide me further inputs.

Thanks,

Ravin

former_member515618
Active Participant
0 Kudos

Hi Ravin,

In Debugging mode, do check if wd_this->table_control has null reference.

In wd_table ?= view->get_element( 'TABLE' ). TABLE refers to the Name of the UI element table (In caps)

Regards,

Sravan Varagani

Former Member
0 Kudos

hi ravin,

did u get the refernce of the table control using follwed method

wd_table type ref t cl_wd_table.

wd_table ?=view->get_element( name of the table ).

check this once. I think this might be the problem.

regards,

janakiram.

Former Member
0 Kudos

yes, i did it and provided table name also but during run-time only it's giving error.

Former Member
0 Kudos

hi ravin,

debug the code and tell me the exact statement where it is going to dump.

Give the name of the table in capitals.

Regards,

janakiram.

Edited by: janakiram raju on Mar 4, 2008 7:03 AM

Former Member
0 Kudos

data : wd_table type ref to cl_wd_table.

check first_time = abap_true.

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

upto this it's working fine....

But giving dump at my parent component WDDOMODIFYVIEW method which having view namely VW_VIEW:

wd_this->table_control ?= wd_table->_method_handler.

Former Member
0 Kudos

hi ravin,

write that statment in if statement

if wd_table is not null.

wd_this->table_control ?= wd_table->_method_handler.

endif.

if it goes inside, implies wd_table is having some refrence.

check this once.

Regards,

janakiram.

Former Member
0 Kudos

well, if wd_table is not null was not supported so i changed if wd_table is not initial and tried but it won't go inside, means not having reference....

Former Member
0 Kudos

hi ravin

there is the problem first get the reference.

give the name properly in capitals as in ui element tree.

Regards,

janakiram.