Application Development 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: 

How to override attributes of one class into another class in OOPS ABAP

Former Member
0 Kudos

I was trying to override attribute(data memeber) defined in super class into subclass ,

but I didnt find any solution to that.

Please tell me ho to do that?

Ex

Class ABC definition

Public section

data : x type i.

.

.

end class

Calss XYZ definition inheriting from ABC.

Publec section.

data : x type i. <<----


here is the problem

..

...

endclass.

2 REPLIES 2

Former Member
0 Kudos

when you define a subclass all the properties of superclass are inherited into class.

You dont need to define it again.

data : x type i " delete this line.

Object of your subclass will be able to recognize x.

Regards,

Lalit Mohan Gupta.

Former Member
0 Kudos

this questione solved ..Forgot to mark answered