" define the structure's first component MATERIAL
gs_component-name = 'MATERIAL'.
" create a type description for ABAP dictionary type MATNR (material number) - casting required
gs_component-type ?= cl_abap_elemdescr=>describe_by_name( 'MATNR' ).
APPEND gs_component TO gt_compontents.
How can we write component name as Material and component type as MATNR when we do not the component name and type before hand.
" define the structure's second component MATTEXT
gs_component-name = 'MATTEXT'.
" create a type description for ABAP dictionary type MAKTX (material short text) - casting required
gs_component-type ?= cl_abap_elemdescr=>describe_by_name( 'MAKTX' ).
APPEND gs_component TO gt_compontents.
" create structure's type definition from the component table
How can we write component name as MATTEXT and component type as MAKTX when we do not the component name and type before hand.
Regards,
Marina.