<?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: Populate data from Internal Table to Text Editor in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/populate-data-from-internal-table-to-text-editor/m-p/5065701#M1176933</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pretty straight forward.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA container TYPE REF TO cl_gui_custom_container.
DATA editor     TYPE REF TO cl_gui_textedit.
DATA textline(80).
DATA text_130    LIKE STANDARD TABLE OF textline.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PBO module routine&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  IF container IS INITIAL.
    CREATE OBJECT container
       EXPORTING container_name = 'TEXT_CTRL'.   " Custom Container on Screen

    CREATE OBJECT editor
       EXPORTING parent = container
           wordwrap_mode = cl_gui_textedit=&amp;gt;wordwrap_at_fixed_position
           wordwrap_position = 80
           wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true.
  ENDIF.

  IF ok_0010 = 'DISP' OR ok_0010 = 'DELE'
  OR ( ok_0010 = 'CHAN' AND tax_edit EQ 'Y' ).
    CALL METHOD editor-&amp;gt;set_readonly_mode
       EXPORTING readonly_mode = '1'.
  ELSE.
    CALL METHOD editor-&amp;gt;set_readonly_mode
       EXPORTING readonly_mode = '0'.
  ENDIF.

* call method editor-&amp;gt;set_text_as_stream
  CALL METHOD editor-&amp;gt;set_text_as_r3table
        EXPORTING table   = text_130.      " Internal Table
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To retrieve it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  REFRESH text_130.

  CALL METHOD editor-&amp;gt;get_text_as_r3table
       IMPORTING table        = text_130.   " Again, Internal Table name
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Paul Chapman on Jan 27, 2009 7:58 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Jan 2009 12:56:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-27T12:56:27Z</dc:date>
    <item>
      <title>Populate data from Internal Table to Text Editor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populate-data-from-internal-table-to-text-editor/m-p/5065700#M1176932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt; I have created a &lt;STRONG&gt;Text Editor in module Pool Program.&lt;/STRONG&gt; But my requirement is to read data from an Internal Table &amp;amp; &lt;STRONG&gt;populate those records to that Text Editor.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please suggest me how to do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Biswajit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2009 12:23:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populate-data-from-internal-table-to-text-editor/m-p/5065700#M1176932</guid>
      <dc:creator>biswajit_das6</dc:creator>
      <dc:date>2009-01-27T12:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Populate data from Internal Table to Text Editor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populate-data-from-internal-table-to-text-editor/m-p/5065701#M1176933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pretty straight forward.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA container TYPE REF TO cl_gui_custom_container.
DATA editor     TYPE REF TO cl_gui_textedit.
DATA textline(80).
DATA text_130    LIKE STANDARD TABLE OF textline.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PBO module routine&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  IF container IS INITIAL.
    CREATE OBJECT container
       EXPORTING container_name = 'TEXT_CTRL'.   " Custom Container on Screen

    CREATE OBJECT editor
       EXPORTING parent = container
           wordwrap_mode = cl_gui_textedit=&amp;gt;wordwrap_at_fixed_position
           wordwrap_position = 80
           wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true.
  ENDIF.

  IF ok_0010 = 'DISP' OR ok_0010 = 'DELE'
  OR ( ok_0010 = 'CHAN' AND tax_edit EQ 'Y' ).
    CALL METHOD editor-&amp;gt;set_readonly_mode
       EXPORTING readonly_mode = '1'.
  ELSE.
    CALL METHOD editor-&amp;gt;set_readonly_mode
       EXPORTING readonly_mode = '0'.
  ENDIF.

* call method editor-&amp;gt;set_text_as_stream
  CALL METHOD editor-&amp;gt;set_text_as_r3table
        EXPORTING table   = text_130.      " Internal Table
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To retrieve it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  REFRESH text_130.

  CALL METHOD editor-&amp;gt;get_text_as_r3table
       IMPORTING table        = text_130.   " Again, Internal Table name
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Paul Chapman on Jan 27, 2009 7:58 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2009 12:56:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populate-data-from-internal-table-to-text-editor/m-p/5065701#M1176933</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-27T12:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Populate data from Internal Table to Text Editor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populate-data-from-internal-table-to-text-editor/m-p/5065702#M1176934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is another example using the  set_text_as_stream vs r3table.  &lt;/P&gt;&lt;P&gt;I used it for huge (30000 byte) Letters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES: BEGIN OF scr_text_line2,
         line(30000) TYPE c,
       END OF scr_text_line2.
DATA:
  wa_wk_letter  TYPE scr_text_line2,
   g_editor5 TYPE REF TO cl_gui_textedit,
   g_custom_container5 TYPE REF TO cl_gui_custom_container.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the PBO Routine&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* Textedit control
  PERFORM initialize_text_editor_0525.
  PERFORM set_text_in_editor_0525.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The FORMS&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  initialize_text_editor_0525
*&amp;amp;---------------------------------------------------------------------*
FORM initialize_text_editor_0525.
  CHECK g_editor5 IS INITIAL.
  repid = sy-repid.
  CREATE OBJECT g_custom_container5
     EXPORTING
        container_name = '0551_SCR_CONTAINER'
     EXCEPTIONS
        cntl_error = 1
        cntl_system_error = 2
        create_error = 3
        lifetime_error = 4
        lifetime_dynpro_dynpro_link = 5.

  CREATE OBJECT g_editor5
     EXPORTING
        parent = g_custom_container5
        wordwrap_mode = cl_gui_textedit=&amp;gt;wordwrap_at_fixed_position
        wordwrap_position = line_length
        wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true.
  CALL METHOD g_editor5-&amp;gt;set_statusbar_mode
    EXPORTING
      statusbar_mode = 0.
  CALL METHOD g_editor5-&amp;gt;set_toolbar_mode
    EXPORTING
      toolbar_mode = 0.
ENDFORM.                    " initialize_text_editor_0525
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  set_text_in_editor_0525
*&amp;amp;---------------------------------------------------------------------*
FORM set_text_in_editor_0525.
  CALL METHOD g_editor5-&amp;gt;set_text_as_stream
    EXPORTING
      text            = it_wk_letter
    EXCEPTIONS
      error_dp        = 1
      error_dp_create = 2
      OTHERS          = 3
          .
  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE i015 WITH
     repid 'Error in set_text_as_stream'.
  ENDIF.

  CALL METHOD cl_gui_cfw=&amp;gt;flush.
  IF sy-subrc NE 0.
    MESSAGE i015 WITH
     repid 'set_text_as_stream: Error in FLUSH'.
  ENDIF.
ENDFORM.                    " set_text_in_editor_0525
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PBO Module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODULE text_editor_retrieve_0525.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  text_editor_retrieve_0525  INPUT
*&amp;amp;---------------------------------------------------------------------*
MODULE text_editor_retrieve_0525 INPUT.
  CALL METHOD g_editor5-&amp;gt;get_text_as_stream
*    EXPORTING
*      ONLY_WHEN_MODIFIED     = FALSE
    IMPORTING
      text                   = it_wk_letter
*      IS_MODIFIED            =
    EXCEPTIONS
      error_dp               = 1
      error_cntl_call_method = 2
      OTHERS                 = 3
          .
  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE i015 WITH
     repid 'Error in get_text_as_stream'.
  ENDIF.

  CALL METHOD cl_gui_cfw=&amp;gt;flush.
  IF sy-subrc NE 0.
    MESSAGE i015 WITH
     repid 'get_text_as_stream: Error in FLUSH'.
  ENDIF.
ENDMODULE.                 " text_editor_retrieve_0525  INPUT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Paul Chapman on Jan 27, 2009 8:07 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2009 13:06:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populate-data-from-internal-table-to-text-editor/m-p/5065702#M1176934</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-27T13:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: Populate data from Internal Table to Text Editor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populate-data-from-internal-table-to-text-editor/m-p/5065703#M1176935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot  Paul .....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2009 13:15:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populate-data-from-internal-table-to-text-editor/m-p/5065703#M1176935</guid>
      <dc:creator>biswajit_das6</dc:creator>
      <dc:date>2009-01-27T13:15:30Z</dc:date>
    </item>
  </channel>
</rss>

