Routine to get table line type dynamically

DATA: tabledescr         TYPE REF TO cl_abap_tabledescr,
      structuredescr     TYPE REF TO CL_ABAP_DATADESCR.
 
tabledescr ?= cl_abap_tabledescr=>describe_by_data( table_type ).
 
call method tabledescr->GET_TABLE_LINE_TYPE
     receiving P_DESCR_REF = structuredescr.

ASSERT structuredescr->absolute_name(6) = '\TYPE='.
structure_name = structuredescr->absolute_name+6(30).

Leave a Reply