<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Introspection/reflection of a class or function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/introspection-reflection-of-a-class-or-function-module/m-p/2217080#M475511</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure,  check this out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

REPORT zrich_0003
       LINE-SIZE 200.


DATA: l_dref  TYPE REF TO cl_abap_typedescr.
DATA: l_clref  TYPE REF TO cl_abap_classdescr.
DATA: x_attributes TYPE abap_attrdescr.

CONSTANTS: query_class TYPE seoclsname
                    VALUE 'CL_GUI_ALV_GRID'.

* check if query_class exists in the current system
CALL METHOD cl_abap_classdescr=&amp;gt;describe_by_name
  EXPORTING
    p_name         = query_class
  RECEIVING
    p_descr_ref    = l_dref
  EXCEPTIONS
    type_not_found = 1
    OTHERS         = 2.
IF sy-subrc &amp;lt;&amp;gt; 0.
  EXIT.
ENDIF.

l_clref ?= l_dref.

LOOP AT l_clref-&amp;gt;attributes INTO x_attributes.

  WRITE:/ x_attributes-name,
           x_attributes-type_kind,
           x_attributes-length,
           x_attributes-visibility.

ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 May 2007 23:36:08 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2007-05-04T23:36:08Z</dc:date>
    <item>
      <title>Introspection/reflection of a class or function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/introspection-reflection-of-a-class-or-function-module/m-p/2217079#M475510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way of performing introspection on classes or function modules in ABAP? For example, I would need a piece of code that gets the attributes and their types of a class that was defined in the class builder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Philon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 23:25:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/introspection-reflection-of-a-class-or-function-module/m-p/2217079#M475510</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T23:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Introspection/reflection of a class or function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/introspection-reflection-of-a-class-or-function-module/m-p/2217080#M475511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure,  check this out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

REPORT zrich_0003
       LINE-SIZE 200.


DATA: l_dref  TYPE REF TO cl_abap_typedescr.
DATA: l_clref  TYPE REF TO cl_abap_classdescr.
DATA: x_attributes TYPE abap_attrdescr.

CONSTANTS: query_class TYPE seoclsname
                    VALUE 'CL_GUI_ALV_GRID'.

* check if query_class exists in the current system
CALL METHOD cl_abap_classdescr=&amp;gt;describe_by_name
  EXPORTING
    p_name         = query_class
  RECEIVING
    p_descr_ref    = l_dref
  EXCEPTIONS
    type_not_found = 1
    OTHERS         = 2.
IF sy-subrc &amp;lt;&amp;gt; 0.
  EXIT.
ENDIF.

l_clref ?= l_dref.

LOOP AT l_clref-&amp;gt;attributes INTO x_attributes.

  WRITE:/ x_attributes-name,
           x_attributes-type_kind,
           x_attributes-length,
           x_attributes-visibility.

ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 23:36:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/introspection-reflection-of-a-class-or-function-module/m-p/2217080#M475511</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-05-04T23:36:08Z</dc:date>
    </item>
  </channel>
</rss>

