Hi,
I have made a custom application, to create the enquiry, In that while creating the Enquiry I have given a long text editor, where user can enter the long text. Now in the change enquiry transaction In the long text editor I want to show the old text in the display mode only and user can add the new lines below that code I used the below code, but system is not allowing me to enter new text also below the old text.
CALL METHOD text_editor->set_text_as_r3table
EXPORTING
table = GT_ELINES
EXCEPTIONS
error_dp = 1
error_dp_create = 2
others = 3
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR : GV_LINE.
APPEND GV_LINE TO GT_ELINES. "append blank line
DESCRIBE TABLE GT_ELINES LINES GV_TABIX. "GV_ILINE.
GV_ILINE = GV_TABIX - 1.
CALL METHOD text_editor->SELECT_LINES
EXPORTING
FROM_LINE = 1
TO_LINE = GV_ILINE.
CALL METHOD text_editor->PROTECT_SELECTION
EXPORTING
PROTECT_MODE = 1
ENABLE_EDITING_PROTECTED_TEXT = 1.
GV_TABIX1 = GV_TABIX.
GV_TABIX2 = GV_TABIX1.
CALL METHOD text_editor->SELECT_LINES
EXPORTING
FROM_LINE = GV_TABIX1
TO_LINE = GV_TABIX2.
CALL METHOD text_editor->PROTECT_SELECTION
EXPORTING
PROTECT_MODE = 0
ENABLE_EDITING_PROTECTED_TEXT = 0.
CALL METHOD text_editor->SET_SELECTION_POS
EXPORTING
FROM_LINE = 0 " YOCX_TEXT-FROM_LINE
FROM_POS = 0 " YOCX_TEXT-FROM_POS
TO_LINE = 0 " YOCX_TEXT-TO_LINE
TO_POS = 0. " YOCX_TEXT-TO_POS.
* CALL METHOD cl_gui_cfw=>flush.
with this code the total text editor is protect for text editing.
regards,
zafar