Skip to Content
0
Sep 19, 2023 at 01:29 PM

write new text in container while the old one on read only

26 Views

Hello Experts,

so i have a container where i can write i text in it and now if i save like 4 lines.

if someone want to write new line he can see the old one (4 lines) but cant edit it.

if i use cl_gui_textedit it will edit all the text.

is there anyway to solve this?

  IF gc_container IS NOT INITIAL.
CALL METHOD gc_container->free.
FREE: gc_container.
ENDIF.

IF gc_text_edit IS NOT INITIAL.
CALL METHOD gc_text_edit->free.
FREE: gc_text_edit.
ENDIF.

CREATE OBJECT gc_container
EXPORTING
container_name = 'LC_CUST_TEXT'.

CREATE OBJECT gc_text_edit
EXPORTING
parent = gc_container
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
* wordwrap_to_linebreak_mode = cl_gui_textedit=>false
wordwrap_to_linebreak_mode = cl_gui_textedit=>true "INS THHE
wordwrap_position = g_line_length
EXCEPTIONS
OTHERS = 1.

IF gv_display = 'X'.
CALL METHOD gc_text_edit->set_readonly_mode.
ENDIF.

CALL METHOD gc_text_edit->set_toolbar_mode
EXPORTING
toolbar_mode = 0
EXCEPTIONS
error_cntl_call_method = 1
invalid_parameter = 2
OTHERS = 3.

CALL METHOD gc_text_edit->set_statusbar_mode
EXPORTING
statusbar_mode = cl_gui_textedit=>false
EXCEPTIONS
error_cntl_call_method = 1
invalid_parameter = 2
OTHERS = 3.

CLEAR: lt_lines[], ls_lines, gt_table[].

CALL FUNCTION 'ZWF1_NM1_TEXT_READ'
EXPORTING
iv_vbeln = gv_vbeln
iv_chano = gv_chgno
iv_all = ' '
TABLES
lines = lt_lines.

LOOP AT lt_lines INTO ls_lines.
APPEND ls_lines-tdline TO gt_table.
ENDLOOP.

CALL METHOD gc_text_edit->set_text_as_r3table
EXPORTING
table = gt_table
EXCEPTIONS
error_dp = 1
error_dp_create = 2
OTHERS = 3.