Skip to content

Instantly share code, notes, and snippets.

@rijdz
Created March 13, 2019 02:11
Show Gist options
  • Save rijdz/a39013cfd854dc7334e1b9ee22ccab70 to your computer and use it in GitHub Desktop.
Save rijdz/a39013cfd854dc7334e1b9ee22ccab70 to your computer and use it in GitHub Desktop.
DATA: LO_STRUCT TYPE REF TO CL_ABAP_STRUCTDESCR,
lo_type type ref to cl_abap_typedescr.
data: gI_COMP TYPE ABAP_COMPONENT_TAB.
"Get list of structure
LO_STRUCT ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA( imi_table ).
gI_COMP = LO_STRUCT->GET_COMPONENTS( ).
"Get type of element
clear lo_type.
LO_type ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA( <fs_value> ).
lv_datatype = LO_type->absolute_name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment