Skip to Content
-3

Access to "me" from interface (static class)

Hi,

I have an interface with a number of methods. I also have two classes which implements these interface methods. In class A I want to call the interface-method implementation of the static class B. It works, but inside of the interface method implementation I can't access to the class A "me" to set my variables in class A.

Can someone help me?

Thanks in advance

Add comment
10|10000 characters needed characters exceeded

  • I'm confused about the whole question.

    What is a "static class"?

    I guess your "variables in class A" are attributes; are these instance attributes?

    What are the relationships you defined between A and B (in short, if I understand well, A first operates on B, and then B operates back on A, I am very perplex, is A passed as a parameter to the method to B). Could you explain more in details?

  • Get RSS Feed

1 Answer

  • Best Answer
    Nov 27, 2017 at 06:01 PM

    If you implement the methods of one interface in two classes they become methods of different classes/objects. That's what interfaces are made for (polymorphism).

    Of course you cannot access attributes of class A in the implementation of class B.

    Please try to understand the concept of interfaces first. It's not an ABAP specialty!

    Add comment
    10|10000 characters needed characters exceeded