07-31-2009 10:13 AM
Hi all,
Let's say that I've defined internal table based on internal type (not in dictionary). Does anybody know if there is some FM that could return to me definition of that table (how many fields, their types and so on). For dictionary based type there is a lot of these FM starting with "DD*". Is there anything like that for internal tables?
BR
Marcin
07-31-2009 10:23 AM
Hi,
Try this...
DATA : l_descr_ref TYPE REF TO cl_abap_structdescr.
l_descr_ref ?= cl_abap_typedescr=>describe_by_data( itab ).
Now l_descr_ref->components holds the entire list of fields in itab.
Thanks,
Renjith.
07-31-2009 10:21 AM
Hi,
To get the internal table attributes you can try using DESCRIBE TABLE statement.
Regards,
Vik
07-31-2009 10:23 AM
DESCRIBE TABLE returns
- number of entries in table or
- value next to OCCURS from definition or
- table type (standard, sorted, hashed....)
I think it's not possible to use it for my purposes.
07-31-2009 10:23 AM
Hi,
Try this...
DATA : l_descr_ref TYPE REF TO cl_abap_structdescr.
l_descr_ref ?= cl_abap_typedescr=>describe_by_data( itab ).
Now l_descr_ref->components holds the entire list of fields in itab.
Thanks,
Renjith.
07-31-2009 10:25 AM
07-31-2009 10:42 AM
Hi Renjith,
> DATA : l_descr_ref TYPE REF TO cl_abap_structdescr.
> l_descr_ref ?= cl_abap_typedescr=>describe_by_data( itab ).
this will cause a MOVE_CAST_ERROR!
Regards
REA
Edited by: Ramy EL-ARNAOUTY on Jul 31, 2009 11:42 AM