Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

error regarding events

Former Member
0 Kudos

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?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

Thanks for your help