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

checking change to texteditcontrol

Hi all,

I have a texteditcontrol. Inside this texteditcontrol, i assign some default value when runtime. Let say i gt this sentence: Hello World

Assume a user enter some text in the texteditcontrol.

eg: Hello World. How are you.

After that, the user execute the program. The texteditcontrol detect some change in the text. How to know if it is change?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Nov 20, 2007 at 03:52 AM

    You can compare both the text tables.

    Let's say, there is one default table which has initial text .. IT_DEF.

    Now, after user input you can get the text table and you can compare it.

    call method text_editor->get_text_as_r3table
    importing
    table = textlines
    exceptions
    others = 1.
    
    loop at it_def.
      read table textlines index sy-tabix.
       if it_def <> textlines.
    *   text was changed
       endif.
    endloop.

    regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

    • Yes it because we are tryig to access tables which requires explicit work area to manupulate it.

      Below is the corrected code

      loop at text_tab in line.
        read table text_tab1into line1 index sy-tabix.
        if line <> line1.
      *   text was changed
          exit.
        endif.
        clear: line, line1.
      endloop.

      Regards,

      Naimesh Patel

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.