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

Object reference giving error

Former Member
0 Likes
1,273

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
Read only

former_member376453
Contributor
0 Likes
906

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
Read only

former_member376453
Contributor
0 Likes
907

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

Kuntal

Read only

0 Likes
906

Hello Kuntal,

Yes, both definition and implementation have been declared.

Regards,

Ajay.

Read only

0 Likes
906

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

Read only

Former Member
0 Likes
906

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

thanq