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: 

Reading and saving the text using METHOD CL_GUI_TEXTEDIT

Former Member
0 Kudos

Hi friends,

i am facing one poblem in reading and saving the text using Methods

I have written a code which will save the text and loads it back , when i re execute that pogram that value is not retained,

Please help me out in solving this problem as i need that value to be retained when i shows the editor on scree, or tell me where this values is stored

Thanks

Munish

4 REPLIES 4

Former Member
0 Kudos

hi,

Check out the demo program SAPTEXTEDIT_DEMO_3.

Thsi demo program saves the data in local file and later loads this file and displays the data in editor.

Hope this helps.

Regards,

Richa

0 Kudos

No i have already seen he program, i dont need to load into any file,

i wanna save the text and read that after i execute again, its workign fine for the firt tiem and when i execute again the text saved doesnot come, i wanna know where it gets saved?

i hope u understand the problem

0 Kudos

hi,

In the demo program SAPTEXTEDIT_DEMO_3, the data is stored in the internal table( DATA g_mytable TYPE TABLE OF mytable_line.) and later loaded. So once you are out of the program, the data is lost. It seems that you have used some different logic. If you can post your code, then we can look into it.

Regards,

Richa

Former Member
0 Kudos

hi,

Use method get_text_as_r3table of classcl_gui_textedit to save the text to some file and set_text_as_r3table to load the text from the file.

list of methods used for getting and setting the text.

GET_LINE_TEXT

GET_SELECTED_TEXT_AS_R3TABLE

SET_SELECTED_TEXT_AS_R3TABLE

GET_SELECTED_TEXT_AS_STREAM

SET_SELECTED_TEXT_AS_STREAM

GET_TEXT_AS_R3TABLE

SET_TEXT_AS_R3TABLE

GET_TEXT_AS_STREAM

SET_TEXT_AS_STREAM

OPEN_LOCAL_FILE

SAVE_AS_LOCAL_FILE

Hope these methods helps.

Regards,

Richa