Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to obtain the true length of a fieldcontent

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

Tags:
Former Member
replied

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.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question