Application Development 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: 

how to obtain the true length of a fieldcontent

Former Member
0 Kudos

Hi all,

i want to know the real length of fieldcontent. This means e.g. i have a data containerfield type char10 containing the string "hello" = 5 characters. Next time the length of the same variable is 6 because the content of the containerfield type char = "bombay".

Does anyone know an abap-statement, that shows the lenght of a named field.

DESCRIBE FIELD FLD LENGTH LEN IN CHARACTER MODE.

....won't work, because it gives back only the defined size of the field FLD, not the length of its content.

Does anyone have an idea? For sure!

Thanks in advance +

Best regards,

Gunther

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

You can use STRLEN

data: l_len type i,

l_var(10) tyep c value 'Bombay'.

L_len = STELEN( l_var ).

write: l_len.

Regards,

Naimesh Patel.

1 REPLY 1

naimesh_patel
Active Contributor
0 Kudos

You can use STRLEN

data: l_len type i,

l_var(10) tyep c value 'Bombay'.

L_len = STELEN( l_var ).

write: l_len.

Regards,

Naimesh Patel.