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: 

Length

Former Member
0 Kudos

Hi experts!!

Do you if theres a way on how to get the lenght of a variable.

example::

wa_itab-field1

i need to get watever length it will have..

somewhat dynamic..please help me..

more points!!!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

first of all you have to take the variable value in a character variable...

declare like this

data : vchar(50) ,

len type i.

vchar = wa_itab-field1.

len = strlen( vchar ).

write : / len.

regards

shiba dutta

4 REPLIES 4

former_member223537
Active Contributor
0 Kudos

Data l_len type i.

l_len = strlen(wa_itab-field1).

gopi_narendra
Active Contributor
0 Kudos
PARAMETER : p_c(20) TYPE c.
DATA : len TYPE i.
DATA : str TYPE string.
str = p_c.
len = strlen( str ).
WRITE : len, str.

Check this code

Regards

Gopi

Former Member
0 Kudos

first of all you have to take the variable value in a character variable...

declare like this

data : vchar(50) ,

len type i.

vchar = wa_itab-field1.

len = strlen( vchar ).

write : / len.

regards

shiba dutta

kiran_k8
Active Contributor
0 Kudos

Aswlkm,

DATA: salma(5),

LEN TYPE I.

DESCRIBE FIELD SALMA LENGTH LEN IN CHARACTER MODE.

RESULT:- LEN = 5.

K.Kiran.