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: 

find length of data type P

Former Member
0 Kudos

Hi Experts,

we can find the length of character by using

"strlen()". <b>How to find the length of non-character "data type P"?</b>

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can convert to string and find.

DATA v_p TYPE p VALUE '1234'.
DATA len TYPE i.
DATA v_chr(12).

v_chr = v_p.
CONDENSE v_chr NO-GAPS.
len =  strlen( v_chr ).

2 REPLIES 2

Former Member
0 Kudos

Data type P will always have length = 2n - 1

For eg if you declare data variable

V_value(8) type P.

Length of this V_VALUE is 2 * 8 = 16 - 1 = 15.

Hope this will help you.

Former Member
0 Kudos

You can convert to string and find.

DATA v_p TYPE p VALUE '1234'.
DATA len TYPE i.
DATA v_chr(12).

v_chr = v_p.
CONDENSE v_chr NO-GAPS.
len =  strlen( v_chr ).