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: 

Object reference giving error

Former Member
0 Kudos

Hi experts,

I have a piece of code like this:

DATA: object_ref TYPE REF TO application.

START-OF-SELECTION.

CREATE OBJECT object_ref.

I have created a local class "application".

The program is giving a syntax error: "OBJECT_REF" is not an object reference.

What could be the problem and how to solve it?

Regards,

Ajay.

1 ACCEPTED SOLUTION

former_member376453
Contributor
0 Kudos

Have you declare both definition and implementation for your local class? Make sure that your class definition and implementation both are in place.

Kuntal

4 REPLIES 4

former_member376453
Contributor
0 Kudos

Have you declare both definition and implementation for your local class? Make sure that your class definition and implementation both are in place.

Kuntal

0 Kudos

Hello Kuntal,

Yes, both definition and implementation have been declared.

Regards,

Ajay.

0 Kudos

You can take a look into the below code:


CLASS lcl_user_comm DEFINITION.
* Defination for the local class method
  PUBLIC SECTION.
    METHODS:
** Method for handling Double Click
    double_click    FOR EVENT double_click
                    OF cl_gui_alv_grid
                    IMPORTING e_row
                              e_column
                              es_row_no,
ENDCLASS.


* Class to define and handle own functions
CLASS lcl_user_comm IMPLEMENTATION.
*---------------------------------------------------------------------*
*       METHOD double_click                                           *
*---------------------------------------------------------------------*
* Define the method for double click
  METHOD double_click.
    PERFORM sub_event_double_click
            USING e_row
                  e_column.
  ENDMETHOD.                    "double_click

ENDCLASS.


* Now in the PBO if you declear like this, then it should work.

DATA: lv_event_receiver1 TYPE REF TO lcl_user_comm.

If it doen't work please give your code

Former Member
0 Kudos

to get quick & effective replies, paste ur code pls.

thanq