2008 Nov 17 12:51 PM
HAI CAN ANYONE TELL ME HOW TO ADD TEXT EDITOR IN MY SCREEN ?
2008 Nov 17 1:02 PM
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.
2008 Nov 17 12:52 PM
2008 Nov 17 12:57 PM
Try class c_textedit_control
Search for it on this forum.
regards,
Hans
2008 Nov 17 1:02 PM
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.