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 get all the sub classes of a super class

Former Member
0 Kudos

Hi,

I want to get all the sub classes of a super class programatically.

Please help,

Thanks

vimalraj

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Vimalraj,

cal function SEO_CLASS_GET_ALL_SUBS.

this will give u all the sub classes of a super class.

If you like to use an OO-based approach you can use class CL_OO_CLASS:

code1. Call static method CL_OO_CLASS=>GET_INSTANCE( '<name of class' ).

2. Call instance method go_class->GET_SUBCLASSES[/code]

cheers,

Hema.

3 REPLIES 3

uwe_schieferstein
Active Contributor
0 Kudos

Hello Vimalraj

You are looking for class CL_OO_CASS (for interfaces use CL_OO_INTERFACE).

See also: [Reading inherting classes|;

Regards

Uwe

Former Member
0 Kudos

Hi Vimalraj,

cal function SEO_CLASS_GET_ALL_SUBS.

this will give u all the sub classes of a super class.

If you like to use an OO-based approach you can use class CL_OO_CLASS:

code1. Call static method CL_OO_CLASS=>GET_INSTANCE( '<name of class' ).

2. Call instance method go_class->GET_SUBCLASSES[/code]

cheers,

Hema.

0 Kudos

Hi..

This is my scenario.

I have interface intferface1. Class A implements interface1. class B extends A. Class C etends B.

Through CL_OO_INTERFACE, i m getting class A.

And i am using 'SEO_CLASS_GET_ALL_SUBS' to get all sub classes. But i get only B and i am not getting C.

In that case i need to make a recursive calls, but i dont to do that.

When i ask for sub classes of A, i must get both B and C. is there any way i get?

Please help me.

Thanks