Skip to Content
0
Former Member
Apr 05, 2013 at 10:04 AM

Casting error: structdescr ?= typedescr when function imports table as "type table"

362 Views

Hello all,

i made a function with importparamter it_data_table type table. Now i like to get the components table but i get allways a casting error. The code runs if i declare a locel internal table to get the components table. Is the function parameter "type table" an other internal DDIC type?

*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IP_VARIANT) TYPE DISVARIANT
*" REFERENCE(IT_DATA_TABLE) TYPE TABLE
*" EXPORTING
*" REFERENCE(EB_FILE_EXPORTED) TYPE BOOLEAN

Data:

lr_struct_descr_data TYPE REF TO cl_abap_structdescr.

lt_components_data TYPE cl_abap_structdescr=>component_table,

lr_struct_descr_data ?= cl_abap_typedescr=>describe_by_data( it_data_table ). ">>> casting error
lt_components_data = lr_struct_descr_data->get_components( ).

Has anybody an idea?

Thanks, Wolfgang