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

Retrieve fieldtext with dynamic table.

Former Member
0 Likes
362

Hy everyone ,

Is it possible to retrieve the long or medium text of a field label in data element using cl_abap_elemdescr or cl_abap_typedescr ?

Thank's a lot. !!

2 REPLIES 2
Read only

Former Member
0 Likes
323

Hi,

Yes, you can use the following:

data lo_elem type ref to cl_abap_elemdescr.
data l_field type dfies.

parameters p_elem type rollname.

start-of-selection.
  lo_elem ?= cl_abap_elemdescr=>describe_by_name( p_elem ).
  l_field = lo_elem->get_ddic_field( ).

  write : / 'Field', p_elem, 'descriptions:',
          / 'Short: ', l_field-scrtext_s,
          / 'Medium: ', l_field-scrtext_m,
          / 'Long: ', l_field-scrtext_l,
          / 'Heading: ', l_field-reptext.

Regards,

Tanguy

Read only

0 Likes
323

Works for me.

Thanks.

Regards

RT