cancel
Showing results for 
Search instead for 
Did you mean: 

Filter inside Tble UI element

former_member206441
Contributor
0 Kudos

Dear Experts,

Im having two columns in my table and im using filter in my table, In onfilter event i written the code

wd_this->table_control->apply_filter( ).

And in the table column i enabled the isFiltered option and i also binded the filtervalue to a variable of type string.

when i execute my program and give input in filter field the following error occurs,

The following error text was processed in the system EBP : Access via 'NULL' object reference not possible.

The error occurred on the application server kaar-server15_EBP_00 and in the work process 1 .

The termination type was: RABAX_STATE

The ABAP call stack was:

Method: ONACTIONONFILTER of program /1BCWDY/6CS8GWLR56619XU3FP87==CP

Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/6CS8GWLR56619XU3FP87==CP

Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP

Method: IF_WDR_ACTION~FIRE of program CL_WDR_ACTION=================CP

Method: DO_HANDLE_ACTION_EVENT of program CL_WDR_WINDOW_PHASE_MODEL=====CP

Method: PROCESS_REQUEST of program CL_WDR_WINDOW_PHASE_MODEL=====CP

Method: PROCESS_REQUEST of program CL_WDR_WINDOW=================CP

Method: EXECUTE of program CL_WDR_MAIN_TASK==============CP

Method: IF_WDR_RUNTIME~EXECUTE of program CL_WDR_MAIN_TASK==============CP

Method: HANDLE_REQUEST of program CL_WDR_CLIENT_ABSTRACT_HTTP===CP

please help me to sort out this problem

Thanks & Regards

Arun.P

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You must not have defined wd_this->table_control

You need to do this in WDDOMODIFY and get table control in global variable as follows:


  CHECK first_time EQ abap_true.

**Get table handler for table from view
  DATA: l_table TYPE REF TO cl_wd_table.

* Get reference of the table view element
  l_table ?= view->get_element( 'TBL_MAIN' ).

* Get reference to the Filter & Sorting API
  wd_this->table_control ?= l_table->_method_handler.

Hope this helps!

Thanks,

Tejaswini

Edited by: Tejaswini Chafekar on Aug 27, 2009 2:53 PM

former_member206441
Contributor
0 Kudos

Hi Tejaswini,

i used ur code, i got the same error without checking the filter condition.

Thanks & Regards

Arun.P

Former Member
0 Kudos

Hi,

When you debug in filter action. Can you tell me, wd_this->table_control is initial or not?

Error Access via 'NULL' object reference not possible. comes only when it is not defined.

Thanks,

Tejaswini

former_member206441
Contributor
0 Kudos

Hi Tejaswini,

Thanks for ur reply wd_this->table_control is initial.

any suggestion to clear that?

Thanks & Regards ,

Arun.P

Former Member
0 Kudos

Hi,

It is clear that means, it has not get defined.

To define it you need to use the logic in WDDOMODIFY.


  CHECK first_time EQ abap_true.      "Only for first time, get table's handler in global variable
 
**Get table handler for table from view
  DATA: l_table TYPE REF TO cl_wd_table.
 
* Get reference of the table view element
  l_table ?= view->get_element( 'TBL_MAIN' ).    "Name of Table UI element
 
* Get reference to the Filter & Sorting API
  wd_this->table_control ?= l_table->_method_handler.

This way, you will get Table's Handler and it will not dump.

Thanks,

Tejaswini

former_member206441
Contributor
0 Kudos

Hi Tejaswini,

Thanks for ur reply, i solved the problem the code mentioned by you in the previous post is working fine.

Thanks & Regards

Arun.P