Page tree
Skip to end of metadata
Go to start of metadata

RTTS (RunTime Type Services) allows to get the definition of variables or to create them during program execution. RTTS is made of 2 components:

  • RTTI (RunTime Type Identification) is used to get the definition of existing variables or existing types
  • RTTC (RunTime Type Creation) is used to create new variables with any definition; they must be followed by the ABAP statement CREATE DATA ... TYPE HANDLE ... to create the variable.

RTTI and RTTC may be called using methods in CL_ABAP_*DESCR classes. Each class have both RTTI and RTTC methods.

Class

RTTI methods

RTTC methods

Attributes

Comments

CL_ABAP_TYPEDESCR
  |
  |
  |
  |
  |

 

describe_by_data
describe_by_data_ref
describe_by_object_ref
describe_by_name

absolute_name
type_kind
length
decimals
kind

describe_by_name allows to get the definition of a DDIC object.
kind represent the general type (elementary, structure, table, reference, class, interface ) while type_kind represents the detailed type (character, string, flat structure, etc.)

  |‑‑CL_ABAP_DATADESCR
  |   |
  |   |
  |   |
  |   |
  |   |

 

 

is_instantiatable
is_read_only
applies_to_data
applies_to_data_ref
get_data_type_kind

 

  |   |‑‑CL_ABAP_ELEMDESCR
  |   |
  |   |
  |   |
  |   |
  |   |
  |   |
  |   |
  |   |
  |   |
  |   |
  |   |

 

get_n
get_c
get_string
get_xstring
get_i
get_f
get_d
get_t
get_x
get_p

edit_mask
help_id
output_length

 

  |   |‑‑CL_ABAP_REFDESCR
  |   |
  |   |
  |   |

get_referenced_type
get_ref_to_data
get_ref_to_object

create

 

Corresponds to variables "type ref to data" and objects "type ref to object"

  |   |‑‑CL_ABAP_COMPLEXDESCR

 

 

 

  |       |‑‑CL_ABAP_STRUCTDESCR
  |       |
  |       |
  |       |

get_components

create

struct_kind
components
has_include

 

  |       |‑‑CL_ABAP_TABLEDESCR
  |
  |
  |
  |
  |

get_table_line_type

create

key
initial_size
key_defkind
has_unique_key
table_kind

 

  |‑‑CL_ABAP_OBJECTDESCR
      |
      |
      |
      |
      |

 

 

interfaces
types
attributes
methods
events

 

      |‑‑CL_ABAP_CLASSDESCR
      |
      |
      |
      |

get_super_class_type
get_friend_types
get_class_name
is_shared_memory_enabled

 

class_kind
create_visibility

 

      |‑‑CL_ABAP_INTFDESCR

get_interface_type
get_type
get_attribute_type
get_method_parameter_type
get_event_parameter_type

 

intf_kind

 

SAP Training : ABAP351

Links

Details:

3 Comments

  1. Former Member

    Hi,

    I have one question, if I have an internal table in my program, which table name is stored in a variable (for example lv_tabname which is a string) how can I describe the table?

    Unfortunately 

    DESCRIBE (lv_tabname) LINES lv_lines.

    Is not working..(syntax error)

    Do you have any idea how to solve this?

    Thanks in advance!

  2. Former Member

    Hi. 

    Try tis syntax.

    DESCRIBE TABLE 'ITAB' LINES lines.

    Where 'ITAB' is a table that you want to describe and lines is variable where you will find number of lines this table.

  3. why we use this RTTS ? in which pupose we will use this concept?