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

Access not possible using 'NULL' object reference.

Former Member
0 Likes
407

What is this abend telling me exactly? Anybody know?

Thank-You

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
373

Hello

An instance method of a class has been called but the reference variable did not contain any instance, e.g.:


DATA: go_myclass    TYPE REF TO zcl_myclass.  " has instance method display

START-OF-SELECTION.

  CALL METHOD go_myclass->display( ).  " error because go_myclass not yet instantiated

" Replaced by:
  CREATE OBJECT go_myclass.
  CALL METHOD go_myclass->display( ).  " Now it works

" Or:

  CHECK ( go_myclass IS BOUND ).  " available on release >= 6.20
  CALL METHOD go_myclass->display( ).

Regards

Uwe

1 REPLY 1
Read only

uwe_schieferstein
Active Contributor
0 Likes
374

Hello

An instance method of a class has been called but the reference variable did not contain any instance, e.g.:


DATA: go_myclass    TYPE REF TO zcl_myclass.  " has instance method display

START-OF-SELECTION.

  CALL METHOD go_myclass->display( ).  " error because go_myclass not yet instantiated

" Replaced by:
  CREATE OBJECT go_myclass.
  CALL METHOD go_myclass->display( ).  " Now it works

" Or:

  CHECK ( go_myclass IS BOUND ).  " available on release >= 6.20
  CALL METHOD go_myclass->display( ).

Regards

Uwe