Application Development and Automation 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: 
Read only

NULL reference error ?

former_member194669
Active Contributor
0 Likes
811

All,

I am getting a dump as "Access via 'NULL' object reference not possible" while using the following code


data: g_view_controller type ref to if_wd_view_controller,
      g_fcode           type ref to if_wd_action.
      g_view_controller ?= wd_this->wd_get_api( ).
call method g_view_controller->get_current_action
  receiving
    result = g_fcode.

if g_action->name = 'STD'.
   " dump occurs here
endif.

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
0 Likes
713

Well, on the face of it, it looks like you've not got an instance of g_action. You should have a CREATE OBJECT, or a method that returns a reference which is assigned to g_action.

matt

5 REPLIES 5
Read only

matt
Active Contributor
0 Likes
714

Well, on the face of it, it looks like you've not got an instance of g_action. You should have a CREATE OBJECT, or a method that returns a reference which is assigned to g_action.

matt

Read only

0 Likes
713

Matt,

I forgot to create instance for g_action.

Thanks All for your replies

Read only

Former Member
0 Likes
713

Have you instantiated g_action somewhere else in your code?

Or do you mean to do g_fcode->name?

Read only

Former Member
0 Likes
713

Pl. check whether variable g_action is instantiated or not before use.

From ur code I am not able to understand it.

Regards,

JOy.

Read only

Former Member
0 Likes
713

a®s,

i think this would help you,

Amit.