Application Development and Automation 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: 
Read only

abap

Former Member
0 Likes
835

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
Read only

Former Member
0 Likes
789

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
Read only

Former Member
0 Likes
790

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

Read only

0 Likes
789

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

Read only

0 Likes
789

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

Read only

0 Likes
789

Hi Madhu,

you'll find info to your structure in DD02L

-have a look here too:

regards Andreas

Read only

0 Likes
789

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.

Read only

Former Member
0 Likes
789

Hi,

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

Svetlin