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: 

How to create text editor?

Former Member
0 Kudos

Hello Gurus....

I have a requirment to give two editor on the screen.

I have used the the fowwloing code in my prog for editor...

but after running this for both Internal table I am getting same value of 2 container.

Can you please tell me howto get first containr value in 1 TTAB

and 2 container value in 2 ITAb.

My code for your ref.....

  • create control container

create object g_editor_container

exporting

container_name = 'TEXTEDITOR1'

if sy-subrc ne 0.

  • add your handling

endif.

g_mycontainer = 'TEXTEDITOR1'.

  • create calls constructor, which initializes, creats and links

  • TextEdit Control

create object g_editor

exporting

parent = g_editor_container

wordwrap_mode =

  • cl_gui_textedit=>wordwrap_off

cl_gui_textedit=>wordwrap_at_fixed_position

  • cl_gui_textedit=>WORDWRAP_AT_WINDOWBORDER

wordwrap_position = line_length

wordwrap_to_linebreak_mode = cl_gui_textedit=>true.

  • to handle different containers

g_container_linked = 1.

refresh g_mytable. " to initialize table upon OK_CODE 'BACK' at PAI

*======================================================================

  • create control container

create object g_editor_container

exporting

container_name = 'TEXTEDITOR2'

if sy-subrc ne 0.

  • add your handling

endif.

g_mycontainer = 'TEXTEDITOR2'.

  • create calls constructor, which initializes, creats and links

  • TextEdit Control

create object g_editor

exporting

parent = g_editor_container

wordwrap_mode =

  • cl_gui_textedit=>wordwrap_off

cl_gui_textedit=>wordwrap_at_fixed_position

  • cl_gui_textedit=>WORDWRAP_AT_WINDOWBORDER

wordwrap_position = line_length

wordwrap_to_linebreak_mode = cl_gui_textedit=>true.

  • to handle different containers

g_container_linked = 1.

refresh g_mytable1. " to initialize table upon OK_CODE 'BACK' at PAI

endif.

endmodule. " STATUS_1000 OUTPUT

&----


*& Module USER_COMMAND_1000 INPUT

&----


  • text

----


module USER_COMMAND_1000 input.

case SY-UCOMM.

when 'EXIT'.

perform exit_program.

when 'SAVE'.

  • retrieve table from control

call method g_editor->get_text_as_r3table

importing table = g_mytable.

call method cl_gui_cfw=>flush

exceptions

others = 1.

if sy-subrc ne 0.

endif.

call method g_editor->get_text_as_r3table

importing table = g_mytable1.

call method cl_gui_cfw=>flush

exceptions

others = 1.

if sy-subrc ne 0.

endif.

endcase.

endmodule. " USER_COMMAND_1000 INPUT

4 REPLIES 4

Former Member
0 Kudos

Question in Simple term

Hello Gurus.... I have a requirment to give two editor on the screen. I have used the the fowwloing code in my prog for editor... but after running this for both Internal table I am getting same value of 2 container. Can you please tell me howto get first containr value in 1 TTAB and 2 container value in 2 ITAb.

0 Kudos

No one will read your code unless you format it to be readable. There are a lof of formatting links in top of the editor and on left side of the editor

0 Kudos

Hi,

i have once created the text editor. I can't read your code, but what I have done there is I have saved the text written in editor in table STXL and then read this text using FM READ_TEXT. I don't think you are doing it here

Edited by: Anurag_n on Mar 31, 2010 9:06 AM

praveen_hannu
Contributor
0 Kudos

Hi

Check the function module 'TERM_CONTROL_EDIT, since it is not formatted you code, its very diffucult to understand.

This function module to achive the requirement which you are looking for. See the include LSTERM_CONTROLSO01, for calling the custom containers for it.

Thanks

Praveen