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: 

TextEdit - How to store the text?

Former Member
0 Kudos

Hello

I'm using a TextEdit Control in a Dynpro. To get the text within this TextEdit I've got two possibilities:

   call method g_editor->get_text_as_r3table
        importing
          table = g_mytable.

or

      call method g_editor->get_text_as_stream
        importing
          text = text_tab.

Entered text:

Text1

Text2
Text3

The first method (get_text_as_r3table) puts the text into a temporary table for each newline it makes a new line in the internal table. The content of g_mytable is:

line 1: Text1
line 2: 
line 3: Text2
line 4: Text3

The second method (get_text_as_stream) gives me the text in a stream mode separated by "#". The content of text_tab is:

Text1####Text2##Text3

As I need to store this text, <b>has anyone got any experience where and how to store this text, or which one is better, and easier to handle?</b> I would like to store it with a key in a table.

Thanks very much!

Petra

3 REPLIES 3

athavanraja
Active Contributor
0 Kudos

store it in a custom table.

check the following thread for complete code sample.

Regards

raja

Former Member
0 Kudos

use Function Module SAVE_TEXT to save and READ_TEXT to read data.

go to se37 print SAVE_TEXT and click 'where used list' button.

you will get many examples

regards

Former Member
0 Kudos

Hi, in the second kind of return 'Text1####Text2##Text3

', '##' is a New Line code. I guess you show them in the debugger, yeah, if directly shown in debugger as a text, any non-text character will be shown as '##'. But if you change the mode to binary, you can see the '0D 0A' for it.

So back to your question, you want to know which kind of return value is better. Actually, which is better only due to how do you plan to handle them.

If you want to handle them as a table sheet, then choose first one.

If you want to handle them as a continuously inputted text, then choose second one.

And both of the two way is not exclusive, you can using CONCATENATE to combine the 'g_mytable' to be a long text, also use SPLIT to split text_tab to be pieces of cells.

In my opinion, I will choose the second one(stream). As the TextEdit is a control used to let the user input continuous text, normally we will anticipate the return value as a integrated text, and it's easy to be store as a txt file or etc, if you want.(in GUI_DOWNLOAP binary mode)

Hope it will be helpful

Thanks