09-17-2008 11:50 AM
Hi All,
I am getting the below error when the code provided below is getting executed. Am getting error at
call method G_TREE->SET_REGISTERED_EVENTS statement.
The error is
"Access not possible using 'NULL' object reference"
Please refer this code....
EVENT-EVENTID = CL_GUI_SIMPLE_TREE=>EVENTID_NODE_DOUBLE_CLICK.
EVENT-APPL_EVENT = ' '.
append EVENT to EVENTS.
call method G_TREE->SET_REGISTERED_EVENTS
exporting
EVENTS = EVENTS
exceptions
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
ILLEGAL_EVENT_COMBINATION = 3.
set handler
G_APPLICATION->HANDLE_NODE_DOUBLE_CLICK
for G_TREE.
What could be the mistake i am commiting?
09-17-2008 11:56 AM
HI
EVENT-EVENTID = CL_GUI_SIMPLE_TREE=>EVENTID_NODE_DOUBLE_CLICK.
EVENT-APPL_EVENT = ' '.
append EVENT to EVENTS.
call method G_TREE->SET_REGISTERED_EVENTS
exporting
EVENTS = EVENTS
exceptions
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
ILLEGAL_EVENT_COMBINATION = 3.
set handler
G_APPLICATION->HANDLE_NODE_DOUBLE_CLICK
for G_TREE.
I guess you are declaring G_TREE Type Ref To CL_GUI_SIMPLE_TREE.
You need to create and Object
Create object G_TREE before you can use it to call a method
santhosh
09-17-2008 11:56 AM
HI
EVENT-EVENTID = CL_GUI_SIMPLE_TREE=>EVENTID_NODE_DOUBLE_CLICK.
EVENT-APPL_EVENT = ' '.
append EVENT to EVENTS.
call method G_TREE->SET_REGISTERED_EVENTS
exporting
EVENTS = EVENTS
exceptions
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
ILLEGAL_EVENT_COMBINATION = 3.
set handler
G_APPLICATION->HANDLE_NODE_DOUBLE_CLICK
for G_TREE.
I guess you are declaring G_TREE Type Ref To CL_GUI_SIMPLE_TREE.
You need to create and Object
Create object G_TREE before you can use it to call a method
santhosh
09-17-2008 12:19 PM
Thanks Kaluvala. I had put the create object statement after that call method statement.
I am getting error for this statement as well.
SET HANDLER g_application->handle_node_double_click FOR g_tree.
I have declared a class as
CLASS lcl_application DEFINITION DEFERRED.
I created the ref variable for this class.
DATA: g_application TYPE REF TO lcl_application,
I appreciate your previous help. Thanks.
09-17-2008 12:26 PM
Hi,
Always remember if you are using -> it means you are reffering to some method of an object unlike while using => where the method is static or instance-independent
I guess before setting the handle you need to create object for g_application as well
Create Object G_APPLICATION. did you do this?
SET HANDLER g_application->handle_node_double_click FOR g_tree.
santhosh
09-17-2008 12:36 PM