Skip to Content
author's profile photo Former Member
Former Member

want to length of the string

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 11:04 AM

    parameters : p_str type string.

    data : len type i.

    len = strlen( p_str ).

    write : / len.

    regards

    shiba dutta

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 22, 2007 at 11:04 AM

    use :

    z = strlen( p_bukrs ).

    A.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 11:05 AM
    data:  lv_len     type i
    ln_lev = STRLEN( pa_string ).
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 11:07 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 11:07 AM

    hi,

    try this.

    DATA : ln TYPE i,

    st TYPE string.

    PARAMETERS : str(50) TYPE c.

    ln = STRLEN( str ).

    WRITE:/ ln.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 22, 2007 at 11:13 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 11:15 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 11:22 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.