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

How to know program of class

Hello,

How to know the program for a class and methods.

For example in case of function modules,

Main program is function group and each include contains function modules

Similarly how to know the program for a class.

Regards,

Satya

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jan 22, 2008 at 04:30 PM

    Look in view TRDIR. As name enter the name of the class followed by an asterisk. So, ZCL_MYCLASS*. You'll get a list with = signs after the class name, and then the last five characters: CCDEF, CCIMP, CCMAC, CI, CMxxx, CO, CP, CT, CU. Where xxx is alphanumeric.

    Each of these corresponds to components of the class. So ...CI is the private section. The CM are the method implementations etc.

    You can look at these directly in SE38 to find out which bit relates to which other bit.

    But it's not quite the same as the way function groups are done. As far as I can tell, there's no "overall program" which contains these as includes. I do stand to be corrected of course.

    matt

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 22, 2008 at 04:39 PM

    Basically, classes are not contained in one main program like function groups are, there components are spread over many different areas, including table entries and source code implementation. If you would like to programmatically get the source for the public, private and protected sections, then you can do something like this.

    
    REPORT zrich_0001.
    
    DATA source_list TYPE STANDARD TABLE OF string.
    DATA source_line TYPE string.
    DATA includename TYPE program.
    DATA _classname TYPE seoclsname VALUE 'CL_GUI_ALV_GRID'.
    
    
    includename = cl_oo_classname_service=>get_pubsec_name( _classname ).
    READ REPORT includename INTO source_list.
    LOOP AT source_list INTO source_line.
      WRITE:/ source_line.
    ENDLOOP.
    
    includename = cl_oo_classname_service=>get_prosec_name( _classname ).
    READ REPORT includename INTO source_list.
    LOOP AT source_list INTO source_line.
      WRITE:/ source_line.
    ENDLOOP.
    
    includename = cl_oo_classname_service=>get_prisec_name( _classname ).
    READ REPORT includename INTO source_list.
    LOOP AT source_list INTO source_line.
      WRITE:/ source_line.
    ENDLOOP.
    
    includename = cl_oo_classname_service=>get_ccimp_name( _classname ).
    READ REPORT includename INTO source_list.
    LOOP AT source_list INTO source_line.
      WRITE:/ source_line.
    ENDLOOP.
    
    includename = cl_oo_classname_service=>get_ccdef_name( _classname ).
    READ REPORT includename INTO source_list.
    LOOP AT source_list INTO source_line.
      WRITE:/ source_line.
    ENDLOOP.
    
    includename = cl_oo_classname_service=>get_ccmac_name( _classname ).
    READ REPORT includename INTO source_list.
    LOOP AT source_list INTO source_line.
      WRITE:/ source_line.
    ENDLOOP.
    
    

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 04:37 PM

    You might have a look and the SEO* Function Modules as well. They are very handy some times...

    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.