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: 

want to length of the string

Former Member
0 Kudos

Hi,

I have one parameter on the selection screen, when i enter some string on that, it should give me the length of the string. can you pls send me the code.

Ex: if i enter : enter amount : then it should give the o/p is: 12

Akshitha.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

parameters : p_str type string.

data : len type i.

len = strlen( p_str ).

write : / len.

regards

shiba dutta

8 REPLIES 8

Former Member
0 Kudos

parameters : p_str type string.

data : len type i.

len = strlen( p_str ).

write : / len.

regards

shiba dutta

andreas_mann3
Active Contributor
0 Kudos

use :

z = strlen( p_bukrs ).

A.

Former Member
0 Kudos
data:  lv_len     type i
ln_lev = STRLEN( pa_string ).

Former Member
0 Kudos

USE

data : len type i,

str type string value 'Enter'.

len = strlen( str ).

This will give u da length in len

Reward all helpful queries

Former Member
0 Kudos

hi,

try this.

DATA : ln TYPE i,

st TYPE string.

PARAMETERS : str(50) TYPE c.

ln = STRLEN( str ).

WRITE:/ ln.

former_member200338
Active Contributor
0 Kudos

Hi,

data : l_len type i,

l_str type string value ' enter amount :'.

l_len = strlen( l_str ).

Note: make sure you give appropriate spaces in the brackets. else it will thro u an error message

Reward points if usefull

Regards,

Niyaz

Former Member
0 Kudos

Hi Akshitha

Pls try the following code:

PARAMETERS : p_string TYPE string.

DATA : i_length TYPE i.

i_length = STRLEN( p_string ).

WRITE : / i_length.

Pls reward points if useful.

Former Member
0 Kudos

use FM

SWA_STRINGLENGTH_GET

enter your string in EXPRESSION and use the others if needed use "X" for all three except EXPRESSION

EXPRESSION GFFHG

<b>CONDENSE_NO_GAPS

CONDENSE

WITH_LEADING_BLANKS </b>

also see STRING_LENGTH

STRING_LENGTH

Message was edited by:

Amit Singla