Skip to content

Instantly share code, notes, and snippets.

@viniciustavanoferreira
Created May 21, 2013 17:42
Show Gist options
  • Save viniciustavanoferreira/5621716 to your computer and use it in GitHub Desktop.
Save viniciustavanoferreira/5621716 to your computer and use it in GitHub Desktop.
Run Time Type Identification (example).
*&---------------------------------------------------------------------*
*& Report Z_RTTI_VTF
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_RTTI_VTF.
TYPES in_type TYPE i.
DATA: in_var TYPE in_type,
descr_ref TYPE ref to cl_abap_typedescr.
START-OF-SELECTION.
descr_ref = cl_abap_typedescr=>describe_by_data( in_var ).
WRITE: / 'Nome de tipo absoluto:', descr_ref->absolute_name.
WRITE: / 'Categoria de dado:', descr_ref->type_kind.
WRITE: / 'Tamanho:', descr_ref->length.
WRITE: / 'Decimais:', descr_ref->decimals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment