Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting internal table definition

marcin_cholewczuk
Active Contributor
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

5 REPLIES 5

Former Member
0 Kudos

Hi,

To get the internal table attributes you can try using DESCRIBE TABLE statement.

Regards,

Vik

0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

This is exacly what I wanted. Thanks Renjith

0 Kudos

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