2017 Nov 27 5:12 PM
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
2017 Nov 27 6: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!
2017 Nov 27 5:20 PM
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?
2017 Nov 27 6: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!