Skip to Content
avatar image
Former Member

Save the text from Text Editor

Hi all,

I am creating a editor using CREATE OBJECT text_editor.

there i am entering 2000 characters of text into the Editor.l

How to save the data from the editor into the field,

will anybody let me know it

regards,

Madhavi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Oct 06, 2008 at 06:52 AM

    Hi Madhavi,

    The GET_TEXT_AS_R3TABLE method can be used for getting

    the text entered into any standard internal table.

    Check the below code for example.

     DATA : container   TYPE REF TO cl_gui_docking_container,
            text_editor TYPE REF TO cl_gui_textedit,
            lt_texttab  TYPE TABLE OF char80 WITH HEADER LINE.
    
     CALL SCREEN 100.
    
     LOOP AT lt_texttab.
       WRITE / lt_texttab.
     ENDLOOP.
    
    *---------------------------------------------------------------------*
     MODULE pb0 OUTPUT.
    
       SET PF-STATUS 'BASIC'.  " Only a BACK button with Apllication type 'E'.
    
       CHECK container IS NOT BOUND.
    
       CREATE OBJECT container  EXPORTING side       = cl_gui_docking_container=>dock_at_top
                                          extension  = '99999'.
    
       CREATE OBJECT text_editor EXPORTING parent            = container
                                           wordwrap_mode     = 2
                                           wordwrap_position = 80.
     ENDMODULE.                 " pb0  OUTPUT
    *&---------------------------------------------------------------------*
     MODULE pai INPUT.
       text_editor->get_text_as_r3table( IMPORTING table = lt_texttab[] ).
       SET SCREEN 0.LEAVE SCREEN.
     ENDMODULE.                 " pai  INPUT
    

    Screen flow logic

     process before output.
       MODULE pb0.
    
     process after input.
       module pai at exit-command.

    Here once we click back button the content of the text editor

    is extracted into the internal table and written.

    Cheers,

    Jose.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Madhavi,

      If 255 characters are getting updated, the problem seems to

      exist with the length of internal tab fields/variables/DB tab field used.Increasing their length might solve the

      problem.

      Btw, why r u using such a long field?? We can use the

      wordwrap_position parameter of its constructor to break a line at a fixed position(Say 255).

      Cheers,

      Jose.

  • avatar image
    Former Member
    Oct 13, 2008 at 07:21 AM

    Hi Jose

    One Clarification required from your end please

    Its fine that we can break into lines with say 255 characters using wordwrap_position parameter of its constructor.

    But can you say what will be the format in which it is saved in database table

    I mean to say

    Suppose

    -


    _>----


    -


    _>----


    -


    _>----


    here there are 3 lines each breaking at say 255 characters

    but my every line stops at _>

    Now in what format will it be stored

    and when i try to retrieve do i get in the same format

    Thanks in Advance

    Vikas C

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Vikas,

      Say,

      Ur DB table has a char field of length 255 and ur int table also

      has the same structure.

      Then it ll be stored in the same format as u type in text-editor

      -


      _>----


      -


      _>----


      -


      _>----


      Cheers,

      Jose.

  • avatar image
    Former Member
    Oct 30, 2008 at 09:15 AM

    Solved Myself

    Add comment
    10|10000 characters needed characters exceeded