2005 Jul 26 4:25 PM
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
2005 Jul 26 4:28 PM
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
2005 Jul 26 4:28 PM
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
2005 Jul 26 4:38 PM
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
2005 Jul 26 4:39 PM
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
2005 Jul 27 8:15 AM
2005 Jul 27 8:50 AM
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.
2005 Jul 27 8:50 AM
Hi,
For technical settings, you can find info in table DD09L ( FM 'DD_GET_STORAGE_CLASS' ).
Svetlin