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: 

abap

Former Member
0 Kudos
140

Hi everybody,

Could any one tell me how to retrive the technical details of a struture (user defined in se11). i need the code.

thanks in advance

madhu

1 ACCEPTED SOLUTION

Former Member
0 Kudos
94

what do you need? a Function module that retreive you the field name and field info of a structure?

if yes, so use take a look at FM 'DDIF_NAMETAB_GET'.

joseph

6 REPLIES 6

Former Member
0 Kudos
95

what do you need? a Function module that retreive you the field name and field info of a structure?

if yes, so use take a look at FM 'DDIF_NAMETAB_GET'.

joseph

0 Kudos
94

Here is a code sample which illistrates the retrieval of certain data of a structure. Implement this program, enter the structure name in the selection screen and hit execute.



report zrich_0002.


type-pools : abap.

data : it_details type abap_compdescr_tab,
       wa_details type abap_compdescr.

parameters: p_type(10) type c.

data : ref_descr type ref to cl_abap_structdescr.

ref_descr ?= cl_abap_typedescr=>describe_by_name( p_type ).
it_details[] = ref_descr->components[].


loop at it_details into wa_details.
  write:/ wa_details-name, wa_details-type_kind, wa_details-length,
wa_details-decimals.

endloop.

Regards,

Rich Heilman

0 Kudos
94

Hi Joseph,

i know the function module but how to to retrive the technical details of a structure... technical details means list of attributes.

Cheers

Madhu

0 Kudos
94

Hi Madhu,

you'll find info to your structure in DD02L

-have a look here too:

regards Andreas

0 Kudos
94

Hi Madhu,

try this


DATA: lr_structdescr TYPE REF TO cl_abap_structdescr,
      lv_structname  TYPE abap_typename VALUE 'YOURSTRUCT'
FIELD-SYMBOLS:
      <f_comp>       TYPE abap_compdescr.

lr_structdescr ?= cl_abap_typedescr=>describe_by_name( lv_structname ).

LOOP AT lr_structdescr->components ASSIGNING <f_comp>.
  WRITE: / <f_comp>-name, <f_comp>-length.
ENDLOOP.

Former Member
0 Kudos
94

Hi,

For technical settings, you can find info in table DD09L ( FM 'DD_GET_STORAGE_CLASS' ).

Svetlin