03-14-2007 10:38 AM
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
03-14-2007 11:32 AM
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
03-14-2007 11:46 AM
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
03-14-2007 12:19 PM
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
03-14-2007 11:43 AM
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