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

Pass the structure name and return the description fields.

Former Member
0 Likes
889

Hi experts!!,

I would like to know a class and the method that I pass the structure name and return all the description fields.

Thanks a lot

3 REPLIES 3
Read only

uwe_schieferstein
Active Contributor
0 Likes
794

Hello Ana

Have a look at class CL_ABAP_STRUCTDESCR.


DATA: ls_knb1   TYPE knb1.
DATA: lo_typedescr    TYPE REF TO cl_abap_typedescr.
DATA: lo_strucdescr   TYPE REF TO cl_abap_structdescr.
DATA: lt_dfies            TYPE ddfields.


lo_typedescr = cl_abap_structdescr=>describe_by_data( ls_knb1 ).
lo_structdescr ?= lo_typedescr.

lt_dfies = lo_structdescr->get_ddic_field_list( ).
" Or check public attribute: lo_structdescr->components   for non-DDIC structures

Other useful RTTI classes are:

CL_ABAP_DATADESCR

CL_ABAP_TYPEDESCR

CL_ABAP_TABLEDESCR

CL_ABAP_CLASSDESCR

Regards

Uwe

Read only

Former Member
0 Likes
794

Hi Ana,

alternatively, you can go directly in table DD03M, according you've set a data element for each of your structure fields, and not have used Predefined Type.

Regards,

N H

Read only

Former Member
0 Likes
794

I do it with this function

CALL FUNCTION 'DDIF_FIELDINFO_GET'

EXPORTING

TABNAME = STR

LANGU = SY-LANGU

TABLES

DFIES_TAB = IT_TEXTOS.

Thanks!!