04-24-2007 10:19 AM
HI ALL,
i ve created a test edit control using custom control and class cl_gui_text_edit
now i ve to save the contents of the text edit control.
can any one help me please.
04-24-2007 11:14 AM
Hi,
Usd the methods 'Get_text_as_stream' and 'Set_text_as_stream' in the class CL_GUI_TEXTEDIT.
In the PBO we have to use the 'Set_text_as_stream' and in the PAI we have to use the 'Get_text_as_stream'
Below The Field 'Text_tab' is containing the Content of the Text in the Text Editor.
when ever we save the new text will be saved in the Editoe.
Example.
DATA: container TYPE REF TO cl_gui_custom_container,
editor TYPE REF TO cl_gui_textedit.
DATA: line(256) TYPE c,
text_tab LIKE STANDARD TABLE OF line,
field LIKE line.
START-OF-SELECTION.
line = 'First line in TextEditControl'.
APPEND line TO text_tab.
CALL SCREEN 100.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
CALL METHOD editor->set_text_as_stream EXPORTING text = text_tab.
ENDMODULE.
MODULE user_command_0100 INPUT.
'INSERT' is the funstion code for SAVE Icon in the Status.
if ok_code = 'INSERT'.
CALL METHOD editor->get_text_as_stream IMPORTING text = text_tab.
ENDif.
SET SCREEN 100.
ENDMODULE.
<b>Reward if useful.</b>
Sudheer
null
-
04-24-2007 12:16 PM
Thanks Sudheer.
i am using g<b>et_text_as_r3table</b> method to ve the contents into a internal table and then using fm save_text i am saving that.
and i am reading the text using fm read_text .
and then getting the result into an internal table.
but the problem is how to assign the value of the internal table to the text edit control .
do u know any method..
please help me
with example.
thanks in advance .
04-24-2007 12:30 PM
Hi,
For Method 'get_text_as_r3table' there is one Method 'set_text_as_r3table' in class cl_gui_textedit.
For Every Set Method their is one corresponding Get Method.
<u>How to do:</u>
It should be similar to the above Example.
put the importing parameters of the method
'get_text_as_r3table' as exporting parameters to method
'set_text_as_r3table'.
Regards,
Sudheer
04-24-2007 12:43 PM
04-24-2007 1:00 PM
05-07-2007 11:51 AM
Hi,
U have to <b>award points for useful answers</b> and u have to mention it as solved if ur question is solved. Dont forget.
Regards,
Sudheer