Skip to Content
author's profile photo Former Member
Former Member

how to handle an error while using classes.

Hi gurus,

when i tried to copy the code from function module into report and execute it, it is giving some error message as

Error: components of classes declared using u201CCLASSLCL_TREE_EVENT_HANDLER

DEFINITION DEFERREDu201D can only be accessed after you have defined the class

(CLASS LCL_TREE_EVENT_HANDLER DEFINITION)..

i included the declarations include and forms include which are standards.

i copied the function module 'HR_CH_PERS_FILE' to get the employee infotype details in tree structure.

thank you..

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Sep 02, 2008 at 07:49 AM

    Hi,

    You must put the INCLUDE that contains the class object instantiation code (CREATE OBJECT) after the INCLUDE which contains the CLASS DEFINITION.

    This error is coming due to the fact the your program is trying to create an instance of the class whose definition is not found at the time of the instantiation.

    That is

    Before you write

    DATA obj TYPE REF TO cl_XXXxx.

    CREATE OBJECT obj.

    You need to have

    CLASS cl_XXXxx DEFINITION.

    ENDCLASS.

    Best Regards,

    Sesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2008 at 08:25 AM

    thanks

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.