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: 

Saving the contents of text edit control.

Former Member
0 Kudos

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.

6 REPLIES 6

Former Member
0 Kudos

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

-


0 Kudos

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 .

0 Kudos

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

0 Kudos

Thanks sudheer.

I got it. thanks for helping me .

0 Kudos

If u assign points i will also thank u ..

Former Member
0 Kudos

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