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

Field length

Former Member
0 Likes
786

Hi everybody

how can i findout, how much length a field has.

Example this.

data gv_get_header type c length 105 value 'ANGR'.

the variable gv_get_header is had four length.

thx anujit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
751

Hello,

You can use the command STRLEN.



w_len = strlen( <variable> ).    

Hope this helps you.

Regards,

Sachinkumar Mehta

Hi everybody

how can i findout, how much length a field has.

Example this.

data gv_get_header type c length 105 value 'ANGR'.

the variable gv_get_header is had four length.

thx anujit

6 REPLIES 6
Read only

Former Member
0 Likes
751

Hi,

use STRLEN

Excample:

DATA: int TYPE i,

word1(20) TYPE c VALUE '12345'.

word2(20) TYPE c.

word3(20) TYPE c VALUE ' 4 '.

int = strlen( word1 ). WRITE int.

int = strlen( word2 ). WRITE / int.

int = strlen( word3 ). WRITE / int.

Regards

Nicole

Read only

Former Member
0 Likes
752

Hello,

You can use the command STRLEN.



w_len = strlen( <variable> ).    

Hope this helps you.

Regards,

Sachinkumar Mehta

Read only

Former Member
0 Likes
751

REPORT  ZREPORT.
data gv_get_header type c length 105 value 'ANGR'.
data: ln type p.

ln = strlen( gv_get_header ).
write ln.
Read only

kamesh_g
Contributor
0 Likes
751

use STRLEN(Field)

Read only

Former Member
0 Likes
751

hi,

As said by others STRLEN will solve ur problem...

Thanks

Suraj

Read only

Former Member
0 Likes
751

Hi,

use strlen command to find the length of the string.

ex:

data length type i.

length = strlen (gv_get_header).

Regards,

Venu