Wednesday, September 21, 2016

Runtime Type Services (RTTS)

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

No comments:

Post a Comment

SAP giới thiệu mã hỗ trợ AI trong ngôn ngữ ABAP riêng của mình

SAP đã ra mắt một loạt tính năng mã hỗ trợ AI trong môi trường phát triển ứng dụng dựa trên đám mây của mình, đồng thời tham gia vào danh sá...