2006 May 24 5:35 PM
Hi,
Iam using method GET_TEXTSTREAM of class Textedit.
it is not giving any text.
please let me know, if have any simple example or information.
Regards
Madhu
Hi Madhu,
This will the code anyhow you might have finished the task this was posted long back but i want to share my answer.
CALL METHOD TEXT_EDITOR->GET_TEXTSTREAM
EXPORTING
ONLY_WHEN_MODIFIED = CL_GUI_TEXTEDIT=>TRUE
IMPORTING
TEXT = TEXT
IS_MODIFIED =
EXCEPTIONS
ERROR_CNTL_CALL_METHOD = 1
NOT_SUPPORTED_BY_GUI = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
MESSAGE TEXT TYPE 'I'.
WA_empinfo-empid = TEXT.
ENDCASE.
Cheers!!
2006 May 24 5:52 PM
Can you elaborate a little more on what you are trying to do, also if possible try to paste your code.
Sunil Achyut
2006 May 24 6:10 PM
I would suggest using the GET_TEXT_AS_R3TABLE instead.
Here is a sample program.
report zrich_0001 .
data:
dockingleft type ref to cl_gui_docking_container,
text_editor type ref to cl_gui_textedit,
repid type syrepid.
data: textlines type table of tline-tdline,
wa_text type tline-tdline.
parameters: p_check.
at selection-screen output.
repid = sy-repid.
create object dockingleft
exporting repid = repid
dynnr = sy-dynnr
side = dockingleft->dock_at_left
extension = 1070.
create object text_editor
exporting
parent = dockingleft.
start-of-selection.
call method text_editor->get_text_as_r3table
importing
table = textlines
exceptions
others = 1.
loop at textlines into wa_text .
write:/ wa_text.
endloop.
Regards,
Rich Heilman
2006 Nov 20 1:27 PM
Is there any reason to use GET_TEXT_AS_R3TABLE or GET_TEXT_AS_STREAM and not GET_TEXTSTREAM ? I hv find that the GET_TEXTSTREAM is not working properly and give you the value of the previous run
2006 May 24 6:12 PM
Hi.
i have created programe like this.
under pbo
PBO
if proj_textedit is initial.
CREATE OBJECT container1
EXPORTING
container_name = 'CCAREA'.
CREATE OBJECT proj_textedit
EXPORTING
parent = container1
wordwrap_position = 200
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_to_linebreak_mode = cl_gui_textedit=>true.
CALL METHOD proj_textedit->set_toolbar_mode
EXPORTING
toolbar_mode = proj_textedit->false.
CALL METHOD proj_textedit->set_statusbar_mode
EXPORTING
statusbar_mode = proj_textedit->false.
under pai.
CALL METHOD proj_textedit->get_textstream
exporting
ONLY_WHEN_MODIFIED = '1'
importing
text = W_TEXT.
****************************************
w_text not giving any text.there is no syntax errors or run time error.
2006 Nov 20 1:40 PM
U need to call cl_gui_cfw=>flush to get the text from the text edit control. This is also mention in comments inside the methods code.
-Ashim
2006 Dec 08 12:06 PM
I've found that cl_gui_cfw=>flush does not help.
At least if it called immediately before textedit->get_text_as_stream in the PAI.
Message was edited by:
sibrin w
2008 Oct 19 5:10 AM
Hi Madhu,
This will the code anyhow you might have finished the task this was posted long back but i want to share my answer.
CALL METHOD TEXT_EDITOR->GET_TEXTSTREAM
EXPORTING
ONLY_WHEN_MODIFIED = CL_GUI_TEXTEDIT=>TRUE
IMPORTING
TEXT = TEXT
IS_MODIFIED =
EXCEPTIONS
ERROR_CNTL_CALL_METHOD = 1
NOT_SUPPORTED_BY_GUI = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
MESSAGE TEXT TYPE 'I'.
WA_empinfo-empid = TEXT.
ENDCASE.
Cheers!!
2008 Oct 19 9:21 AM
Hi Balu,
If Madhu is still waiting at his PC for an answer, then he would have a very long beard by now...
Cheers,
Julius
2008 Oct 19 9:27 AM
Hi Julius,
I am sorry it was just like saw the post and i am working with the say issue so i posted. I will see it will not happen again.
Anyways good Comment i will take it sportively.
Cheers!!
Balu
2008 Oct 19 9:29 AM
2008 Oct 19 9:47 AM
No problem. Thanks for sharing with everyone.
Lets wait a few years to see whether Madhu turns up, otherwise I will close the thread for him...
Cheers,
Julius
2009 Jul 02 5:54 PM
Hi Venkat,
I am trying to read data from texteditor, as the same code you mentioned here
but still not getting any value in 'Text' parameter.
Thanks
Priya
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |