Skip to Content
-2

Issue while instantiating object of abstract class

Hi All,

I am stuck in this issue. I have two classes -

class 1 - which is an abstract class

class 2 - my class where i want to call a method ( "setup ") of class 1.

I cannot make class 1 as the super class of class 2, as I have already another super class.

I have done this till now -

1. Created an object of class 1 in class 2.

mr_set type ref to "class 1".

mr_set->setup( ). or

CALL METHOD mr_set->setup.

this gives me an error - Method "SETUP" is unknown or PROTECTED or PRIVATE.

2. Then i tried to declare class 2 in the "friend" list of class 1.

this does not give me any error. But in debug mode, it raises some kind of exception.

Can anyone please help me with it.

Thanks

Meenakshi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 12, 2017 at 07:49 AM

    "I have done this till now -

    1. Created an object of class 1 in class 2. "

    How that? You cannot create objects of abstract classes.

    "this gives me an error - Method "SETUP" is unknown or PROTECTED or PRIVATE."

    How and where is setup declared?

    "Can anyone please help me with it."

    No, ABAP has no means to overcome these limitations.

    Add comment
    10|10000 characters needed characters exceeded