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

Function Module Variable type & length

Former Member
0 Likes
1,368

Hi,

Would it be possible to provide me the name of the function module that can return the type and length of a variable?

Thanks a lot for your help,

Mohamed

4 REPLIES 4
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
831

Hi,

You can use CL_ABAP_TYPEDESCR and method

DESCRIBE_BY_NAME.

Regards,

Sesh

Read only

rodrigo_paisante3
Active Contributor
0 Likes
831

Hi,

if you want to manipulate strings, use strlen( var ).

regards

Read only

Former Member
0 Likes
831
try this..

REPORT ychatest.

DATA : v_name(15),
       v_type(1),
       v_len TYPE i.

DESCRIBE FIELD v_name TYPE v_type LENGTH v_len IN BYTE MODE.

WRITE : v_type , v_len.
Read only

Former Member
0 Likes
831

Hi Fassi,

Better you use <b>describe</b> statement in ABAP

check the below code.

data: v_name(20) type c.

data v_ln type i.

data v_type .

describe field v_name type v_type.

describe field v_name output-length v_ln.

write:/ v_ln.

write:/ v_type.