Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Access to "me" from interface (static class)

Former Member
0 Kudos
565

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

1 ACCEPTED SOLUTION

retired_member
Product and Topic Expert
Product and Topic Expert
357

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!

2 REPLIES 2

Sandra_Rossi
Active Contributor
0 Kudos
357

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?

retired_member
Product and Topic Expert
Product and Topic Expert
358

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!