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

Comparing strings

Hi Gurus,

Please solve this problem.

Hi One internal table with field message,This table having 20 or 30 lines of text.

I have to compare this text with one data base table having field message having text.

if the text that is matches first, i want to display that in output.

how i comepare these texts.

THanks/radha.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jun 19, 2008 at 04:51 AM

    Hi Radha,

    For this type of scenario lets say suppose we have populated two internal table

    itab1 ---> messages contains 20 to 30 lines.

    Itab2 -


    > fetch from the database.

    Now what you have to do is

    Loop at itab2.
     Read table itab1 with key message = < message>
     If sy-subrc = 0.
      write:/ itab2-message.
     endif.
    Endloop.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 04:49 AM

    Hi,

    loop at itab1 into wa.

    read table db_table with key text = wa-msg.

    if sy-subrc = 0.

    write: wa-msg.

    endif.

    endloop.

    Regards,

    Subramanian

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 19, 2008 at 04:51 AM

    Hi Radha,

    For this type of scenario lets say suppose we have populated two internal table

    itab1 ---> messages contains 20 to 30 lines.

    Itab2 -


    > fetch from the database.

    Now what you have to do is

    Loop at itab2.
     Read table itab1 with key message = < message>
     If sy-subrc = 0.
      write:/ itab2-message.
     endif.
    Endloop.
    

    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.