SAP® Documentation

Single view

CL_ABAP_STRUCTDESCR - Runtime Type Services

rdisp/max_wprun_time - Maximum work process run time   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This final class is used to describe and create structures. There is a single type description object for each defined structure.

Relationships

CL_ABAP_TYPEDESCR
  |
  |--CL_ABAP_DATADESCR
  |    |
  |    |--CL_ABAP_ELEMDESCR
  |    |--CL_ABAP_REFDESCR
  |    |--CL_ABAP_COMPLEXDESCR
  |         |
  |         |--CL_ABAP_STRUCTDESCR
  |         |--CL_ABAP_TABLEDESCR
  |
  |--CL_ABAP_OBJECTDESCR
       |
       |--CL_ABAP_CLASSDESCR
       |--CL_ABAP_INTFDESCR

Example

REPORT typedescr_test.

TYPES:
  BEGIN OF my_struct,
    comp_a type i,
    comp_b type f,
  END OF my_struct.

DATA:
  my_data   TYPE my_struct,
  descr_ref TYPE ref to cl_abap_structdescr.

FIELD-SYMBOLS:
  <comp_wa> TYPE abap_compdescr.

START-OF-SELECTION.
  descr_ref ?= cl_abap_typedescr=>describe_by_data( my_data ).

  WRITE: / 'Typename     :', descr_ref->absolute_name.
  WRITE: / 'Kind         :', descr_ref->type_kind.
  WRITE: / 'Length       :', descr_ref->length.
  WRITE: / 'Decimals     :', descr_ref->decimals.
  WRITE: / 'Struct Kind  :', descr_ref->struct_kind.
  WRITE: / 'Components'.
  WRITE: / 'Name              Kind   Length   Decimals'.
  LOOP AT descr_ref->components ASSIGNING <comp_wa>.
    WRITE: / <comp_wa>-name, <comp_wa>-type_kind,
             <comp_wa>-length, <comp_wa>-decimals.
  ENDLOOP.

Notes

None

Further information

Classes:
  CL_ABAP_DATADESCR
  CL_ABAP_COMPLEXDESRC
  CL_ABAP_OBJECTDESCR
  CL_ABAP_TYPEDESCR
  CL_ABAP_REFDESCR
  CL_ABAP_ELEMDESCR
  CL_ABAP_TABLEDESCR
  CL_ABAP_CLASSDESCR
  CL_ABAP_INTFDESCR






RFUMSV00 - Advance Return for Tax on Sales/Purchases   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

Length: 2965 Date: 20190626 Time: 122922     sap01-206 ( 20 ms )

Our Service

Looking for Support? Questions?

The

Consolut

Callback-Service

Leave us your contact details and we will call you back. Panels marked with * are mandatory.