‎2008 Feb 25 9:40 AM
how can i save to and get the data from a table (having a text field of 255 char in size) , from using a text edit control.
Text Edit Control --> Database Table
Text Edit Control <-- Database Table
Thanx
‎2008 Feb 25 11:19 AM
Hi,
1) To start off ;
Place a Custom conatiner on screen set it's name to TEXTEDITOR
Created a reference to the custom Container & create it's object
DATA editor_container TYPE REF TO cl_gui_custom_container.
create object editor_container
exporting
container_name = 'TEXTEDITOR'
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
2) Created a reference to your Text Edit Control and create it's object :
DATA text_editor TYPE REF TO cl_gui_textedit.
create object text_editor
exporting
parent = editor_container
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_position = line_length
wordwrap_to_linebreak_mode = cl_gui_textedit=>true.
3)Hide toolbar and statusbar
call method text_editor ->set_toolbar_mode
exporting
toolbar_mode = cl_gui_textedit=>false.
call method text_editor->set_statusbar_mode
exporting
statusbar_mode = cl_gui_textedit=>false.
4) Answering your question Text Edit Control --> Database Table
call method text_editor->get_text_as_stream
exporting
only_when_modified = cl_gui_textedit=>false
importing
text = wrk_text
exceptions
others = 1.
Save wrk_text to Table
5) Text Edit Control <-- Database Table
The reverse process of Step 4
With method :
CALL METHOD text_editor->set_text_as_stream
......
I hope this answers your Query.
Cheers,
Remi
‎2008 Feb 25 11:19 AM
Hi,
1) To start off ;
Place a Custom conatiner on screen set it's name to TEXTEDITOR
Created a reference to the custom Container & create it's object
DATA editor_container TYPE REF TO cl_gui_custom_container.
create object editor_container
exporting
container_name = 'TEXTEDITOR'
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
2) Created a reference to your Text Edit Control and create it's object :
DATA text_editor TYPE REF TO cl_gui_textedit.
create object text_editor
exporting
parent = editor_container
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_position = line_length
wordwrap_to_linebreak_mode = cl_gui_textedit=>true.
3)Hide toolbar and statusbar
call method text_editor ->set_toolbar_mode
exporting
toolbar_mode = cl_gui_textedit=>false.
call method text_editor->set_statusbar_mode
exporting
statusbar_mode = cl_gui_textedit=>false.
4) Answering your question Text Edit Control --> Database Table
call method text_editor->get_text_as_stream
exporting
only_when_modified = cl_gui_textedit=>false
importing
text = wrk_text
exceptions
others = 1.
Save wrk_text to Table
5) Text Edit Control <-- Database Table
The reverse process of Step 4
With method :
CALL METHOD text_editor->set_text_as_stream
......
I hope this answers your Query.
Cheers,
Remi