Skip to Content
author's profile photo Former Member
Former Member

How to get all the sub classes of a super class

Hi,

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

Please help,

Thanks

vimalraj

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 27, 2008 at 09:18 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • Posted on Jan 26, 2008 at 12:57 PM

    Hello Vimalraj

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

    See also: [Reading inherting classes|Reading inherting classes;

    Regards

    Uwe

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.