Application Development 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: 

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

aboooood
Participant
0 Kudos

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.
1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor

You could 'protect' the already existing lines, check method PROTECT_LINES (online help)

1 REPLY 1

raymond_giuseppi
Active Contributor

You could 'protect' the already existing lines, check method PROTECT_LINES (online help)