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

Access via NULL object is not possible

Hi,

I want to retrieve item table using class and its method as given below,but i declared object 'me' as

data : me type ref to /mrss/cl_sge_cl_complex_demand.

CALL METHOD me->/MRSS/IF_SGE_COMPLEX_DEMAND~ITEMS_GET

  • EXPORTING

  • IV_ONLY_DISPO_REL =

  • IV_ALSO_NOT_REL =

  • IV_ONLY_DEL =

  • IV_ONLY_REL =

  • IV_ONLY_ACTIVITY_TYPE_REL =

  • IV_INIT_TECH_DATA = 'X'

RECEIVING

RT_ITEMS = GT_ITEMS

.

i got a short dump with a msg Access via NULL object is not possible

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 17, 2011 at 05:30 AM

    Hi,

    Instance 'me' of the current class will be available by default within 'instance methods'. No need to declare it. When you need a different object instance you should declare it and instantiate(create object) it. In the code above try to remove the declaration or create a new object. This is valid only for 'instance methods'

    Thanks,

    Varun

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Varun,

      I got the solution.

      data:GO_WORKLIST type ref to /mrss/cl_sgd_wroklist_gen.

      CALL METHOD /MRSS/CL_SGD_WORKLIST_GEN=>GET_INSTANCE

      RECEIVING

      RREF_INSTANCE = GO_WORKLIST.

      CALL METHOD GO_worklist->/MRSS/IF_SGE_WORKLIST~DEMAND_OBJ_GET

      EXPORTING

      IV_GUID = GS_DEMAND-GUID

      • IV_WL_REL =

      RECEIVING

      RREF_DEMAND = GO_GET_DEMANDS

      .

      Thanks and Regards,

      Mehar.

  • Posted on Nov 17, 2011 at 01:57 PM

    I guess you should review some important OO concepts like instantiation. CREATE OBJECT statement can just be used if your class has a public instantiation, check it in property tab in class builder.

    Also, method "Get_instance" said above is design pattern to handle these situations when you can't use CREATE OBJECT, it is very know as a "Factory method". It is responsible for the creation of a object for you. So in this case you don't need to know how to create a instance, you just need to know how to ask for it and the class creates it for you.

    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.