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

comparing 2 character inputs

i hav a requirement where i get an input (character format) from the interface ans i hav to check if its a 8 char long input or a 9 char long input, according to which i need to select data from diff table. how can i do this? kindly help.......useful answer wil surely be rewarded.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 04, 2007 at 08:20 AM

    hi

    basically u need to check the length of the character..which can be achived by using STRLEN command...

    data : a type c value 'ABAP', b(10).

    b = strlen( a ).

    write b.

    output will be 4

    if helpful, reward

    Sathish. R

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 04, 2007 at 08:22 AM

    Hi,

    You can do this way:

    First declare 2 constants of value 8 and 9.

    Then use the STRLEN keyword to get the string length of the input character format and then compare with the consatnts to check if they are 8 or 9 characters in length.

    Hope it was useful.

    Thanks,

    Sandeep.

    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.