Application Development and Automation 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: 
Read only

TO ADD TEXT EDITOR IN MODULE POOL

Former Member
0 Likes
2,158

HAI CAN ANYONE TELL ME HOW TO ADD TEXT EDITOR IN MY SCREEN ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
939

This is an example.



  PERFORM initialize_text_editor_0101.
  PERFORM set_text_in_editor_0101.

*&---------------------------------------------------------------------*
*&      Form  initialize_text_editor_0101
*&---------------------------------------------------------------------*
FORM initialize_text_editor_0101.
  IF g_editor4 IS INITIAL.
    repid = sy-repid.
    CREATE OBJECT g_custom_container4
       EXPORTING
          container_name = '0101_SCR_CONTAINER'
       EXCEPTIONS
          cntl_error = 1
          cntl_system_error = 2
          create_error = 3
          lifetime_error = 4
          lifetime_dynpro_dynpro_link = 5.

    CREATE OBJECT g_editor4
       EXPORTING
          parent = g_custom_container4
          wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
          wordwrap_position = line_length
          wordwrap_to_linebreak_mode = cl_gui_textedit=>true.
    CALL METHOD g_editor4->set_statusbar_mode
      EXPORTING
        statusbar_mode = 0.
    CALL METHOD g_editor4->set_toolbar_mode
      EXPORTING
        toolbar_mode = 0.

  ENDIF.                "editor is initial
ENDFORM.                    " initialize_text_editor_0101
*&---------------------------------------------------------------------*
*&      Form  set_text_in_editor_0101
*&---------------------------------------------------------------------*
FORM set_text_in_editor_0101.
  CALL METHOD g_editor4->set_text_as_r3table
    EXPORTING table = it_pi_text
       EXCEPTIONS
           OTHERS = 1.

  IF sy-subrc NE 0.
    MESSAGE i015 WITH
     repid 'Error in set_text_as_r3table'.
  ENDIF.
  CALL METHOD cl_gui_cfw=>flush.
  IF sy-subrc NE 0.
    MESSAGE i015 WITH
     repid 'set_text_as_r3table: Error in FLUSH'.
  ENDIF.
ENDFORM.                    " set_text_in_editor_0101

*** " This section is called from the PAI routine of the screen
*&---------------------------------------------------------------------*
*&      Module  text_editor_retrieve_0101  INPUT
*&---------------------------------------------------------------------*
MODULE text_editor_retrieve_0101 INPUT.
  PERFORM text_editor_retrieve_0101.
ENDMODULE.                 " text_editor_retrieve_0101  INPUT
*---------------------------------------------------------------------*
*       FORM text_editor_retrieve_0101                                *
*---------------------------------------------------------------------*
FORM text_editor_retrieve_0101.
  CHECK NOT g_editor4 IS INITIAL.
  CALL METHOD g_editor4->get_text_as_r3table
    IMPORTING table = it_pi_text
       EXCEPTIONS
           OTHERS = 1.

  IF sy-subrc NE 0.
    MESSAGE i015 WITH
     repid 'Error in get_text_as_r3table'.
  ENDIF.

  CALL METHOD cl_gui_cfw=>flush.
  IF sy-subrc NE 0.
    MESSAGE i015 WITH
     repid 'get_text_as_r3table: Error in FLUSH'.
  ENDIF.
ENDFORM.

3 REPLIES 3
Read only

matt
Active Contributor
0 Likes
939

Moderator message: please do NOT post in ALL CAPITALS

Read only

h_senden2
Active Contributor
0 Likes
939

Try class c_textedit_control

Search for it on this forum.

regards,

Hans

Read only

Former Member
0 Likes
940

This is an example.



  PERFORM initialize_text_editor_0101.
  PERFORM set_text_in_editor_0101.

*&---------------------------------------------------------------------*
*&      Form  initialize_text_editor_0101
*&---------------------------------------------------------------------*
FORM initialize_text_editor_0101.
  IF g_editor4 IS INITIAL.
    repid = sy-repid.
    CREATE OBJECT g_custom_container4
       EXPORTING
          container_name = '0101_SCR_CONTAINER'
       EXCEPTIONS
          cntl_error = 1
          cntl_system_error = 2
          create_error = 3
          lifetime_error = 4
          lifetime_dynpro_dynpro_link = 5.

    CREATE OBJECT g_editor4
       EXPORTING
          parent = g_custom_container4
          wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
          wordwrap_position = line_length
          wordwrap_to_linebreak_mode = cl_gui_textedit=>true.
    CALL METHOD g_editor4->set_statusbar_mode
      EXPORTING
        statusbar_mode = 0.
    CALL METHOD g_editor4->set_toolbar_mode
      EXPORTING
        toolbar_mode = 0.

  ENDIF.                "editor is initial
ENDFORM.                    " initialize_text_editor_0101
*&---------------------------------------------------------------------*
*&      Form  set_text_in_editor_0101
*&---------------------------------------------------------------------*
FORM set_text_in_editor_0101.
  CALL METHOD g_editor4->set_text_as_r3table
    EXPORTING table = it_pi_text
       EXCEPTIONS
           OTHERS = 1.

  IF sy-subrc NE 0.
    MESSAGE i015 WITH
     repid 'Error in set_text_as_r3table'.
  ENDIF.
  CALL METHOD cl_gui_cfw=>flush.
  IF sy-subrc NE 0.
    MESSAGE i015 WITH
     repid 'set_text_as_r3table: Error in FLUSH'.
  ENDIF.
ENDFORM.                    " set_text_in_editor_0101

*** " This section is called from the PAI routine of the screen
*&---------------------------------------------------------------------*
*&      Module  text_editor_retrieve_0101  INPUT
*&---------------------------------------------------------------------*
MODULE text_editor_retrieve_0101 INPUT.
  PERFORM text_editor_retrieve_0101.
ENDMODULE.                 " text_editor_retrieve_0101  INPUT
*---------------------------------------------------------------------*
*       FORM text_editor_retrieve_0101                                *
*---------------------------------------------------------------------*
FORM text_editor_retrieve_0101.
  CHECK NOT g_editor4 IS INITIAL.
  CALL METHOD g_editor4->get_text_as_r3table
    IMPORTING table = it_pi_text
       EXCEPTIONS
           OTHERS = 1.

  IF sy-subrc NE 0.
    MESSAGE i015 WITH
     repid 'Error in get_text_as_r3table'.
  ENDIF.

  CALL METHOD cl_gui_cfw=>flush.
  IF sy-subrc NE 0.
    MESSAGE i015 WITH
     repid 'get_text_as_r3table: Error in FLUSH'.
  ENDIF.
ENDFORM.