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: 

object oriented programing

madhupusala3
Explorer
0 Kudos

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

12 REPLIES 12

sunilachyut
Contributor
0 Kudos

Can you elaborate a little more on what you are trying to do, also if possible try to paste your code.

Sunil Achyut

0 Kudos

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

0 Kudos

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

madhupusala3
Explorer
0 Kudos

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.

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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!!

0 Kudos

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

0 Kudos

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

0 Kudos

see this

0 Kudos

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

0 Kudos

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