Skip to Content
avatar image
Former Member

obect oriented programing

Hi,

what is the class for textarea.

if u have any simple program pls send me.

Thanks&

Regards

Madhu.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    May 24, 2006 at 10:40 AM

    Check this class:

    CL_GUI_TEXTEDIT

    REgards,

    Ravi

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi,

      Use FM <b>CL_GUI_TEXTEDIT</b>

      Check this Link for the same

      http://www.sapgenie.com/abap/controls/textedit.htm

      • Create obejct for the TextEditor control

      CREATE OBJECT editor

      EXPORTING

      wordwrap_mode =

      <b>cl_gui_textedit</b>=>wordwrap_at_fixed_position

      wordwrap_position = line_length

      wordwrap_to_linebreak_mode = <b>cl_gui_textedit</b>=>true

      parent = custom_container

      EXCEPTIONS

      error_cntl_create = 1

      error_cntl_init = 2

      error_cntl_link = 3

      error_dp_create = 4

      gui_type_not_supported = 5

      others = 6

      .

      IF sy-subrc <> 0.

      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

      ENDIF.

      ENDIF.

  • avatar image
    Former Member
    May 24, 2006 at 10:42 AM

    Hi,

    The class is CL_GUI_TEXTEDIT.

    Sample program SAPTEXTEDIT_TEST_1.

    Regards,

    Ravi

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 24, 2006 at 10:45 AM

    what u want excatly

    CL_PT_TMW_TEXT_READER is the class to read texts

    Add comment
    10|10000 characters needed characters exceeded

  • May 24, 2006 at 10:48 AM

    Hi,

    check this sample..

    This is module pool program, you need to have a container.

    PROGRAM  z_test_text    .
    DATA: txt     TYPE REF TO cl_gui_textedit,
          txt_con TYPE REF TO cl_gui_custom_container.
    DATA: gt_text(100) OCCURS 10 WITH HEADER LINE.
    DATA: BEGIN OF it_tab OCCURS 0,
          LINE(100),
          END OF it_tab.
    
    start-of-selection.
    
    
    *&---------------------------------------------------------------------*
    *&      Module  STATUS_1000  OUTPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    MODULE status_1000 OUTPUT.
      SET PF-STATUS 'TEXT'.
      SET TITLEBAR 'TEXT AREA'.
    it_tab-line =
    'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'.
    append it_tab.
    it_tab-line = 'bbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'.
    append it_tab.
    it_tab-line = 'cccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'.
    append it_tab.
    it_tab-line = 'dddaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'.
    append it_tab.
    
    it_tab-line = 'aaa'.
    append it_tab.
    it_tab-line = 'bbb'.
    append it_tab.
    it_tab-line = 'ccc'.
    append it_tab.
    it_tab-line = 'ddd'.
    append it_tab.
    
    it_tab-line = 'aaa'.
    append it_tab.
    it_tab-line = 'bbb'.
    append it_tab.
    it_tab-line = 'ccc'.
    append it_tab.
    it_tab-line = 'ddd'.
    append it_tab.
    
    it_tab-line = 'aaa'.
    append it_tab.
    it_tab-line = 'bbb'.
    append it_tab.
    it_tab-line = 'ccc'.
    append it_tab.
    it_tab-line = 'ddd'.
    append it_tab.
    
    it_tab-line = 'aaa'.
    append it_tab.
    it_tab-line = 'bbb'.
    append it_tab.
    it_tab-line = 'ccc'.
    append it_tab.
    it_tab-line = 'ddd'.
    append it_tab.
    
    it_tab-line = 'aaa'.
    append it_tab.
    it_tab-line = 'bbb'.
    append it_tab.
    it_tab-line = 'ccc'.
    append it_tab.
    it_tab-line = 'ddd'.
    append it_tab.
    *-- test display in text area
    *  gt_text = 'aaa'.
    *  APPEND gt_text.
    *-- populating gt_text from it_tab.
     loop at it_tab.
        gt_text = it_tab-line.
        append gt_text.
     endloop.
    
    ENDMODULE.                 " STATUS_1000  OUTPUT
    *&---------------------------------------------------------------------*
    *&      Module  pbo_1000  OUTPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    MODULE pbo_1000 OUTPUT.
      DATA: container(30).
    
      container = 'TEXT'.
    
      IF txt IS INITIAL.
        CREATE OBJECT txt_con
         EXPORTING
           container_name = container
         EXCEPTIONS
           OTHERS = 1.
    
        CREATE OBJECT txt
          EXPORTING
           parent = txt_con
           wordwrap_mode  = cl_gui_textedit=>wordwrap_at_fixed_position
           wordwrap_to_linebreak_mode = cl_gui_textedit=>true.
      ENDIF.
    
      CALL METHOD txt_con->link
        EXPORTING
          repid     = sy-repid
          dynnr     = '1000'
          container = container.
    
      CALL METHOD txt->set_toolbar_mode
        EXPORTING
          toolbar_mode = txt->true.
    
      CALL METHOD txt->set_statusbar_mode
        EXPORTING
          statusbar_mode = txt->true.
    
      CALL METHOD txt->set_wordwrap_behavior
        EXPORTING
          wordwrap_mode = txt->true.
    
    *-- set text -------------------------------------------
      IF gt_text[] IS INITIAL.
    
      ENDIF.
    
      CALL METHOD txt->set_text_as_r3table
        EXPORTING
          table = gt_text[].
    
      CALL METHOD txt->set_readonly_mode.
    
    ENDMODULE.                 " pbo_1000  OUTPUT
    *&---------------------------------------------------------------------*
    *&      Module  USER_COMMAND_1000  INPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    MODULE user_command_1000 INPUT.
      CASE sy-ucomm.
        WHEN  'BACK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    
    ENDMODULE.                 " USER_COMMAND_1000  INPUT

    Regards

    vijay

    Add comment
    10|10000 characters needed characters exceeded