<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: cl_gui_textedit control is ignoring empty lines in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-textedit-control-is-ignoring-empty-lines/m-p/7949225#M1601574</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kranthi Kumar,&lt;/P&gt;&lt;P&gt;It should work fine.  It is working fine for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have tp make sure to use the below attributes(cl_gui_textedit=&amp;gt;wordwrap_at_fixed_position for wordwrap_mode ) while calling the create object:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  create calls constructor, which initializes, creats and links&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TextEdit Control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT g_editor&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;           parent = g_editor_container&lt;/P&gt;&lt;P&gt;           wordwrap_mode =&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             cl_gui_textedit=&amp;gt;wordwrap_off&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;              cl_gui_textedit=&amp;gt;wordwrap_at_fixed_position&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            cl_gui_textedit=&amp;gt;WORDWRAP_AT_WINDOWBORDER&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           wordwrap_position = line_length&lt;/P&gt;&lt;P&gt;           wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also make sure to use the below method (get_text_as_r3table) to get the data back from the text editor:-&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  retrieve table from control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CALL METHOD g_editor-&amp;gt;get_text_as_r3table&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          table = g_inputtable[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this answers your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Greetson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2011 16:01:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-06-15T16:01:37Z</dc:date>
    <item>
      <title>cl_gui_textedit control is ignoring empty lines</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-textedit-control-is-ignoring-empty-lines/m-p/7949223#M1601572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using cl_gui_textedit this class to have text editor in my application,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i enter some text like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;this is first line&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;this is second line&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;this is last line.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;editor is automatically taking this as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;this is first line&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;this is second line&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;this is last line.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is not considering the empty lines or line breaks, for setting the texts i am using method set_text_asstream method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please suggest what to be done inorder to have lines in editor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 06:07:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-textedit-control-is-ignoring-empty-lines/m-p/7949223#M1601572</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-15T06:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: cl_gui_textedit control is ignoring empty lines</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-textedit-control-is-ignoring-empty-lines/m-p/7949224#M1601573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kranthi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The method &lt;EM&gt;SET_TEXT_AS_STREAM( )&lt;/EM&gt; expects the caller to provide the "\r" &amp;amp; "\n" i.e., Carriage Return(CR) &amp;amp; Line Feed(LF) respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;So the idea is to add an additional &lt;EM&gt;CRLF&lt;/EM&gt; for the blank lines.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the code snippet below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: lt_text_stream TYPE STANDARD TABLE OF char32,
        lv_string      TYPE string.

* Populate the text stream
  APPEND 'this is first line' TO lt_text_stream. "Text Line
  APPEND cl_abap_char_utilities=&amp;gt;cr_lf TO lt_text_stream. "Line Feed

  APPEND cl_abap_char_utilities=&amp;gt;cr_lf TO lt_text_stream. "Blank Line

  APPEND 'this is second line' TO lt_text_stream. "Text Line
  APPEND cl_abap_char_utilities=&amp;gt;cr_lf TO lt_text_stream. "Line Feed

  APPEND cl_abap_char_utilities=&amp;gt;cr_lf TO lt_text_stream. "Blank Line

  APPEND 'this is last line' TO lt_text_stream. "Text Line
  APPEND cl_abap_char_utilities=&amp;gt;cr_lf TO lt_text_stream. "Line Feed

* Concatenate the text lines into a string
  CONCATENATE LINES OF lt_text_stream INTO lv_string.

* Send the text stream to the Text Editor
  text_view-&amp;gt;set_textstream(
    EXPORTING
      text                    = lv_string
    EXCEPTIONS
      error_cntl_call_method  = 1
      not_supported_by_gui    = 2
      OTHERS                  = 3
         ).
  IF sy-subrc &amp;lt;&amp;gt; 0.
    "Error handling
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was having indentation issues with &lt;EM&gt;SET_TEXT_AS_STREAM( )&lt;/EM&gt; so i've used the &lt;EM&gt;SET_TEXTSTREAM( )&lt;/EM&gt;. In both the cases you've to add an extra CRLF to get the blank lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope i'm clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: Internally the method &lt;EM&gt;SET_TEXT_AS_STREAM( )&lt;/EM&gt; calls &lt;EM&gt;SET_TEXTSTREAM( )&lt;/EM&gt; based on some condition!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 11:21:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-textedit-control-is-ignoring-empty-lines/m-p/7949224#M1601573</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-06-15T11:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: cl_gui_textedit control is ignoring empty lines</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-textedit-control-is-ignoring-empty-lines/m-p/7949225#M1601574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kranthi Kumar,&lt;/P&gt;&lt;P&gt;It should work fine.  It is working fine for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have tp make sure to use the below attributes(cl_gui_textedit=&amp;gt;wordwrap_at_fixed_position for wordwrap_mode ) while calling the create object:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  create calls constructor, which initializes, creats and links&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TextEdit Control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT g_editor&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;           parent = g_editor_container&lt;/P&gt;&lt;P&gt;           wordwrap_mode =&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             cl_gui_textedit=&amp;gt;wordwrap_off&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;              cl_gui_textedit=&amp;gt;wordwrap_at_fixed_position&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            cl_gui_textedit=&amp;gt;WORDWRAP_AT_WINDOWBORDER&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           wordwrap_position = line_length&lt;/P&gt;&lt;P&gt;           wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also make sure to use the below method (get_text_as_r3table) to get the data back from the text editor:-&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  retrieve table from control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CALL METHOD g_editor-&amp;gt;get_text_as_r3table&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          table = g_inputtable[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this answers your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Greetson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 16:01:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-textedit-control-is-ignoring-empty-lines/m-p/7949225#M1601574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-15T16:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: cl_gui_textedit control is ignoring empty lines</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-textedit-control-is-ignoring-empty-lines/m-p/7949226#M1601575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is working now, thank you very much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kranthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 09:04:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-textedit-control-is-ignoring-empty-lines/m-p/7949226#M1601575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-16T09:04:19Z</dc:date>
    </item>
  </channel>
</rss>

